cancel
Showing results for 
Search instead for 
Did you mean: 

REST Sender/Receiver - handling non-200 HTTP status code gracefully

jagesh
Explorer
1,403

Hi,

I have a scenario like REST sender Adapter (JSON input) to PO 7.5 SP17 to REST Receiver (SAP ECC ODATA service).

on the receiver side, when HTTP POST operation is successful then receiver ODATA service returns HTTP status code 201 but on sender system gets HTTP status code as 200 (this works fine in POSTMAN though).

same for all error related codes, for example 400, 500, 404, etc.. (PO system doesn't return these codes to sender unless error handling)

At present, I have handled HTTP status code 201 and all failure HTTP status codes through the error handling tab in REST receiver and sender channels using standard variables {http_result} and {message_result} variables respectively, no issue here.

my question is, is there any standard mechanism SAP has provided instead of using such custom logic which is painful during maintenance and support as well??? I am using PO 7.5 SP17.

here the requirement is, for all non-200 status codes, sender side should get same non-200 status code with exact payload form receiver side.

NOTE: I have already gone through some of the existing blogs and forums for the same discussion but none is confirming my requirement so have raised it again.

it seems this is very common requirement in almost every REST/ODATA based scenarios so SAP might have thought something on this already and released.

Thank you in advance.

Regards,

Jagesh Lakdawala



View Entire Topic
jagesh
Explorer
0 Kudos

Hi,

No I didn't, I didn't explore further from that point onwards, I ended up using the standard variables {http_result} in REST sender channel for all possible non-200 status codes.

 

Regards,

Jagesh Lakdawala

 

Gautam
Explorer
0 Kudos
Hello Jagesh, thanks for the super quick response. its unfortunate that SAP did not provide a straight forward way to achieve REST-REST synchronous scenario to pass all information from Receiver to Sender.
jagesh
Explorer
0 Kudos
We are on SP 17, I am thinking SAP might have fixed this in higher SP version. please explore.
Gautam
Explorer
0 Kudos
we are on SP27 but do not find any better solution, if we come across any graceful soln then I will post a comment here on this thread.
gpurohit
Discoverer
0 Kudos

Hello Jagesh, could you let me know the option that was selected by you in the Sender channel, did you use Text Content? or any other option like Json Expression or XPath Expression?

Which of the below option did you use to make it work?MicrosoftTeams-image (14).png