Sometimes I send an invalid SOAP request to a web service and receive a HTTP 500 Internal Server Error with an according SOAP Fault element in the SOAP body. Say, it's because I have sent a request with data in a newer XSD version which the older web service does not understand, and the SOAP Fault's faultstring does tell via a validation message which element is unexpected, thereby helping to solve the problem.
Is it possible to receive that SOAP Fault element within a web client procedure?
Currently, I'm using a web client procedure of type 'HTTP:POST:text/xml' so I can usually receive the full response including its headers.
However, when the web service returns a HTTP 500 status, the web client procedure raises a -983 SQLCODE ("HTTP request failed. Status code '500 Internal Server Error'"), and so I cannot access the SOAP response with the SOAP Fault details. Only the web client log (dbsrv12 -zoc) contains the full SOAP response.
I would prefer to be able to return the SOAP Fault message to the client. Is there a way to do so?
asked 31 Mar '16, 05:18
Note that quote from the docs:
So the caller is now responsible to check whether the desired result or an exception has been returned by the web client function/procedure.
Thanks for the nice enhancement!