332
Views
3
Comments
How to create a clientside Action that makes a rest call in mobile app?
Question

I want to create an offline(Completely ) which can not connect to our network but has some local database that has information that we use for application logic(fee/discount etc)


This being Pilot we do not want to allow the mobile app to connect to our Outsystems server.


We need to get information from a public api but I learn that we need to connect to the outsystems sever to be able to execute rest api. Has anyone know if we can implement a rest api call from client side?

2019-09-24 18-41-25
Jorge Martins
 
MVP

Hi Leo,

In order to do REST invocations on the client side you will have to use JavaScript directly.

You need to create a new XMLHttpRequest object and pass it the required info to call your REST method.

You can look up how to do this in all of the usual places, a quick search online unearthed several potentially interesting resources: w3schools, stackoverflow, some older blog.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

That said, I think it's pretty nonsensical to not want to connect to the OutSystems server, but assume everything else is up. Leo, what exactly is your usecase for this?

2019-09-24 18-41-25
Jorge Martins
 
MVP

Kilian Hekhuis wrote:

That said, I think it's pretty nonsensical to not want to connect to the OutSystems server, but assume everything else is up. Leo, what exactly is your usecase for this?

I totally agree with you, nevertheless, there are, for instance, scenarios where invoking REST services on the server side may incur in a hefty extra network latency penalty (Device->OutSystems Server->REST Server->OutSystems Server->Device), in which case direct REST calls from a device (Device->REST Server->Device) might be a better option.

@Leo, the scenario described above doesn't make much sense... if the application is "offline(Completely )" then it cannot make any REST calls. Can you better explain what is your intention?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.