cancel
Showing results for 
Search instead for 
Did you mean: 

Catching error messages in Webservice response

Former Member
0 Kudos

Hi,

The webservice I am trying to call from ABAP is throwing address not found exception which is caught by cx_ai_system_fault exception class. This class only returns <faultcode> and <faultstring> but not <ErrorCode> and <ErrorMsg> in <detail> node.

Is there any way I could get information from <detail> node?

Below is response I am getting from webservice.


<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Fault occurred</faultstring>
<faultactor><a href="http://testserver/Addressverification/addressservices.asmx" TARGET="test_blank">http://testserver/Addressverification/addressservices.asmx</a></faultactor>
<detail>
<ErrorCode xmlns="http://www.testserver.com">2</ErrorCode>
<ErrorMsg xmlns="http://www.testserver.com">ADDRESS NOT FOUND</ErrorMsg>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>

Thank you,

Jagadish

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This is resolved. We finally found out there was something wrong in the WSDL itself and provider has corrected it.

Former Member
0 Kudos

If you see proxy structure created from wsdl then you can find exception class which may have "Detail" node.

Regards,

gourav