@GowthamalingamJ4389 Can you provide an example of your JSON response? I can probably create a sample solution for you with that. Basically, I would use the JSONUtils to work with the JSON. I would guess that the content is already XML, so you could use the static method from the MSCORLIB.dll for File.WriteAllText() to write the text to a file.
Posted: 2 years ago
Posted: 12 Feb 2021 9:19 EST
Gowthamalingam Jayavel (GowthamalingamJ4389)
@GowthamalingamJ4389 I thought you had multiple keys with embedded XML objects, but this entire sample you sent is just JSON. To convert that to XML you would use some C#. That would likely have to be something you'd write and understand as there are limitations to converting between JSON and XML (you need root elements, names cannot begin with numbers, etc...) that your code would need to account for. Here are a few examples I found that you could implement within a script.
This seems to use the Newtonsoft.json.dll to perform the parsing, however it won't work out-of-the-box with your JSON because there is no root node, so you may have to insert that into your JSON string. In this case, I don't believe what you want to do is something covered by the JSONUtils component and you'll likely need to write some C# in a script to do what you want.
Keep in-mind that you'll need to use the Newtonsoft.JSON dll that ships with Studio as it isn't the most current version, so you'll want to make sure that if you use that, you write your code against that version or you may have conflicts loading two different versions.