Create REST Web Service with Application Module declaratively in ADF 12.2.1

Sharing is Caring

REST stands for Representational State Transfer, REST is an architectural style not a protocol as SOAP that’s why it can use any other protocol like SOAP, HTTP etc.
REST requires less bandwidth and resources (lighter) than SOAP

New ADF 12.2.1 supports creating RESTful web services directly from Application Module, In previous versions, we have to do everything manually
See- Create RESTful services on top of ADF Business Components


But in the new release, Oracle mentioned this –

ADF Business Components now offers the ability for users to declaratively expose their data model as RESTful web services. Users can decide on the set of attributes to expose from backing view object instances, the actions to make available, and the view link relationships to preserve for the resulting resource.

    • Created a Fusion Web Application using Departments table of HR Schema
    • Open Application Module and click on Web Service tab, there is a separate tab for REST, Click on the green plus icon- It shows an error dialog that asks to define a version

 

    • We have to define the release version and name in adf-config.xml to create REST Web Service

 

    • Again go back to Application Module and click on the green plus icon of REST tab, a dialog appears to create REST Resource – Provide resource name and select release version

 

    • On click of OK and IDE generates a separate project for REST Web Service and a REST Resource file under the Application Module to configure custom methods, view objects and attributes etc.

      REST Resource file –

    • Now to run and check web service, Right click on RESTWebService project and choose Run

 

    • On running you’ll see an URL in WebLogic log tab, click on that URL, it will open HTTP Analyzer tool

 

    • Now to access REST Resource we have to add version name and Resource Name in above URL like this- http://127.0.0.1:7101/RestWebServApp-RESTWebService-context-root/rest/Jdev12.2.1/Department , select GET in method and  click on Send Request button and you can check response in right panel
      Create REST Web Service
    • We can also pass Department Id as the parameter in URL to get specific department detail

All Done 🙂

Sample ADF Application – Download

Cheers 🙂 Happy Learning

Related Posts

An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF

8 thoughts on “Create REST Web Service with Application Module declaratively in ADF 12.2.1”

  1. Thanks you very much sir, keep posting these kind of blogs ,eagerly waiting for your blog on How to make data control using Java beans , need to know the logic behind making this..!!
    Thanks for Sharing..!!

  2. Hello Mr.Asish Thanks for telling us to create restful web service with AM Module but I need to ask that how am i consume it with another adf application by provided URL of this rest web service.Please guide me asap.

      1. Thanks For Reply Mr. Ashish but when i create a restful connection based on selected IDE connection,My connection is not showing the view its just showing only rest connection name.
        when i drag and drop restfull connection on my DC(Data Control) and create DC name then I write my URL of restfull service and check it successfully but on click ‘Next’ it showing invalid URL.
        Please suggest me I am new in web services.

Leave a Reply

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