REST Sender adapter JSON Array for Request message

Dear All,

Does REST sender adapter can convert below JSON format where the "Driver" is an array.

JSON message as input to adapter:

{
"Driver": [{
"id": "A1",
"FirstName": "John",
"LastName": "Luis"
}, {
"id": "A2",
"FirstName": "Stefan",
"LastName": "Burd"
}
]
}

Expected XML message after conversion:

<?xml version="1.0" encoding="UTF-8"?>

xxxx.om:SAP_DriverMaster">
<Driver>
<FirstName>John</FirstName>
<LastName>Luis</LastName>
<id>A1</id>
</Driver>
<Driver>
<FirstName>Stefan</FirstName>
<LastName>Burd</LastName>
<id>A2</id>
</Driver>
</ns1:MT_Driver_C_Req>

I'm using "Add Wrapper Element" to add message type name (MT_Driver_C_Req) in the result XML. But I couldn't fixn any option to get the Driver array from Json in adpater. There is an option to have conversion rule but it seems that applies to response side of it.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Apr 13, 2017 at 08:07 AM

    Hi Abdulgaffar

    Have a look in below blog.

    https://blogs.sap.com/2014/12/18/pi-rest-adapter-blog-overview/

    Regards,

    Roshan

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content