cancel
Showing results for 
Search instead for 
Did you mean: 

How to Capture dynamic value of custom HTTP header from Receiver responses

joel_langoyan
Participant
0 Kudos

Hi Experts,

Is it possible to get the value of http header and capture it as part of message processing log? Receiver system has this custom header that would contain a value like a message id of sort on their side. As mentioned, I need to capture the value as it is their reference especially when there are issues calling their APIs.

I am checking on the Error Handling tab of REST receiver adapter but I am not sure how to setup or would this require some custom code? Please advice.

Accepted Solutions (0)

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Joel,

You customize the response from REST WS if an error response is received.

You can also see custom message for specific unexpected header values but not the header values itself.

This is elaborately explained in this beautiful blog by alexander.bundschuh.

In case you face error you need to use postman to troubleshoot the issue.

Regards

Anupam

joel_langoyan
Participant

Hi Anupam,

I have actually check Alex's first hand for my issue. However, as you mentioned as well the Error handling tab checks the header itself not the value. The value is what I need the most be exposed. It looks to me that there is no way around this for failed calls but do trace xpi_inspector.

Bhargavakrishna
Active Contributor
0 Kudos

Hi Joel,

Refer the below post.

https://answers.sap.com/questions/298237/rest-receiver-add-custom-http-header.html

Regards

Bhargava Krishna Talasila

joel_langoyan
Participant
0 Kudos

hi bhargavakrishna.talasila,

Thanks for your input. However, my scenario is different. What I need to capture is the HTTP header values that are sent back by target system regardless of HTTP status codes. Right now I can only see this HTTP headers when successful but when failed like error 400 I cannot see them. I mean is similar way when testing in Postman we can see all response headers.

Highly appreciate further inputs into this I really to get that message id the target system sends back most especially for troubleshooting.