Skip to Content
0

Adding Namespace with Prefix - XML/JSON Conversion in Receiver REST Adapter

May 31, 2017 at 11:03 AM

237

avatar image

Hi Experts,

I am in the midst of developing an IDOC to REST asynchronous scenario with POST operation.
While configuring the Receiver REST Adapter, i checked the box for converting XML to JSON. The converted JSON message looks like this


{"Price":{ "Item":{ "itemID":"******", "sales_price":{ "Country":"CL", "Value":13003, "Currency":"CLP", "salePriceEffectiveDate":20170403 } } } }

This returns a HTTP 500 Internal Server Error in the Receiver REST Adapter.

However, the following JSON message is successfully sent to the REST Receiver when using the Google Postman

{ "ns0:Price": { "@xmlns:ns0": "http://****Price***", "Item": { "itemID": "******", "sales_price": { "Country": "CL", "Value": "13003", "Currency": "CLP", "salePriceEffectiveDate": "20170403" } } }

I am on SAP PO 7.5 and I do not see any option to add a Namespace Prefix to the output message in the adapter.

Can you kindly help me out here ?

xml-to-json.jpg (58.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Vadim Klimov May 31, 2017 at 04:13 PM
0

Hi Krishna,

After the system got updated and adapter applications got new features (such as the enhanced XML/JSON conversion), please make sure that adapter metadata is also updated - otherwise, UI for channel configuration in NWDS / Integration Directory may still miss newly introduced configuration parameters in the channel. You might check SAP Note 2276231 ("New features for REST adapter in 740 SPS13 are not visible") that contains detailed explanation on how this can be achieved.

Regards,

Vadim

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

Thanks Vadim . I shall check on this and revert.

Regards,

Krish

0

Hi Vadim,

The above note is for PO 7.4. Is there a corresponding note for PO 7.5 ? I searched for the same but could not find one.

Regards,

Krish

0

Hi Krish,

The recommendation provided in that SAP Note, is release independent - so you can apply those suggestions for PO 7.5, too.

Regards,

Vadim

0

Thank you for the clarification Vadim :)

Regards,

Krish

0