Simple axis2.xml for Axis2 integrated in webapp

I am developing a webapp with a built-in webservice with Axis2 using Maven. The service implementation is an RPC-type POJO, the target application server is Tomcat, which runs the Axis2 servlet.

"Hello world" works, but now I need to configure some global axis2 parameters in the axis2.xml file (located under WEB-INF / conf).

Please indicate or indicate a simple configuration for axis2.xml for this general environment. The default value taken from the binary distribution includes too many functions (hotdeploy?), And also causes this problem:

<soapenv:Reason>
    <soapenv:Text xml:lang="en-US">
        The ServiceClass object does not implement the required method 
        in the following form: OMElement ping(OMElement e)
    </soapenv:Text>
</soapenv:Reason>

By reference: http://axis.apache.org/axis2/java/core/docs/servlet-transport.html says that this way you configure the servlet transport, but this does not solve the problem.

<transportReceiver name="http" class="org.apache.axis2.transport.http.AxisServletListener"/>
0
source share
2 answers

Apparently the problem is that default2.xml sets raw xml messageReceivers instead of RPC by default.

Try adding this to services.xml for the developed service to fix this problem.

<messageReceivers>
           <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
                   class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
           <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
                   class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</messageReceivers>
+3
source

"The solution that worked for me was to add an operation tag in service.xml to the name of the Java Service method:

 <operation name="sayHello" >
        <messageReceiver  mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
    </operation>        
<parameter name="ServiceClass" locked="false">com.learning.webservices.pojo.HelloService</parameter>
+3
source

Source: https://habr.com/ru/post/1017084/


All Articles