Skip to Content

How to handle a JSON Response in REST to REST scenarios

Hello Experts,

I create a REST to REST scenario in SAP PO 7.5 SP12, I'm consuming a REST API that gives me a JSON response like this:

The interface has to send as a response this JSON in the same format to a Non-SAP system

The sender and the receiver channels has been setup as this:

As a result I'm getting an error in the Mapping processing cause i'm using a message mapping and I guess it only allows XML content

In the log I can see the response in JSON format but is giving an error when it tries to do the mapping.

I guess I'm doing something wrong in the message mapping, so what is the correct way to define the message mapping for this kind of scenario?

I appreciate your help.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 25, 2018 at 09:01 AM

    PI mapping expects data in XML format but you are not converting the response from JSON to XML hence that error , convert that JSON to XML perform mapping and then convert back that XML to JSON to send back to sender in response.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 25, 2018 at 04:26 PM

    Manoj,

    Issue has been solved with your help, I checked the "convert to XML" option and then fix the message mapping for a XML as usual

    Thanks for your help.

    Regrads.


    Add comment
    10|10000 characters needed characters exceeded