Consume a Web Service in 2 minutes with the OutSystems Platform – Demo
Articles,  Blog

Consume a Web Service in 2 minutes with the OutSystems Platform – Demo

In this demo, our goal is to show you how
easy it is to consume a web service in the Agile Platform. In this case, we will just
consume a web service we know provides the weather for the next five days. Let’s see
how we do it. We can just go to the web references, add web reference, and specify the WSDL of
the web service we are consuming. It automatically obtains the definition of everything that
is defined by that WSDL, specifically it’s methods together with the required parameters
and structures. You can see we have GetFiveDayForecast and the corresponding resulting structure
down there. Well, let’s add it now. We can just add a place to specify the zip code,
which is needed for this web service. We just create a small button to call the web service,
and then we place the actual table where the results will be shown. And to do this, we
just drag the structure here and it automatically creates a screen where the results will be
shown. Now to complete the logic, we need a variable with a zip code, and we need the
actual code, which will call the web service. We just need to drag the web service we want
to use into our flow and specify what is the input zip code and immediately we can use
it. And then we tell our table that the source for the data is the output of that web service.
We need to tell the button what it needs to do and we need to say what will happen to
the zip code that we write down there. And it’s done! we just publish it to the Agile
Platform and we can see the results. We have our page. Let’s try a zip code. We’re calling
a web service now over the web. It’s updated. Let’s try a different zip code. And here it
goes: it’s updated. Well, this is how you consume a web service using the Agile Platform.

Leave a Reply

Your email address will not be published. Required fields are marked *