cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hallo All,

We are working on REST to REST synchronous scenario. The output (xml) from mapping looks fine, but when it is transformed to JSON through REST receiver channel.

We tried using the custom XML/JSON conversion for the field "Text" in the REST receiver adapter and it is not working as expected. please check the below for more details about the requirement.

output after mapping

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

<ns0:UIT_MT_IT_REQUEST xmlns:ns0="urn:test/po/MT-it">

<root>

<query_table>BSEC</query_table>

<DELIMITER>~</DELIMITER>

<ROWCOUNT>5</ROWCOUNT>

<ROWSKIPS>0</ROWSKIPS>

<options>

<Text>'0300'</Text>

</options>

<options>

<Text>'2022%'</Text>

</options>

<options>

<Text>IN ('320000000',</Text>

<Text>'320000002',</Text>

<Text>'320000003',</Text>

<Text>'320000004')</Text>

</options>

<root>

Output from REST Receiver adapter

{
		"query_table": "BSEC",
		"DELIMITER": "~",
		"ROWCOUNT": 5,
		"ROWSKIPS": 0,
		"options": [
			{
				"Text": "'0300'"
			},
			{
				"Text": "'2022%'"
			},
			{
				"Text": [
					"IN ('320000000',",
					"'320000002',",
					"'320000003',",
					"'320000004')"
				]
			}
		],
}

Expected output

{
	"query_table": "BSEC",
	"DELIMITER": "~",
	"ROWCOUNT": 5,
	"ROWSKIPS": 0,
	"options": [
		{
			"Text": "'0300' "
		},
		{
			"Text": "'2022%' "
		},
		{
			"Text": "IN ('320000000',"
		},
		{
			"Text": "'320000002', "
		},
		{
			"Text": "'320000003', "
		},
		{
			"Text": "'320000004', "
		}
	]
}

Rest Receiver channel configuration

Appreciate your valuable inputs and suggestions to get the expected output from the REST receiver channel.

Thanks in advance.

Best Regards

Bhargava Krishna Talasila

0 Likes
View Entire Topic
0 Likes

Hi!

Why not to just delete "root" element from target structure?

Regards, Evgeniy.

Bhargavakrishna
Active Contributor
0 Likes

Hi Evgeniy,

Sorry that was a typo error when copying the payload.

i'm deleting this using module paramter "setIgnoredElements" in the channel.

Regards

Bhargava Krishna Talasila