Web services have a description language known as WSDL, which is used to describe in a nutshell what the web service does and gives the client all the information required to connect and use the web service

There are two types of WSDL files, They are Abstract WSDL, Concreate WSDL.

Abstract WSDL will be created at design time where as Concrete WSDL will be created after the deployment. Concrete WSDL includes <Binding> and <Service> elements which are not present in abstract WSDL.

WSDL Elements:

  • wsdl: types
  • wsdl: message
  • wsdl: portType
  • wsdl: binding
  • wsdl: service


Types: Defines the (XML Schema) data types used by the web service. eg : Employee XML element data type is defined under types.

Messages: Defines the data elements for each operation. eg CreateEmployeeRequest , CreateEmployeeResponse.

PortType: Defines the operations (functionalities) and messages that this web service provides. Eg. Operation – createEmployee , input – CreateEmployeeRequest, Output – CreateEmployeeResponse  is defined in this section.

Binding: Defines the protocol and data format. SOAP binding of the webservice is providing here. Other bindings are ftp, jca etc..

Service: Provides the location (endpoint) where this service is available.

Sample WSDL File:





This post covers features of SOAP and REST and basic differences between them.



  • SOAP stands for Simple Object Access Protocol
  • It is an XML based web service
  • Adds a layer on top of the application protocols. HTTP is the widely used application protocol.
  • SOAP is considered heavy weight as it provides significant pre-build extensibility in the form of the WS* standards through additional layer.


  • Request includes HTTP header, SOAP Envelope (which includes SOAP Header, SOAP Body (which includes XML message))
  • As it has additional layer, it supports attaching files in the request which should be in base64 bit format.
  • It provides more security than REST.
  • REST stands for Representational State Transfer
  • REST typically supports all types of text data formats. Widely used formats are XML and JSON
  • Uses HTTP protocol only. No another layer on top of HTTP protocol.
  • REST is light weight as it leverages HTTP transport and uses all HTTP Action Verbs (POST, GET, PUT, DELETE)



  • Request includes just HTTP header and XML/JSON message.
  • It doesn’t support attachment of files in the request.
  • REST provides security like token based, but comparatively REST security is less than SOAP.

Sample SOAP Request:

A SOAP Message is encoded as an XML document, consisting of an <Envelope> element, which contains an optional <Header> element, and a mandatory <Body> element. The <Fault> element is sub element of Body is used for reporting errors.



SOAP Envelope with SOAP Header.


Sample SOAP Response:


Sample REST Request in XML:


Sample REST Response in XML:


Sample REST Request in JSON:


Testing of SOAP/REST web service Requests can be done using SOAP UI tool.

Invoking REST webservice from JQuery using an AJAX call

Below code helps you to understand how we can Invoke a REST web service on click of a button using JQuery and AJAX.

Note: In Java you can Invoke REST web service using ApacheHTTPClient library.

HTML File:

<!DOCTYPE html>
<sscript type=”text/javascript”
<sscript type=”text/javascript”>
$(document).ready(function () {
$(“#mybutton”).click(function () {

$.ajax( {
type : “GET”, url : “;, dataType : “json”, success : function (data) {
alert(“Reading Msg: ” + data.RestResponse.messages);
alert(“Reading Name: ” +;


<button type=”button” id=”mybutton”>Invoke REST WS</button>

Sample REST Services (thanks for making them available to developers for testing purpose):


Invoke a WebService with the Inserted Rows data of Excel sheet in ADF-DI:

In ADF-DI you don’t have any direct option available to get the control over all the inserted rows to invoke WS (Web Service). So you must implement it with the help of programmatic approach.

First what you need to understand is, If you want to upload 100 records of data from Excel sheet to DB, first you must set a property [InsertBeforeRowActionID : ‘CreateInsert‘] which means before reading each row of data, a new empty row object is created and the data of that row is stored into that row object cache. The same thing happens for all the rows. Once all the rows of Excel sheet are read, the cached data has to be committed to DB. So set the property [CommitBatchActionID: Commit] which inserts the cached data to DB.

The above properties must be set to upload data to DB from Excel sheet. To achieve this your page definition file must contain the bindings [tree binding, Commit, CreateInsert bindings]

To get the Handle over the Excel sheet data, you must set below proprieties.
Property [InsertBeforeRowActionID : ‘eachRowInvokeAM‘] which is being used to Invoke a custom method where current row data can be read and stored to a List. This will repeat for all the rows.
Then set the property [SuccessActionID : afterAllRowsInvokeAM] for a ribbon command ‘Update‘. This triggers the custom method ‘afterAllRowsInvokeAM’ after successful Insert/Update to DB. In this custom method, you can work with the list which has the data of all rows inserted in the Update operation. Using this data you can Invoke a Web Service.

You must write your custom methods in AMImpl class. ADF12c supports only AMImpl class methods, where as ADF11g supports AMImpl & VOImpl class methods to invoke.

Eg: Let’s take an example, where we insert a record to Departments table. And after all the rows got inserted to DB from ADF-DI Excel sheet a webservice should be invoked with the inserted data as input. For this set the below properties.

InsertBeforeRowActionID : ‘CreateInsert’
InsertBeforeRowActionID : ‘eachRowInvokeAM’
InsertRowEnabled: True
CommitBatchActionID: Commit
RibbonCommand- Update -> SelectActionSet -> ActionOptions -> SuccessActionID : afterAllRowsInvokeAM

Custom methods given above are [‘eachRowInvokeAM’, ‘afterAllRowsInvokeAM’] are mehtods created in AMImpl class .
Another class also created ‘Dept’ which is a Pojo class with the column names as variables and having parameterized constructor.
In the AMImpl class, a list is created of type ‘Dept’ pojo class. And the parameterized constructor is being invoked to insert the department type object to the list. Two custom methods are created in it [‘eachRowInvokeAM’, ‘afterAllRowsInvokeAM’] and are exposed and then added to the page definition file as method bindings. During each row insert ‘eachRowInvokeAM’ will be invoked and that row data in inserted to the List. Once the commit operation is susccessful another method ‘afterAllRowsInvokeAM’ will be invoked where the list data is read and used as input to Invoke the webservice.

The page definition file should be:


Excel properties should be:



package model;



import java.util.ArrayList;
import java.util.List;

import model.common.AppModule;

import oracle.jbo.Row;
import oracle.jbo.server.ApplicationModuleImpl;
import oracle.jbo.server.ViewLinkImpl;
import oracle.jbo.server.ViewObjectImpl;

public class AppModuleImpl extends ApplicationModuleImpl implements AppModule {

/* Custom Code */
List dept = new ArrayList();
public void eachRowInvokeAM(){
System.out.println("Entered before Upload..");
System.out.println("row count:"+getDepartmentsView1().getRowCount());
Row r = getDepartmentsView1().getCurrentRow();

int deptId = Integer.valueOf(r.getAttribute("DepartmentId").toString());
String deptName = r.getAttribute("DepartmentName").toString();
int locId = Integer.valueOf(r.getAttribute("LocationId").toString());
int mgrId = Integer.valueOf(r.getAttribute("ManagerId").toString());

//adding current row to list
dept.add(new Dept(deptId, deptName, locId, mgrId));

public void afterAllRowsInvokeAM() {
System.out.println("after Insert success..");
System.out.println("rows inserted:"+dept.size());
for(int i=0; i< dept.size(); i++){
System.out.println("Now Invoking WebService");
try {
http_client();  // Invoke Webserive method
} catch (Exception e) {

public static void http_client() throws Exception {
System.out.println("Invoke service using direct HTTP call with Basic Auth");
String payload =
"\n" +
" \n" +
" \n" +
" \n" +
" INR\n" +
" USD\n" +
" \n" +
" \n" +

httpPost("" + "?invoke=", payload);
private static String httpPost(String destUrl, String postData) throws Exception {
URL url = new URL(destUrl);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
if (conn == null) {
return null;
conn.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");

//byte[] authBytes = authStr.getBytes("UTF-8");
//String auth =;
// conn.setRequestProperty("Authorization", "Basic " + auth);

System.out.println("post data size:" + postData.length());

OutputStream out = conn.getOutputStream();
OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8");

System.out.println("connection status: " + conn.getResponseCode() +
"; connection response: " +

InputStream in = conn.getInputStream();
InputStreamReader iReader = new InputStreamReader(in);
BufferedReader bReader = new BufferedReader(iReader);

String line;
String response = "";
System.out.println("==================Service response: ================ ");
while ((line = bReader.readLine()) != null) {
response += line;

return response;

package model; public class Dept { int DepartmentId; String DepartmentName; int LocationId; int ManagerId; public Dept(int DeptId, String DeptName, int LocId, int MgrId) { //super(); this.DepartmentId = DeptId; this.DepartmentName = DeptName; this.LocationId = LocId; this.ManagerId = MgrId; } public void setDepartmentId(int DepartmentId) { this.DepartmentId = DepartmentId; } public int getDepartmentId() { return DepartmentId; } public void setDepartmentName(String DepartmentName) { this.DepartmentName = DepartmentName; } public String getDepartmentName() { return DepartmentName; } public void setLocationId(int LocationId) { this.LocationId = LocationId; } public int getLocationId() { return LocationId; } public void setManagerId(int ManagerId) { this.ManagerId = ManagerId; } public int getManagerId() { return ManagerId; } } 

Your Excel in Design Time:


Your Excel at run time:


After Click on Ribbon button ‘Upload’, all the rows inserted to DB and also a web service is invoked at back end.


Hope the post is Informative!

AM Service Interface (Expose ADF BC as web services/ service Enabled data objects SDOs)

PART – 1:
AppModule Service Interface webservice genearation [Expose ADF BC as SDOs service enabled daat objects]:
-> create ADF application with business components (EO, VO, AM)
-> write two custom methods in AppModuleImpl class and expose those methods to Client Interface.
-> double click AM -> Service Interface tab -> you can see three sections ‘service Interface for custom methods’, ‘service interface for view instances’, ‘Genearated files for Service interface’.
-> select required methods/view Instances of datamodel in respective sections. When you select a view instance, operations for that view isntance are displayed jsut beside to it and we can select what operations to enable for the view instance [oeprations as ‘update’ to edit the record of that view instance, ‘Find’ to retrieve the records from that view instance, Create, Delete, Merge, GetByKey, Process, etc..].
-> After selection, under AM a folder named ‘service interface’ will be created which contains webservice artifacts [,, AppModuleService.wsdl, AppModuleService.xsd]
-> Deployment: create deployment profile for ‘[Business Components Service Interface]’. deploy [check Model projetc is checked and under which both ‘common’, ‘middletier’ selected for integrated weblogic, and only ‘middletier’ selected for deployment on servers]
-> Test the webservices from Weblogic EM console like the same way you test SOA webservices.
Sample custom methods which you can expose in AM:
public void updateSalary(Number employeeId, Number salary){
Key key = new Key(new Object[] {employeeId});
Row row = this.getEmployeesView1().getRow(key);
row.setAttribute(“Salary”, salary);

catch(Exception ex){
// The above methods accepts EmpId, Salary as input and updates the salary for the given EmpId in DB
Note: we need Oracle web services manager to define the security policy for AppModule Webservices(according to documentation B31974-05 section 11.2.13). So need to license Oracle SOA suite cos webservices manager comes under SOA suite. So without using SOA, if you want to expose webservice from ADF business components you can not proivde security to them.
These exposed websrevices will creates new AM configuration and uses AppModule pool for DB connection when invoked.

For secured WS you can check this post – This is about ADF Mobile, but Web Service part is about secured AM Web Service
====================================================== ======================================================
====================================================== ======================================================
====================================================== ======================================================
PART – 2:
In above we have exposed the ADF Business component services as webservice (service enabled data objects/SDO).
Now we can consume those ADF BC services from SOA applicaiton or from another ADF application also.
Now we are discussing on How to consume remote ADF BC services[AM methods, VOs] which are exposed as webservice in other ADF applicaiton.

Create a new ADF applicaiton. [In this applicaiton we create Service Enable Entity Objects, whcih means EOs are created based on SDOs (service enabled objects)]
create Entity object-> when creating EO uncheck defalut datasource selection ‘DB schema object’, check ‘Service Interface’, give the WSDL URL and select the Service ViewInstance from dropdown.
Run the AM, now you can create a record, update record, delete record.
EO based on remote VO exposed though webservice (Service enabled EOs) will be similar to EO based on DB. But Joins doesn’t work for this EO when you create EO based on VO exposed as webservice.
We can declare Business Events on Service-Enabled Entity Objects, it works same as declared on normal Entity Object.
You can see the attributes but you can see the query, as this EO will get data dynamically as this is based on webservice.
So this is how you can crete a EO from a VO based on remote applicaiton which is exposed through webservice.
Deployment: Here first you need to add the ‘applnname_common.jar’ library of exposed applicaion to this consuming applicaiton.
Give the service connection information in connectons.xml. Now you can deploy and test from EM console.
Note: The operations which you select for a view isntance during exposing AM, those will only be available for applications when consuming them.
====================================================== ======================================================
====================================================== ======================================================
====================================================== ======================================================
PART – 3:
Creating Business Event and subscribing to that event in Oralce SOA.
Busieness Events allows the loose coupling. Busieness Events can be created from ADF BC or from SOA.
These Business Events can be subscribed in SOA composite using Mediator.



-> Oracle ADF Functional Patterns and Best Practices

-> Customizing and Personalizing an Application

-> Oracle Fusion Applications