cancel
Showing results for 
Search instead for 
Did you mean: 

Async Reciever Rest Service call Handling 200 response

sridharreddy_kondam
Active Contributor
0 Kudos

Hi All,

We have a scenario IDOC to Rest service(Async)... Receiver system sends the response with status 200, this 200 status can have successful information + can have Error information like Field1 is missing etc... User doens not exist etc..

I tried using the Rest receiver adapter provided customer Error Handling, but never i am able to capture the Missing field information from Status 200...

Question here is Can we catch the Responses from Status 200 for Rest service call? If not do we need to use other ways like async --Sync? but this may involve BPM here..

Please suggest with your valuable inputs..

Thanks and Regards,

Sridhar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sridhar,

I'd say that is a defect in the receiving system, the HTTP spec is pretty clear about that:

200 OK

The request has succeeded. The information returned with the response is dependent on the method used in the request, for example:

  • GET an entity corresponding to the requested resource is sent in the response;
  • HEAD the entity-header fields corresponding to the requested resource are sent in the response without any message-body;
  • POST an entity describing or containing the result of the action;
  • TRACE an entity containing the request message as received by the end server.

So the receiving system doesn't follow the HTTP protocol and the REST adapter can't distinguish a successful call from an unsuccessful one.

All status codes with 2xx signal a successful operation. The receiving system should return an error code 4xx which signals an error by the client as a missing mandatory field would be. A good choice would for example be: 400 Bad Request

More info here: HTTP/1.1: Status Code Definitions

Best regards,

Frank

Emre_tr
Active Participant
0 Kudos

Hi,

Normally you can use Sync-Async bride to get the response message if the adapter is SOAP. But i don't know Sync-async bridge works with REST adapter, you should check. if supports it's easier than using BPM.