on 07-02-2019 9:37 PM
Hello Experts,
Currently I'm working on a Sender File to REST Receiver scenario, where I read a text file to do the content conversion and then convert the XML message to JSON to be sent in a POST method.
From the receiver side it is expected to receive a payload body like this:
After the conversion and mapping I'm getting this JSON:
As you can see the JSON top level is not built with square brackets and the array has to begin with a name, I can't leave it empty, this leads me to get an error from the API side response cause it has a wrong format.
My Message type is defined as this:
The XML is always generated with an additional tag that has the name of the recordset structure defined in the FCC
I checked the following Receiver REST adapter options and added the XML/JSON conversion options, but I still didin't get the JSON as needed.
Is there any way to make the top level brackets to be of an array type and to remove the tag "Alarma" that is generated in the XML from the File Adapter recordset structure.
I appreciate your comments and help with this question and hope I make myself clear.
Thanks.
Danilo Amaya
Hi Danilo ,
Thanks,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Danilo,
The the sender JSON is valid depicting the equivalent XML without a Root Node is not possible.
it will look like
<root>
<refid>abc</refid>
</root>
Thus in your target side when you root element as Alarm it gets retained, dont see any workaround here.
1. Try unchecking the parameter Convert XML Name To JSon Name, & see the result.
2. Also try
Regards,
Vikas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.