Consuming REST services with XML

On our radar
The new platform version already brings the new functionality which allows us consuming Web services using REST. However the only document format allowed is JSON. We know that there are some webservices whose document format is XML. It would be cool if we could use XML in the RESTful webservices.
Created on 16 Oct 2014
Comments (6)
17 Oct 2014
REST+XML is imho the worst combination of the flavours...

Not sure if I agree it should be supported
26 Aug 2015
I would like to add that not consuming, but exposing REST services with XML is a missing feature.

It is possible to change the format of whatever you are sending in the platform, but you are limited when receiving data from external parties.

For instance: We are trying to read the contents of a device (IoT), but the device is limited in functionality and only sends out data using POST+XML.

As stated in the manual of Outsystems, the record and list data types can only be filled by JSON.

We now have to create an external application where the device is sending it's data and then convert the XML to JSON before we can read it into Outsystems using the REST service.
26 Aug 2015
@Remco I am not sure what your issue is and why you need to fall back to an external application.

You can still read a raw request in a page (with httpRequesthandler extension)
so you can do stuff there.

It's basically the old way of exposiing/consuming REST-webservices :)

27 Aug 2015
@Remco: Apart from what Joost said, I think you are confusing the meanngs of consuming and exposing. This idea seems to be about exactly your type of scenario.
28 Aug 2015
@Joost, thank you for your suggestion, I'll try to get this working today. I'll let you know if it works.
@Kilian, I gave you an reaction in the other discussion
22 Jun (22 hours ago)

I needed to support a similar XML Post for a project I was working on, I had asked J. to detail the whole flow, he shared this:

Use the httpRequesthandler extension to handle the incoming request, in the preparation on a new webpage.

When done parsing the xml, your flow will end up not with a end-node, but a download-node. In the download you place the xml (as binary) and you are good to go.

So, in the preparation:

1. parse the incoming xml

2. build response-xml

3. texttobinary(response-xml)

4. download binary as tetx/xml, save to disk: 'no' 

I am adding it here for others to discover if they need this helpful workaround.

Thanks, J.!