How to convert XML response of Remote web service to JSON


#1

The 2.1 version of DF already shows the response inside the api Docs in json format.
But how to achieve to get back json when calling the DF Rest api?
How to call the converter inside a script to get back a json response?


#2

@mimu a lot of this depends on the web service itself and in what format the data is available. Some public APIs ( example: http://catalog.data.gov/dataset ) will only serve JSON or only serve XML. DreamFactory itself doesn’t have a conversion feature per se but as you had mentioned some custom scripting would likely be able to help you achieve this. For example this blog post may provide some ideas on how to do this.


#3

From the 2.1 release notes:
XML to JSON content conversion now handles namespaces (i.e. singular namespaces are used to pull data into JSON format).

How to use or access the converter?

Is an extra parameter necessary when accessing the DF service or
how to call the converter inside a script?

Any hints welcome