Create SOAP Web Service with Application Module quickly in ADF 12.2.1

Sharing is Caring

SOAP stands for Simple Object Access Protocol, a protocol to exchange information in XML format between two applications over HTTP. This protocol is used to create ,access and consume web services.

SOA (Service Oriented Architecture) focuses on re-usability and exposing application module as web service makes it’s methods and objects accessible from any device , any platform and these methods and objects can be further used by any other application

In ADF 12.2.1 we can create a SOAP web service within seconds , See how to configure Application Module to expose it’s methods and objects to service interface

    • Created a Fusion Web Application using Departments and Employees table of HR Schema

 

 

    • Open Application Module and Web Service tab, there is a separate tab for SOAP , click on green plus icon

 

 

 

    • In Step 2 we can expose some built in methods and in Step 3 if we have any custom methods defined in Application Module then we can expose these methods to service interface.
      Here i have created a simple method in AMImpl to get department name from it’s id and exposed this method in service

    /**Method to get Department Name from Department Id
     * @param deptId
     * @return
     */
    public String getDeptName(Integer deptId) {
        String deptName = "Department not found";
        ViewObject deptVo = this.getDepartments1();
        Row[] filteredRows = deptVo.getFilteredRows("DepartmentId", deptId);
        if (filteredRows.length > 0) {
            deptName = filteredRows[0].getAttribute("DepartmentName").toString();
        }
        return deptName;
    }

 

    • In Step 4 select viewObject that we want to expose and their methods , i have selected both Departments and Employees viewObject and enabled operation for both
      For Departments ViewObject –

 

For Employee ViewObject-

 

    • Click on Finish to create service interface and all required files

 

 

    • Now to run and check web service , Expand Application Module root and there is a  service implementation java class SoapWebServServiceImpl.java  , Right click on this and choose Run

 

 

    • On running you’ll see an URL in weblogic log tab, click on that url it will open HTTP Analyzer tool and there you’ll see list of all operation , here i have selected GetByKey operation of Departments viewObject

 

Here i passed depatmentId as key parameter and you can see web service response

    • Again i selected create operation for Departments viewObject and provided all parameters and click Send Request button

 

and result in database table

 

    • This time i am checking custom method defined in application module to get Department Name

 

 

All Done 🙂 Sample ADF Application-Download

Cheers 🙂 Happy Learning

Related Posts

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

6 thoughts on “Create SOAP Web Service with Application Module quickly in ADF 12.2.1”

  1. Hi Ashish,
    I have created ADF application where UI has browse file option and upload button. Once we browse file (our case its always pdf file only) and click on upload, control goes to java class method where we need to pass this browse file to REST service, which will further move this file to some other location.

    Can you please help here how to achieve this, Any reference or code sample will be helpful.

Leave a Reply

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