cancel
Showing results for 
Search instead for 
Did you mean: 

Removing Root node from JSON Sender Adapter

0 Kudos

Hello Experts,

I am facing the above issue while trying to send the data from postman. The issue is when we are sending the data with multiple JSON records, Sender Rest communication channel is forming XML with Root Tag. But My requirement is without root tag.

I would request you to kindly help on how to remove ROOT tag from the XML in the sender Rest channel to proceed further.

Thanks in advance for your help

Regards,

Prashanth Bharadwaj

Accepted Solutions (0)

Answers (5)

Answers (5)

vicky20691
Active Contributor

Hi,

When you have multiple records the root must come as the parent node has to be
unbounded which is root node.

It can be Record, Root or any custom name. I am sure in your data type you should have defined something like

<MT>

<root>

---

---

--

Regards,

Vikas

0 Kudos

Hi Apu,

Thanks for the reply. I tried the same. But unfortunately, When single record comes the root tag is not coming.

Kindly help

Thanks,

Regards,

Prashanth Bharadwaj

apu_das2
Active Contributor
0 Kudos

Hi Rajesh,

Let is come like this and change the sender DT accordingly to match this.

In th MM you can remove extra nodes and create your target structure as per requirement.

Thanks,

Apu

0 Kudos

Hello Rajesh,

Thank you for the reply. My issue is during the request itself root tag is getting added on top of the parent node before it goes to mapping.i have added wrapper elements too. its the same issue.

Kindly help.

Regards,

Prashanth Bharadwaj

former_member607993
Contributor
0 Kudos

Hi Prasanth,

In sender REST communication channel, under General Tab in the Output Message Format.

If the expected data format is JSON, you can choose to Convert XML Payload to JSON. If messages contain a wrapper, you can choose to remove it by activating Strip Outer Element.

<root> will be ignored.

former_member607993
Contributor
0 Kudos

Hi Prasanth,

It will work. Below is the structure you had mentioned:

<MessageType> <root> <Recordset>....</Recorset></root></MessageType>

In REST receiver communication channel Under Data Format, You need to select both the 'Strip Operation from Message' and 'Strip outer element'.

This will solve your problem though if its a single Record or multiple Record.

You can also set 'Record' to generate in a array.