on 04-16-2015 3:40 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.