服务器:JBoss 7.1 Java:7(JAX-WS 版本:2.2.4-b01)
例1:
@Name("CustomerServices")
@Stateless
@WebService
public class CustomerServices{ ... }
例 2:
@Name("CustomerServices")
@Stateless
@WebService(servicename="CustomerServices")
public class CustomerServices { ... }
当 JBOSS 通过 JAX-WS 生成 wsdl 文件时,wsdl 看起来像:
例1:
<wsdl:definitions>
...
<wsdl:service name="CustomerServicesService">
<wsdl:port binding="tns:CustomerServicesServiceSoapBinding">
<soap:address location="<host>:<port>/<ejb-context>/CustomerServices"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
例 2:
<wsdl:definitions>
...
<wsdl:service name="CustomerServices">
<wsdl:port binding="tns:CustomerServicesServiceSoapBinding">
<soap:address location="<host>:<port>/<ejb-context>/CustomerServicesService/CustomerServicesService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
所以我的问题是,如何获得这个输出?
<wsdl:definitions>
...
<wsdl:service name="CustomerServices">
<wsdl:port binding="tns:CustomerServicesServiceSoapBinding">
<soap:address location="<host>:<port>/<ejb-context>/CustomerServices"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
服务名称必须是CustomerServices而不是 CustomerServicesService,并且地址位置必须是../CustomerServices
谢谢。