I have an Axis 1 web service with an Axis 1 client. Everything is working quite well, and the data I’m getting from the web service is correct. Now, there’s a requirement to move the web service to use Axis 2, I’m having problems to get data on the Axis 1 client. I have used SOAPUI to see the format of the response that I’m getting.
With the Axis 1 web service, the response was as follows:
<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:Body>
<getInventoryResponse xmlns="http://webservices.com">
<getInventory>
<errorCode>10071</errorCode>
<inventory xsi:nil="true"/>
</getLastInventoryCountReturn>
</getInventoryResponse>
</soapenv:Body>
</soapenv:Envelope>
With the Axis 2 web service, the response is as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:getInventoryResponse xmlns:ns="http://webservices.com">
<ns:return xsi:type="ax21:Inventory" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax21="http://model.com/xsd">
<ax21:errorCode>10071</ax21:errorCode>
<ax21:inventory xsi:nil="true"/>
</ns:return>
</ns:getInventoryResponse>
</soapenv:Body>
</soapenv:Envelope>
As you can see, the element called “errorCode” has a value of 10071. I’m receiving the errorCode value correctly on the client from both web services. But I have a complex type called “Inventory” that I receive as part of the response (It doesn’t appear in the responses I have included above ’cause it will take me some time to populate the appropriate data on the web service). The InventoryItem contains fields of different data types (String, Calendar). What I have noticed is that the response from the Axis 2 web service contains the <axs21> xml tag whereas in the Axis 1 web service, it’s not there. So I’m assuming that I have a parsing problem on the client side with the response coming from the Axis 2 web service.
Does anyone know how can I solve this?
So apparently I was doing something wrong. I had to recreate my client code when moving the web service from Axis 1 to Axis2.