我有一个使用 CXF 在我的计算机上运行的测试 web 服务,我一直在尝试使用 Apache Axis2 的“wsdl2java”功能来制作客户端。我已经生成了代码,但出现以下错误:
org.apache.axis2.AxisFault: The given SOAPAction http://service.taller1.webservices.spring.com/HolaMundoService/saludaHola does not match an operation.
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.spring.webservices.taller1.service.impl.HolaMundoServiceImplServiceStub.saludaHola(HolaMundoServiceImplServiceStub.java:182)
at mian.Main.main(Main.java:27)
这里是wsdl:
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://impl.service.taller1.webservices.spring.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:ns1="http://service.taller1.webservices.spring.com/" name="HolaMundoServiceImplService" targetNamespace="http://impl.service.taller1.webservices.spring.com/">
<wsdl:import location="http://localhost:8080/webservice-cfx-spring-0.0.1-SNAPSHOT/HolaMundoService?wsdl=HolaMundoService.wsdl" namespace="http://service.taller1.webservices.spring.com/">
</wsdl:import>
<wsdl:binding name="HolaMundoServiceImplServiceSoapBinding" type="ns1:HolaMundoService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="saludaHola">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="saludaHola">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="saludaHolaResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HolaMundoServiceImplService">
<wsdl:port binding="tns:HolaMundoServiceImplServiceSoapBinding" name="HolaMundoServiceImplPort">
<soap:address location="http://localhost:8080/webservice-cfx-spring-0.0.1-SNAPSHOT/HolaMundoService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
我将不胜感激任何帮助。在此先感谢您的帮助!