R12.1 - Invoking Web Service from OA Framework Pages


Invoking a web service from within E-Business Suite has always been a open topic (A BPEL process's entry point itself is a web service so initiating a BPEL process is nothing but invoking the web service endpoint). There were different mechanisms used in different implementations from 11i to R12 and there are some nice articles on internet from E-Business Suite experts. Some of the methods used are

  1. Generate Axis client code and call from within OA Framework controller
  2. Use Business Event through EBS Adapter to trigger a BPEL Process on middle tier
However, invoking a web service dynamically without writing a single line of code specific to web service invocation is sure to save a lot of time and effort. We already discussed about R12.1 feature Service Invocation Framework (SIF) in one of the earlier posts on this blog Invoking Web Service from Oracle Workflow.

Synchronous or Asynchronous

SIF setup is already covered in the aforementioned blog post. A web service may be invoked using SIF either synchronously or asynchronously based on the SIF setup. The synchronous or asynchronous invocation of the web service using SIF should not be confused with the request pattern supported by the target web service being invoked.

Synchronous or Asynchronous invocation with SIF

Whether you want to invoke a web service synchronously or asynchronously using SIF in respect to your code depends on whether your "Invoke Web Service" event subscription has phase < 100 or >= 100.

If the event subscription has phase < 100, and the event is raised from Java code (for example OA Framework page controller) then the web service is invoked synchronously and the response is available immediately to the calling code. If the event subscription has phase >= 100 and the event is raised from Java code (for example OA Framework page controller) then the web service invocation is deferred to WF_JAVA_DEFERRED queue and is executed by Workflow Java Deferred Agent Listener. In order to capture the response from the web service it is required to define a callback business event and subscription.

More information on how an business event subscription is executed for different phases is explained in the blog post PLSQL vs Java Business Event System.

Synchronous or Asynchronous request pattern of target web service

If the web service itself is defined to be synchronous or asynchronous is determined based on the WSDL operation definition. This means whether the response from the web service is available immediately or at a later time after the initial request was sent to the service. Some of the prominent industry standards for asynchronous web service patterns are WS-Addressing and WS-Polling. At this point SIF does not have out-of-the-box support for invoking web services that return response asynchronously.

Invoking Web Service from OA Framework

Invoking a web service from OA Framework is nothing but raising a business event using Java API oracle.apps.fnd.wf.BusinessEvent.raise(). Only difference with web service invocation is that after the event raise API, you could call String respData = (String)event.getResponseData();.

Following sample could be used in AMImpl.java for invocation.
     // invoker business event
     String eventName = "oracle.apps.prod.xxxx.invoke.service";
     // unique key for the web service invocation
     String eventKey = "key1";
     // event data - XML payload sent to web service as input
     // String evtData = ....
     Connection conn = ((OADBTransactionImpl)getOADBTransaction()).getJdbcConnection();
     BusinessEvent event = null;
         event = new BusinessEvent(eventName, eventKey);
     catch (BusinessEventException e) {
         throw new OAException("Exception occured when invoking web service - "+e.getMessage());
     } finally {
     String respData = (String)event.getResponseData();
     return respData;

Extending SIF

Service Invocation Framework internally uses a Java subscription rule function oracle.apps.fnd.wf.bes.WebServiceInvokerSubscription
that implements interface oracle.apps.fnd.wf.bes.SubscriptionInterface. Like any Java rule function the entry point from Business Event System to the rule function is onBusinessEvent method. In order to perform Custom processing during web service invocation, you could write your own Java rule function by
implementing SubscriptionInterface and extending WebServiceInvokeSubscription class to override the required methods. The custom rule function can then be used in place of oracle.apps.fnd.wf.bes.WebServiceInvokerSubscription while consuming the web service in the Invoke Web Service subscription wizard.

public class MyWebServiceInvoker
    extends WebServiceInvokerSubscription
    implements SubscriptionInterface
Click Here view a sample sub-class that extends SIF's default processing.

Extensible Methods

  1. preInvokeService
  2. postInvokeService
  3. invokeService
  4. addWSSecurityHeader
  5. setInputParts
For more information on these extensible methods please refer to Integrated SOA Gateway Developer's Guide.

Rule function substitution

Once the Custom rule function is developed to extend SIF's processing, the class should be used at the time of "Invoke Web Service" subscription definition as follows.



Hi, Is this feature available even for Release 11i?

Posted by Ajay on June 24, 2010 at 01:57 PM IST #

Hello Ajay, No, this feature is not available in Oracle E-Business Suite 11i. This is available only from Oracle E-Business Suite 12.1.1 onwards. Thanks Vijay

Posted by vijayakumar.shanmugam on June 24, 2010 at 03:23 PM IST #

We are using Oracle apps version 12.0.6 and we have requirement where we need to invoke a bpel process from OAF form. Can you please let us know how to do this?


Posted by Himanshu on September 19, 2011 at 07:44 AM IST #


How can it be done from 11i?
And also, how can I use the same authentication I have in the EBS with SOA suite applications (like workspace etc...)?


Posted by guest on July 21, 2013 at 02:25 PM IST #

Vijay,thanks for this excellent article. At one of our customer EBS implementations, we have some Concurrents that need to extract data from EBS and send to other external systems over an integration using ESB. The idea is to have in theory, the concurrents extract the data and somehow (here need your information if SIF or others can help) generate the XML message to invoke the external webservice that has been exposed by ESB. It's kind of Concurrents generating the message and thereafter publishing it to the ESB using HTTP or MQ protocols. How can this be achieved?. Appreciate your help.

Posted by goutamd on December 17, 2014 at 09:35 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

Straight from Oracle EBS Integrated SOA Gateway and EBS Adapter Development Team.


« June 2016