AM using a javascript to make two concurrent calls and once i get the response am merging them and all is done in javascript, I've written another one javascript after this, and am setting request.content to that variable containing JSON. Now i want to convert it to XML, but that's not happening. Could you please help?
Hi @Aiyappa M B, it is hard to tell without seeing the code or flows. If possible please upload a sample proxy or some code/image to understand the flow.
Btw if you are trying to convert final response from JSON to XML then you need to use the JSON to XML policy on the response flow after the second Javascript policy?
Did you check the Trace tab for any issue?
Where are you using the JS policies in the flow?
I agree with Siddharth... It's impossible to know what's going wrong with the details you're providing.
Now i want to convert it to XML, but that's not happening.
Yes, I'd suggest that you BREAK DOWN the problem.
We know that the JSONToXML policy is very broadly used. We know it works. OK, so the policy is known to be good.
In which cases does JSONToXML NOT convert JSON to XML? In my experience, these are the most common cases.
The first issue is easy. If you are creating a string in JavaScript, JSON.stringify() will give you a legal JSON payload. But the latter two issues are more surprising, and are often overlooked.
It may be a little disappointing that we need to assign a Message, just to act as a carrier or container for a string that we'd like to convert from JSON to XML. I understand that.
But for now, that's how it works.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |