SAP Knowledge Base Article - Public

3347459 - How to Handle HTTP Error While Receiving Response Error in Custom Web Service For Custom Business Object Instance Creation

Symptom

You have created an external web service which results in error. The error says "HTTP error while receiving response". Now, you would like to use such failure request to create instances in a custom business object via script in order to handle such scenarios. 

Environment

  • SAP Cloud for Customer
  • SAP Business ByDesign
  • SAP Cloud Applications Studio

Reproducing the Issue

  1. Create a Custom Business Object.
  2. Create an External Web Service.
  3. Send a Request for External Web Service.
  4. You can see "HTTP error while receiving response".
  5. Now, you create a script to create an instance in custom business object when the web service response has aforementioned error message.
  6. The instances of the custom business object are not saved. 

Cause

These errors are raised because web service fails and even before taking exact error of the web service response, the system already raises "HTTP error while receiving response" error message. Since it is an Error (E) message, the system does not save those instances, which is expected from a technical system perspective. In summary, if the web service itself fails, then the system raises error message and consequently the save also fails. 

 

Resolution

The system currently does not support such scenario. There is no way to handle these web service errors since these error messages will be raised and prevent you to save any instance in custom business objects.

Keywords

HTTP error while receiving response, web service, business object, save fails, custom web service , KBA , AP-RC-BDS-WS , ByDesign Studio Web Services , How To

Product

SAP Business ByDesign all versions ; SAP Cloud Applications Studio all versions ; SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions