I'm in the process migrating a service from Axis to Axis2 (Java). The service responds to a simple SOAP request with a bit of "custom" XML in the body like the following:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
<UsernameToken Id="MyID">
<Username>user</Username>
<Password>pass</Password>
</UsernameToken>
</wsse:Security>
<dstm:ClientType xmlns:dstm="http://schemas.company.com/My_functions">Messaging.EWS</dstm:ClientType>
<dstm:SessionScenario xmlns:dstm="http://schemas.company.com/My_functions">terminate</dstm:SessionScenario>
<dstm:Organization xmlns:dstm="http://schemas.company.com/My_functions">*</dstm:Organization>
</soapenv:Header>
<soapenv:Body>
<tt:processBodyMessage xmlns:tt="http://core.ws.com"/>
<GetZipCode_001 version="1.0" xmlns="http://schema.company.com/Company/1">
<Get>
<ActionExpression>getEntity</ActionExpression>
</Get>
<ZipCodeID>
<Id>10003</Id>
</ZipCodeID>
</GetZipCode_001>
</soapenv:Body>
</soapenv:Envelope>
In Axis1, the service took an array of org.wc3.dom Elements as a parameter and processed them, e.g.
public Element[] processMessage(Element [] elems) { ... }
If I migrate the service to Axis2, I'm able to invoke it, but debugging reveals that the elems array is empty. This is using RPCMessageReceivers in a mostly vanilla services.xml:
<service name="Connector">
<Description>
Connector Service ported to Axis2
</Description>
<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>
<parameter name="ServiceClass" locked="false">com.ws.core.Service</parameter>
</service>
From what I've read about Axis2, it is generally not a good idea to have DOM objects in your service signature, so I tried using AXIOM OMElements:
public OMElement processMessage(OMElement e) { ... }
in conjunction with the RawXMLINOutMessageReceiver:
<service name="Connector">
<Description>
Connector Service ported to Axis2
</Description>
<operation name="processMessage">
<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
</operation>
<parameter name="ServiceClass" locked="false">com.ws.core.Service</parameter>
</service>
This works a little better, but the only thing that gets passed into "e" is the first element of the SOAP body.
If I try to change the method signature to accept an array of OMElements:
public OMElement processMessage(OMElement[] e) { ... }
I get an Axis2 fault complaining that there is no method that implements the required method signature.
I have also tried using an array of OMElements with RPCMessageReceiver, but this results in an empty array being passed in.
Can anyone offer advice about what sort of receiver/method signature combination I can use to get access to all XML elements in the body of the SOAP request? Thanks in advance.