简体   繁体   中英

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:

<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: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

This is my 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? or any other way to avoid this mismatch?

我解决了实现axis2.xml并将servicepath参数更新为以下问题:

<parameter name="servicePath">axis2/services</parameter>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM