ADF : Tutorial - Find weather using ADF and SOA

A webservice is exactly what its name says, it is just a service.
It will provide you with a service like for eg: taking a city name as an input and providing you with the corresponding weather details as an output.

You don't have to worry about the underlying implementation of the SOA webservice.
But you do have to worry about what to do with the output of the webservice.
You need to provide a UI for the end user to enter the input parameters and to display the output of the service invocation.

You can use various technologies/frameworks to build a UI on top of a SOA webservice.
ADF is one of them.
Lets see how to build an ADF UI on top of a publicly available webservice.

We will use the Global Weather public webservice.
WSDL : http://www.webservicex.net/globalweather.asmx?WSDL

Prerequisites
1) Create a ViewController ADF project.
2) Select the ViewController project in JDeveloper and create a webservice datacontrol for the Global Weather webservice.


Steps to build the ADF UI.

1) Right-Click the ViewController project and select New.
    In the New Gallery select Web Tier --> JSF and select JSF Page on the right and click OK.



2) In the Create JSF Page dialog enter the following details.
     File Name : weather.jspx
     Select 'Create as XML Document'
     Select 'Blank Page' for Initial Page Layout.
     Click OK.



3)A new jspx page i.e weather.jspx is created.
   Now open the Data Controls pane and drag the GetWeather method on to the jspx page.
   In the Create popup select ADF Parameter Form


     3.1)Don't change any Form Fields. Click OK.



4) Now drag the String output of the GetWeather method in a similar way on to the jsff page.
    In the Create popup select Text --> ADF Output Formatted w/ Label



5) You can repeat the steps 3 and 4 for the method GetCitiesByCountry


6) Right-click on weather.jspx and select Run



7) Now you can invoke the two methods provided by the weather service.
     You can find the cities in a country by entering the Country Name.
     You can find the weather in a city by entering the City Name and Country Name.



Below is the video tutorial for creating the above mentioned ADF application.



Sample Application can be downloaded here.

1 comments:

Learned a lot of new things from your post!
It's amazing blog
Oracle SOA Online Training

Reply

Post a Comment