cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Json to XML

Former Member
0 Kudos

Hello experts,

I have an issue in converting the json to xml using the PI Sender Rest adapter.

The format in which we are getting the Json data is  :

{"flowExtensionId":"deloitte_po_flow_ext","events":[{"eventId":20000000000000000000000260,"created":"2016-03-01T17:18:18-0800"}]}

However the format in which PI Sender Channel converts the Json Data to xml is as below :

<?xml version="1.0"?>

-<ns1:EventsQueryResult xmlns:ns1="urn:Ariba.com:poc:RestProtocol">

<flowExtensionId>deloitte_po_flow_ext</flowExtensionId>

-<events>

<eventId>2.0E25</eventId>

<created>2016-03-01T17:18:18-0800</created>

</ns1:EventsQueryResult>

Please advise.

Accepted Solutions (0)

Answers (1)

Answers (1)

engswee
Active Contributor

Hi Deepika

That is the default behavior of the Jettison library used to perform JSON conversion in the REST adapter. For more details, read Vadim's blog below for an in-depth explanation of it.

The blog also covers the functionality on how to enhance the default conversion, i.e. for your case, configuring the particular field to be converted as a String instead of decimal. You'd need to ensure that you have the correct SP level for your system to have that functionality.

Regards

Eng Swee