Friday 26 October 2018

Consume REST Web Service

Consuming RESTful Web Service from ADF 12.2.1.1.0

Hi Guys, Today I'll share an example of RESTful web service, where i'll show you how to consume RESTful Web Service from ADF.

Before Starting you guys can read my previous post regarding RESTful Restful Web Services and ADF BC and how to expose RESTful web services EXPOSING REST IN ADF

I will use a service, exposed from the Groupkt country api. The service can be invoked by an HTTP request, and responds with JSON.

url to invoke the service - http://services.groupkt.com/country/get/all
 the above service will give all the country list.
Below are the step to create project-

S1- Create a simple Web ADF Application.


S2- Right Click on Created project New --> from gallery --> Web Services  -->Web Service Data Control (SOAP/REST) and click on ok.
S3- Provide the name and url and click on ok.


S4- click on Test Connection and then ok.


S5-  select the format as json and method GET, provide the name as get then click on next.
        With the green plus we can create a new resoruce path, which we assign to the the last part of our base URI, that we have left out in the previous step: “/json”. For the data format, we choose JSON and select the “GET” method and give it a name: “get” for example. Then we click next to go to step 4 of the wizard.


S6- Here we see the method that we have just created “get”. After we click on it, we can choose either a schema file or a sample. Since we have no schema file available, we choose “Parse from Sample Code” and paste the response we got earlier into the box. Further on, we add the address URL parameter.
Now we click “Next” and this will bring us to the last screen of the wizard.


S7- Click on test REST Connection  where we can test the data control, and this should give us the “Connection Successful” message, like below.



S8- Now our data control is ready to use. Let us see how it looks like: 

S9- Now create CountryList.jspx page , drag and drop panel streachlayout.
      then in top drag and drop countries as a input text and in center drag and drop the response as ADF table.

 Now run the page .


Cheers Guys :)



No comments:

Eclipse With Python

Hi Guys, Today i'll share how to start python project in eclipse IDE. to start Py development in eclipse we need to add Py Dev plugi...