Expose Application Module as SOAP Web Service

Tweet about this on TwitterShare on Facebook0Share on LinkedIn3Share on Google+0

As you know, the Service-Oriented Architecture (SOA) promotes reuse, and sometimes you need to expose some methods inside your ADF application as web services. This way, these web services can be consumed inside a BPEL Composite or OSB Proxy Service. Using the ADF Developer’s Guide documentation (15 Creating SOAP Web Services with Application Modules), let’s expose the Application Module as a SOAP Web Service.

Download the sample application: ADFAppModuleServiceApp.zip.

Configuring the Application Module

In your Model Project, double-click the Application Module.
In the overview editor, click the Web Service navigation tab and then click the Enable support for Service Interface (green plus icon).

expose-application-module-as-soap-web-service1

The Create Service Interface wizard is showed.
In Step 1, you can change the name and target namespace for the web service. The Generate Asynchronous Web Service Methods option exposes the methods of the application module as asynchronous service methods, enabling both synchronous and asynchronous operations on the web service.
Click Next.

expose-application-module-as-soap-web-service2

In Step 2, you can select some built-in methods to expose.
Click Next.

expose-application-module-as-soap-web-service3

In Step 3, if you have created a custom method on Application Module and want to expose it, select it here.
Click Next.

expose-application-module-as-soap-web-service4

In Step 4, move the EmployeesView1 for the selected box.
Enable the Create and GetByKey operations and change the names of methods to createEmployees and getEmployeeById.
Click Next.

expose-application-module-as-soap-web-service5

Click Finish to create the service interface.

expose-application-module-as-soap-web-service6

JDeveloper generated class service interface.

expose-application-module-as-soap-web-service7

To run using Integrated WebLogic Server

In your Model Project, expand the Application Module, expand the serviceinterface node, and then select the service implementation class (AppModuleServiceImpl.java) file. Right-click the service implementation class file, and choose Run.

expose-application-module-as-soap-web-service8

To deploy to Oracle WebLogic Server

Double-click the Model Project to open Project Properties wizard, select the Deployment node and click New Profile icon.
In the Create Deployment Profile wizard, choose Business Components Service Interface as the archive type, change Deployment Profile Name to AppModuleServices, and click OK twice.

expose-application-module-as-soap-web-service9

In the main menu, choose Application > Deploy > Model_AppModuleServices to open the Deploy Model_AppModuleServices wizard.
On the Deployment Action page, select Deploy to Application Server and click Next.
On the Select Server page, select the application server connection and click Finish.

Testing the Web Service application

In the main menu, choose Tools > HTTP Analyzer.
In HTTP Analyzer window, click Create New SOAP Request (paper icon).

expose-application-module-as-soap-web-service11

Go to WebLogic Server Log window and copy the target URL.

expose-application-module-as-soap-web-service12

Click Select WSDL button, paste the target URL adding ?WSDL at the end and click OK.

http://<HOST>:<PORT>/ADFAppModuleServiceApp-Model-context-root/AppModuleService?WSDL

expose-application-module-as-soap-web-service13

In Operations, choose createEmployees, provide values for input arguments and click Send Request button to create an employee.

expose-application-module-as-soap-web-service14

Now, choose getEmployeeById, provide value for input argument and click Send Request button to get the employee by ID.

expose-application-module-as-soap-web-service15

This is the result on database.

expose-application-module-as-soap-web-service16

Tweet about this on TwitterShare on Facebook0Share on LinkedIn3Share on Google+0

Author: Waslley Souza

Consultor Oracle com foco em tecnologias Oracle Fusion Middleware e SOA. Certificado Oracle WebCenter Portal, Oracle ADF e Java.

Leave a Reply

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