[英]Changing address location on axis2 WSDL
Currently I am implementing Axis2 inside my project (ROOT.war, http://localhost:8080/ ), but we need to use the next url to call our web service " http://localhost:8080/axis2/services/MyService ", so I implemented this set up on web.xml: 当前,我正在项目(ROOT.war, http:// localhost:8080 / )中实现Axis2,但是我们需要使用下一个URL来调用我们的Web服务“ http:// localhost:8080 / axis2 / services / MyService ”,因此我在web.xml上实现了此设置:
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/axis2/services/*</url-pattern>
</servlet-mapping>
But when we check the generated wsdl( http://localhost:8080/axis2/services/MyService?wsdl ) there is a part(location value) which is still pointing to http://localhost:8080/services/ instead of http://localhost:8080/axis2/services/ 但是当我们检查生成的wsdl( http:// localhost:8080 / axis2 / services / MyService?wsdl )时,有一部分(位置值)仍指向http:// localhost:8080 / services /而不是http :// localhost:8080 / axis2 / services /
<wsdl:service name="MyService">
<wsdl:port name="MyServiceHttpSoap11Endpoint" binding="tns:MyServiceSoap11Binding">
<soap:address location="http://localhost:8080/services/MyService.MyServiceHttpSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="MyServiceHttpSoap12Endpoint" binding="tns:MyServiceSoap12Binding">
<soap12:address location="http://localhost:8080/services/MyService.MyServiceHttpSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="MyServiceHttpEndpoint" binding="tns:MyServiceHttpBinding">
<http:address location="http://localhost:8080/services/MyService.MyServiceHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
So when I tried to test my WS using SOAP UI is throws an error since I am trying to test with http://localhost:8080/axis2/services/MyService but is set up with http://localhost:8080/services/MyService 因此,当我尝试使用SOAP UI测试WS时,由于我尝试使用http:// localhost:8080 / axis2 / services / MyService进行测试,但设置为http:// localhost:8080 / services /,因此会引发错误我的服务
This is my services.xml 这是我的services.xml
<service name="MyService" >
<Description>
MyService Web Service
</Description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass" locked="false">com.xxx.yyy.ws.webservice.MyService</parameter>
</service>
Is there a way to set up something on services.xml to change the url? 有没有办法在services.xml上设置一些东西来更改URL? or any other way to avoid this mismatch?
或其他避免这种不匹配的方式?
我解决了实现axis2.xml并将servicepath参数更新为以下问题:
<parameter name="servicePath">axis2/services</parameter>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.