WSimport工具生成缺少成员的客户端存根

时间:2012-08-28 13:36:14

标签: java web-services wsimport

我使用Metro 2.2.1设计了一个简单的Web服务界面。当我运行Java SE附带的wsimport实用程序(build 1.6.0_24-b07-334)并将其指向WSDL URL位置时,它会生成客户端存根代码,但代码缺少方法。我很难过为什么会这样,并且会感激任何指示。

主Web服务类AutoUpdateAPI具有以下方法:

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

它返回一个具有以下定义的UpdateActionWS类:

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;
}
}

现在,当生成客户端存根时,此类的输出如下:

/**
* <p>Java class for updateActionWS complex type.
* 
* <p>The following schema fragment specifies the expected content contained within this class.
* 
* <pre>
* &lt;complexType name="updateActionWS">
*   &lt;complexContent>
*     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
*       &lt;sequence>
*         &lt;element name="forcedInstall" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
*       &lt;/sequence>
*     &lt;/restriction>
*   &lt;/complexContent>
* &lt;/complexType>
* </pre>
* 
* 
*/
@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;
}

}

我的问题是:为什么忽视其他方法?我尝试使用Apache-CXF-2.3.3附带的wsimport实用程序。我已经尝试将最新的JAX-WS库添加到Java的认可库中,但没有运气。任何指针都会受到赞赏。

0 个答案:

没有答案