I am trying to consume a REST API and the response is in XML (json not available). 

How can I consume it?


consume it like text then parse it

Hi Ric,

You can try and, as J. referred, consume the REST API as text, and then try and convert it to JSON using this tool:

With the JSON, just parse it into an OutSystems Record using the built-in P10 action or the ardoJSON component.

Hope this helps.


Using the json conversion it can actually be even better than having a Text ouput.

You can have a OnAfterResponse callback and do the transformation inside, setting the modified ResponseText to the json transformation. That you you can fully use all the automation and deserialization done my the platform.

Also, before trying any of this try to do a simpler thing: Add to your rest api a header called "accept" with the value "application/json" and see if your service replies in json.

Most services do reply in both xml and json's just the default that is xml. That header usually does the trick.

João Rosado