Can anyone share some REST Examples

  
It woudl be great if somone could share any examples of REST webservices & consuming an external REST URI.

Thanks
Hi Scott

Again welcome to the OutSystems world.

I have a very simple demo prepared with a REST server and a REST client all done in OutSystems.

The examples leverage the ardoJSON and ardoHTTP components you can find in the forge and there are plenty of post about  them.

This is not as easy as pointing to a web service (yet! lookout for version 9), there is some "hand code" involved  so if you have any questions I'm sure we can point you in the right direction.

Best Regards

Rui


Hi Rui,
Can we craete a rest service using OS platform and also can we use it in version 8.

Regards
Pramod
Hi Pramod,

Absolutely, check the example above.


Cheers

Rui
Thanks a bunch, this example was invaluable and probably saved me a few days of trial and error, some of the things I see you have done I would not have initially considered needed.

I am in no way afraid of hand coding.  Can you may be give me an idea of what will need to be hand coded?
Obviously I have not really tested this out yet but on the surface it looks like the examples you gave me have no specific need for hand coding?

I only thought hand coding would be needed if I were integrating with an existing .NET or JAVA client?

Scott
Hi Scott 

You are correct. 

I didn't mean hand coding as in extension.
Mr ardo took care of that for us. 

What I  was trying to say is, it is not as automatic as referencing or creating a web service. 

Best regards

rui

Cheers thanks for the clarification. Now that I am deep into you example it is all much more clear.

Thanks again Rui!

Scott
Hi Rui,
Is there a easy way to change this REST Server example to take a POST request?

Thanks
Jeyanthi
Hi Jeyanthi,

From what I've seen, I would use the GetRequestContent function held in the HTTPRequestHandler extension and set IncludeHeaders to True. You should then be able to just grab the first word, being the request's method, and use that in your condition. 

Hope that helps. Maybe someone else has a better solution, but that's what I've been able to come up with so far.
Hi

Here is an example we created this week during next step americas.

This is on version 9 its has the service and the consumer.

Cheers
Thanks Rui,

This is looking for a "Data" component, which I don't have and can't seem to find. Any idea?
Oh right,

It the source database...

Here (https://app.box.com/s/yhn25n1oyt8bpvwq3ryi) is the complete example. It has more than REST, like mobile, so you probably wnat to download only what you need.

Cheers
Hi Rui,

The Data.oap has IPP on it, but I just looked at the service module on it's own and, while another good example of GET, doesn't look like there is any example of any other method usage included.
Jeyanthi,

I overlooked a method that simplifies this action called GetURLMethod. The "URL" initially made me skip over it. This can then easily be used in a condition to route the proper workflows for incoming requests.

Best of luck.
I've checked the example above but I could not find how to expose a WS as REST instead of SOAP, I could see how the ardoHTTP component was used to support the REST calls but I found nothing for instance under the [Logic > Web Services] folder at the Service Studio.

Is it possible with the 8.0 version of the platform to expose Webservices as REST?

Thanks,
Hi, inside the REST project I found the REST_Server module, in it found a DummyWS inside the [Logic>Web Services] but it seems really dummy since I cannot infer anything from it.

I did find inside the [Logic>References] an Action OutSystems2JSON from the [ardoJSON] extension but I did not find its usage up until the point I opened the User_List Screen where the Preparation logic returns a list of users converted to the JSON format before a final Download sort of action (this last one native to OutSystems as I see). 

Is this the recommend design pattern in order to expose REST like calls using the < 9.0 versions of the platform? By that I mean creating Web Screens that will return data (converted to JSON using the ardoJSON related actions) through the [Download] Action?

Thanks,
Nicholas Ladas wrote:
Hi Rui,

The Data.oap has IPP on it, but I just looked at the service module on it's own and, while another good example of GET, doesn't look like there is any example of any other method usage included.
 
 Sorry Nicholas, I wasnt answering the previous message, I was just adding another example...

Your answer is correct!!!

Cheers

Rui
Bruno Patini Furtado wrote:
Hi, inside the REST project I found the REST_Server module, in it found a DummyWS inside the [Logic>Web Services] but it seems really dummy since I cannot infer anything from it.
 
Hi Bruno,

That dummyWS was used to create the structures.
See http://www.outsystems.com/forums/discussion/10289/integrating-with-rest-apis/ and https://ardoric.outsystemscloud.com/RESTWebServices/ for more details.

This tool allows you to point to a rest service and creates a dummy wsdl file you can import in the platform so it creates the structures for you

This was in version 8, in Platform 9 it is built in.

Cheers

Rui