Skip to main content

WSimport tools generates a client stub with missing members

2 replies [Last post]
jamieb22
Offline
Joined: 2008-03-12
Points: 0

Greetings!

I have designed a simple web services interface using Metro 2.2.1. When I run the wsimport utility that comes with Java SE (build 1.6.0_24-b07-334) and point it to the WSDL URL location, it generates the client stub code, but the code has missing methods. I am stumped as to why this is the case and would appreciate any pointers.

The main web service class AutoUpdateAPI has the method:

public UpdateActionWS getLatestUpdate(@WebParam(name = "application") String application, @WebParam(name = "version") String version,@WebParam(name = "entries") UpdateItemWS[] entries, @WebParam(name = "license") String license);

It returns an UpdateActionWS class that has the following definition:

public class UpdateActionWS {

protected String url;
protected String version;
protected boolean forcedInstall = false;

protected UpdateItemWS[] additions;
protected UpdateItemWS[] subtractions;
protected UpdateItemWS[] changes;

public UpdateActionWS() {

}

protected UpdateActionWS(String url, String version, boolean forcedInstall, UpdateItemWS[] additions, UpdateItemWS[] subtractions, UpdateItemWS[] changes) {
this.additions = additions;
this.subtractions = subtractions;
this.changes = changes;
this.url = url;
this.version = version;
this.forcedInstall = forcedInstall;
}

@WebMethod
public UpdateItemWS[] getAdditions() { return additions; }
@WebMethod
public UpdateItemWS[] getSubtractions() { return subtractions; }
@WebMethod
public UpdateItemWS[] getChanges() { return changes; }

@WebMethod
public String getUpdateURL() { return url; }

@WebMethod
public String getVersion() {
return version;
}

@WebMethod
public boolean getForcedInstall() {
return forcedInstall;
}
@WebMethod
public void setForcedInstall(boolean forcedInstall) {
this.forcedInstall = forcedInstall;
}
}

Now, when the client stub is generated, the output for this class is as follows:

/**
*

Java class for updateActionWS complex type.
*
*

The following schema fragment specifies the expected content contained within this class.
*
*

   * <complexType name="updateActionWS">
   *   <complexContent>
   *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
   *       <sequence>
   *         <element name="forcedInstall" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
   *       </sequence>
   *     </restriction>
   *   </complexContent>
   * </complexType>
   *

*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "updateActionWS", propOrder = {
"forcedInstall"
})
public class UpdateActionWS {

protected boolean forcedInstall;

/**
* Gets the value of the forcedInstall property.
*
*/
public boolean isForcedInstall() {
return forcedInstall;
}

/**
* Sets the value of the forcedInstall property.
*
*/
public void setForcedInstall(boolean value) {
this.forcedInstall = value;
}

}

My question is: why does it disregard the other methods? I've tried adding latest JAX-WS libs to Java's endorsed lib, but no luck. Any pointers would be appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Glen Mazza

That doesn't look like a "client stub code" (a usually unnecessary
helper class that makes skeleton web service calls so the newbie user
would know the format of the web service calls) but rather a skeleton
implementation of a web service endpoint interface (SEI). You might
wish to try to run with CXF's wsdl2java utility
(http://www.jroller.com/gmazza/entry/soap_client_tutorial) and see if
there's any difference it what it supplies you. You should be getting
just JAXB classes for elements defined in your WSDL and two other
classes, one implementing the wsdl:service and the other the wsdl:port
within that service. You shouldn't need anything else to make client calls.

Glen

jamieb22
Offline
Joined: 2008-03-12
Points: 0

By the way, I did remember to add @WebService annotation at the top of the class.