cancel
Showing results for 
Search instead for 
Did you mean: 

REST Sender adapter JSON Array for Request message

gaffaransari
Participant
0 Kudos

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"?>

<ns1:MT_Driver_C_Req xmlns:ns1="urn: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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
gaffaransari
Participant
0 Kudos

Hi Roshan,

Thank you for the reply. I already referred this blog but I couldn't make out the conversion trick for above scenario.

Answers (0)