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
Request clarification before answering.
Hi!
Why not to just delete "root" element from target structure?
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.