Quantcast
Channel: SCN : Popular Discussions - SAP NetWeaver Gateway Developer Center
Viewing all articles
Browse latest Browse all 1657

How to get a http 5xx error status (system dump) in JSON format?

$
0
0

Hi guy's,

 

In Gateway we created an REST API.

When we consume this API with the query option ?$format=json and use the following HTTP Headers in the GET Method to get results in JSON format it works fine and we receive the data correct in JSON format:

 

Content-Type -> application/json
X-Requested-With -> XMLHttpRequest
Accept -> application/json

 

All http 2xx, 3xx and 4xx client errors that occur will be displayed correctly in JSON format (e.g. http 400 bad request, because wrong query options are added to the consuming API url):

 

{

  "error": {

    "code": "005056A509B11ED1B9BF94F386DD82E6",

    "message": {

      "lang": "en",

      "value": "The Data Services Request could not be understood due to malformed syntax"

    }

  }

}

 

Only when a http 5xx internal server errors occur (system dump) the error information is displayed in XML format (e.g. system dump occors or an RFC destination is not reachable):

 

<error>

<code>HTTP/500/E/Internal Server Error</code>

<message>

  Call of service XXXX  terminated because of an error. The following error text was processed in system XXXX : Error when opening an RFC connection (CPIC-CALL: 'XXXXX Unable to determine host address: NiHostToAddr failed ).The error occurred on the application server XXXX  The termination type was: RABAX_STATE.If the termination type is RABAX_STATE, you will find more information on the cause of termination in system XXXX in transaction ST22. If the termination type is ABORT_MESSAGE_STATE, you will find more information on the cause of termination on the application server XXXXX in transaction SM21. If the termination type is ERROR_MESSAGE_STATE, you can search for further information in the trace file for the work process in transaction ST11 on the application server XXXXX. You may also need to analyze the trace files of other work processes. If you do not yet have a user ID, contact your system adminmistrator.

</message>

 

</error>

 

How to get a http 5xx error in JSON format?


Viewing all articles
Browse latest Browse all 1657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>