cancel
Showing results for 
Search instead for 
Did you mean: 

CPI OData receiver adapter - remove XML root node before sending to adapter

smitha_gatty
Explorer
0 Kudos

hi All,

I have a requirement to send json data to an Odata service in SAP ECC system using OData adapter in SAP CPI. As Odata receiver adapter accepts only XML input, I have converted the payload from json to XML and then sending to OData. During this conversion, an XML root node is added to make the XML valid as there are multiple records.

Is there any way to remove this 'root' node addition before sending it to OData adapter?

json payload :

{"shipperRefDocuments":[ { "docId":"000000600", "shipment_id":"", "docType_code":"" }, { "docId":"", "shipment_id":"", "docType_code":"" } ],"eta":"","actualTechnicalTimestamp":"","logicalSystem":"","Shipment":"","transportationMode_code":""}

Integration Flow:

Any inputs would be much appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

PiotrRadzki
Active Participant

Hi,

yes in this case JSON to XML converter will enforce usage of root element. You can retrieve payload without root element after the conversion with simple XSLT.

BR, Piotr

smitha_gatty
Explorer

Thanks Piotr,

Its working now.

Regards,

Smitha

Answers (0)