Exposing REST services with XML

By Remco Dekkinga on 26 Aug 2015
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.
It would be better if the REST services accept both JSON and XML.

This idea is similar to the following idea, except this one is about Exposing instead of Consuming REST services 

Kilian Hekhuis27 Aug 2015
Hi Remco,

Are you sure you don't have your definitions of exposing and consuming the wrong way around? Exposing XML by rest = OutSystems application allows other systems to retrieve via REST some XML, consuming XML by rest = some other system allows OutSystems applications to access it via REST and retrieve some XML.

If you have an IoT device that expostes a REST service which provides XML, you are (well, your OutSystems app is) consuming the device's REST and XML. So it seems idea 1751 referenced by you above is exactly what you need!
Remco Dekkinga28 Aug 2015
Hi Kilian, The IoT device can only do a POST to an URL with the XML attached.  
In order to receive the POST, I set up an Exposing REST webservice which is then called by the IoT device using the POST message.

I have this working for incoming JSON messages.

What I will do, I will follow up on the suggestion of Joost and try to use the HttpRequestHandler to get it also working for XML.

Kilian Hekhuis28 Aug 2015
Right, I see your usecase now. I thought you were trying to call a method on the device, but the device is actually sending you an XML.