Skip to Content
0

proxy to rest synchronous scenario

Nov 16, 2017 at 12:55 PM

108

avatar image
Former Member

Hi,

The json which is sending by sap pi to rest receiver is as shown below

{"Details":{"Details":[{"Id":"String 1","Name":"String 2"},{"Id":"String 3","Name":"String 4"}]}}

The details which is expected by Rest url is

{"Details":[{"Id":"String 1","Name":"String 2"},{"Id":"String 3","Name":"String 4"}]}

The above bold details is adding

and causing 500 internal error issue.

Thanks.

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

2 Answers

Best Answer
Sanjali Salian Nov 16, 2017 at 05:09 PM
0

Have you tried the option to Strip Operation from Message in your REST receiver ?

Regards

Sanjali


restreceiver.png (40.0 kB)
Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Sanjali Salian,

i have one query when sending single details it is failing

{"Details":[{"Id":"123","Name":456}]}

but sap pi sending as

{"Details":{"Id":"123","Name":456}}

The square brackets are missing how to handle in rest receiver adapter configuration.

0

In your scenario, are you converting the payload (XML->JSON)?

0
Former Member

yes sanjali

0

Have you seen the note 2175218 this issue was resolved from 7.31 SP17 / 7.4 SP13.

0
Former Member

Hi,

i am unable to sort the issue with the above note.please share the rest receiver configuration screenshots.

Thanks.

0
Sanjali Salian Nov 21, 2017 at 03:14 PM
0

Hi,

To resolve the XML/JSON conversion issue you could use the "Custom XML/JSON Conversion Rules" in your receiver adapter, explained well in detail in the following blog,

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

Note the ArrayType set as true for Property name tag, similarly set conversion rule for detail element to be ArrayType.

Regards,

Sanjali

Share
10 |10000 characters needed characters left characters exceeded