on 01-09-2018 5:47 AM
1) . We have a REST to REST Scenario, when the response is empty like below.
{ "main":
{ "row": [] }
}
2). The XML conversion is taking out 'row' tag and formed as below:
<Wrapper>
<main></main>
</Wrapper>
3). I have tried to add the 'row' tag in the message mapping and converting again the XML to JSON in the sender channel but the converted JSON Output is as follows
{ "main":
{ "row": [""] }
}
How to get rid of the extra "" (double quotes) with in the [ ] -->{ "row": [""] }
Same issue was mentioned in the below thread, however there is no solution at the end.
https://archive.sap.com/discussions/thread/3894034
Please see if you can help in any way ?
Hello,
Just for reference was able to solve this issue after following this SAP Note :
2505988 - Remove leading empty element in JSON Array after XML to JSON conversion
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
was this issue resolved ??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the conversion rules of the channel for Rest, you can define arrayType = true for the field 'row'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have already defined the same in the channel and that's why I got the [ ] for 'row' , However, the issue is in case of empty result and the conversion from XML to JSON where I am getting extra " " .
1) When XML is as below :
<Wrapper>
<main></main>
<result></result> ----> I have added this tag in the message mapping.
</Wrapper>
2) JSON conversion is as below :
{ "main":
{ "row": [""] } ---> how to get the double quotes removed with in the Square brackets ??
}
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.