I’m facing a problem with web service.
I had a web service which long time was deployed and running on WebSphere application server using IBM web service’s stack. Now I had migrated it to glassfish v2.1.1 to Axis 1.4 stack. Web service’s WSDL did not change to keep clients compatibility
There is a web service method which has Boolean return type. The problem is when I call my method soap response returns different in glassfish:
Example:
WebSphere:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<checkPendingOperationsResponse xmlns="http://operations.appserver.dealer.omnitel.lt">
<checkPendingOperationsReturn xsi:type="xsd:boolean" xmlns="">0</checkPendingOperationsReturn>
</checkPendingOperationsResponse>
</soapenv:Body>
</soapenv:Envelope>
Glassfish:
<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>
<ns1:checkPendingOperationsResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://operations.appserver.dealer.omnitel.lt">
<checkPendingOperationsReturn href="#id0"/>
</ns1:checkPendingOperationsResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:boolean" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">false</multiRef>
</soapenv:Body>
</soapenv:Envelope>
The problem is that some clients is not able to handle “false”, “true” values, because earlier returned values was “1”, “0”.
Is there a solution to this or substantiation that it is not possible to solve?
Thanks in advance.
Well if you want to still return 1 and 0 for those values (corresponding to true and false) you can force the return class like it sais here or create an interceptor that changes it before sending the response.