【发布时间】:2015-02-05 03:24:40
【问题描述】:
我目前正在 javaEE 中开发一个 jax-ws 服务。一切正常,我能够生成soapUI测试。但是当我访问 url 中的 wsdl 时,它不会显示复杂的类型定义。示例代码如下:
@WebService
public interface AccountWs {
@WebMethod
ActionStatus createCustomer(@WebParam(name = "customer") CustomerDto postData);
}
@WebService(serviceName = "AccountWs", endpointInterface = "org.xxx.api.ws.AccountWs")
public class AccountWsImpl implements AccountWs {
@Override
public ActionStatus createCustomer(CustomerDto postData) {
}
}
@XmlRootElement(name = "Customer")
@XmlAccessorType(XmlAccessType.FIELD)
public class CustomerDto {
private String code;
}
我的另一个问题是如何在生成的 wsdl 和枚举枚举等其他属性中添加基数?上面的代码应该生成如下内容:
<xsd:complexType name="CustomerDto">
<xsd:sequence>
<xsd:element minOccurs="0" name="code" nillable="true" type="xsd:string"/>
...
【问题讨论】:
标签: jakarta-ee soap jax-ws java-ee-6