Skip to Content
0

Json2XML conversion error in REST receiver communication channel in PO7.5

Dec 05 at 09:52 AM

65

avatar image

Hi,

I have a problem with conversion on REST Receiver adapter, method GET. The communication channel is not converting the json payload to html. Getting error in PI.

The interface is sycronous: SAP S4Hana (Proxy) -> SAP PO (REST) -> External System (GET method).

Here is the json returned from external system.

{“Details”:{“OrderDetails”:[{“OrderID”:”0″,”OrderNo”:”00010″ }],”CustomerID”:”00001″,”UserID”:””,”Name”:””,”PCode”:””,”Status”:”Sucess”,”Message”:”Record Inserted Successfully”}}

Here is the error message from PO system.

MP: exception caught with cause com.sap.aii.adapter.rest.ejb.parse.InvalidJSonContent: Invalid JSON message content used; Message: “JSONArray text must end with ] at character 28 of

Bellow are the images.

Channel

Error Message

Please suggest me to resolve this error.

Regards

Surender

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Sanjali Salian 6 days ago
0

Hi Surender,

Can you also share your response message type structure, looks like you are adding additional Details wrapper around the response.

Regards,

Sanjali

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sanjali,

Thanks for the help. I have resolved the issue by removing add wrapper element option from my communication channel.

Regards

Surender

0
Ariel M. Bravo Ayala Dec 05 at 11:41 AM
0

Can you confirm that the response you posted is the one returned by the external systems? It looks like it has a formating problem.


json.png (32.0 kB)
Share
10 |10000 characters needed characters left characters exceeded
Surender Durgam 6 days ago
0

Hi Bravo,

Yes, posted is the one returned by the external systems?. I have already checked for format errors and tried to convert into xml file, did not find any format errors and successfully converted into xml file.

Once again I'm uploading the payload.

{"Details":{"OrderDetails":[{"OrderID":"0","OrderNo":"0001" }],"CustomerID":"0001","UserID":"","Name":"","PCode":"","Status":"Sucess","Message":"Record Inserted Successfully"}}

Regards,

Surender

Show 1 Share
10 |10000 characters needed characters left characters exceeded

other json to xml conversion tool converts it to xml without any issue. not sure why this is happening.

can you try this blog by formatting Ordertails as arraytype.

https://blogs.sap.com/2016/01/13/rest-adapter-in-sap-pipo-enhanced-xmljson-conversion/

0