我有 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 我生成了存根。在通过实现生成接口开发 web 服务时,作为注释的一部分,应该给出 portName 属性是什么@WebService
,因为 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
请帮助您对此的看法。
谢谢