cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice HTTP Error response

Former Member
0 Kudos

Hi,

The scenario we are designing includes making a webservice call to an external (non SAP) webservice using SOAMANAGER and service consumer.

On triggering a webservice request, the service providing system will send across a HTTP 400 response with the error message in the HTTP payload back to SAP (if it failes validation at their end ).

My question is, will my calling ABAP program be able to read this HTTP error payload. From what i know the exception raised will be of class type "cx_ai_system_fault" along with a short text "HTTP Code 400  : Bad Request". But will the program be able to access the actual HTTP payload containing the message sent across by the web service providing system

Thanks in Advance,

Alan

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Dsilva,

The constructor for CX_AI_SYSTEM_FAULT only lists TEXTID, PREVIOUS, CODECONTEXT, CODE, ERRORTEXT and LANGUAGE as its parameters. I think there is no way for you to display the actual payload. In contrast, using IF_HTTP_CLIENT you can display the HTTP Body by

IF_HTTP_CLIENT->RESPONSE->GET_CDATA( ).

Regards,

Mark

Former Member
0 Kudos

Thanks for the reply Mark.

The actual HTTP 400 Payload should be accessible from the ICM Logs (level 3). But like you mentioned, it doesn't appear to be part of the CX_AI_SYSTEM_FAULT class - which is invoked when any response other than a HTTP 200 OK is received.

In contrast if the response is of type HTTP 200 Ok, the response payload should be accessible.

Sounds about right doesn't it ?

Regards,

Alan

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Alan,

Yes, the payload can be accessed in case of an HTTP 200. That is why most prefer the flexibility of

the IF_HTTP_CLIENT

Regards,

Mark

Answers (0)