cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get output message format as JSON

Former Member
0 Kudos

Hi Experts,

I am using  SAP PO 7.4 SP10.

I am working on synchronous scenario using SAP REST Adapter. But, I am not getting the response back in JSON format.

I get response back in XML format.

Please find the configuration snap (attached ) that I have done to get response as JSON.

Need your valuable comments.

Thanks in advance.

Regards,

Ajit

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Ajit

First of all, any particular reason why you need the response in JSON format? Processing in PO is in XML, so you should be able to just use the XML response, unless you need to pass the JSON response back to the caller.

If you really need to, you can try setting the Response Format (for sync messages) to JSON in the "Data Format" tab. Refer the screenshot in the "Configuring the REST receiver channel" in the article below:-

If it still does not work, it is possible that you need to explicitly set the following HTTP header.

Accept: application/json

Since you are on the latest SP, you can use the custom HTTP header function as detailed in the following article

You might want to test setting the "Accept" HTTP header via a REST client first before making the configuration in the channel. You can use the Chrome extension below to test it out and see if the response you get is in JSON format.

Advanced REST client - Chrome Web Store

Rgds

Eng Swee

Former Member
0 Kudos

Thank You Eng Swee.

Testing through Advanced REST Client helped.

Regards,

Ajit

Answers (0)