java Jboss ws-wsdl问题
我有wsdl,其中定义了多个端口名和绑定,如下所示:
<wsdl:service name="NPCWebService">
<wsdl:port name="NPCWebServiceHttpEndpoint" binding="xsd:NPCWebServiceHttpBinding">
<http:address location="http://localhost:8080/axis2/services/NPCWebService"/>
</wsdl:port>
<wsdl:port name="NPCWebServiceHttpSoap12Endpoint" binding="xsd:NPCWebServiceSoap12Binding">
<soap12:address location="http://localhost:8080/axis2/services/NPCWebService"/>
</wsdl:port>
<wsdl:port name="NPCWebServiceHttpSoap11Endpoint" binding="xsd:NPCWebServiceSoap11Binding">
<soap:address location="http://localhost:8080/axis2/services/NPCWebService"/>
</wsdl:port>
</wsdl:service>
我使用wsconsume生成了存根。
当通过实现生成接口开发webservice时,作为@WebService
注释的一部分,应该给出什么portName属性,因为wsdl有3个值
此外,无论我在3个端口中给出哪个端口名,我都会得到“找不到端口…”部署战争时出现异常
例外情况:
12:43:32,609 ERROR [MainDeployer] Could not start deployment: file:/C:/jboss-4.2
.2.GA/server/default/deploy/JbossWS.war
org.jboss.ws.WSException: Cannot find port in wsdl: {http://jbossws.np.hp.com/}N
PCWebServiceHttpSoap11Endpoint
请帮忙谈谈你的观点
谢谢
# 1 楼答案
我也犯了同样的错误:确保WSDL中声明的名称空间与实现相同(这里您的实现位于
com.hp.np.jbossws
,正如错误指定的那样)