First create one synchronous BPEL process for this purpose which we want to call from an ADF application. We are creating this BPEL process for demonstration purpose. Later we’ll call this
BPEL process from ADF application.
BPEL process from ADF application.
Here our process is very simple one -> one can input his name and phone no. here and this will concat and return the name and phone no. in a string.
The diagram of this BPEL process is like this ->
The input schema of this BPEL process is following ->
And then in an assignment function we have concated the input name and phone no. Our output is the following one ->
In the following article we’ll describe how to invoke this BPELProcess, pass the two parameters to this process and how to show the results in one ADF faces component on a JSF page.
Creating the webservice data control for calling the BPEL process
Web services is the term for a technology that consists of a set of messaging protocols and programming standards that expose business functions over the Internet using open XML-based standards. An individual web service is a discrete reusable software component that is accessed programmatically over the Internet, using HTTP/HTTPS but you can also invoke them using other protocols, such as JMS or SMTP, to return a response.
Web services are modular business services that can be easily integrated and reused, and it is this that makes them ideally suited as components within service-oriented architecture (SOA). OracleAS SOA helps you to create top-down and bottom-up web services or to create web services from existing functionality. You can do this using JDeveloper, alternatively you use Ant or integrate the Oracle SOA Suite with another tool.
JDeveloper provides wizards and other tools to develop web services that are J2EE 1.4-compliant, with the ability to create JAX-RPC clients and services. In addition JDeveloper automatically generates web service metadata tag annotations into implementation classes (for compliance with JSR-181). There is support for defining ->
- custom handlers
- serializers and deserializers
- MIME/DIME attachments
- WS-Security, security settings including SAML for developing SSO web service applications
- WS-Reliability to set quality of service
- WS-Management to set logging properties
- WSIF bindings that allow the publishing of Java, EJB, Java Message Service (JMS), and enterprise applications connected via Java Connector Architecture (JCA) adapters
- REST (Representational State Transfer)-based service
Here is a way of creating web service data control from an existing WSDL [ In our case the BPEL process WSDL file ].
First, In the project node of Jdeveloper click new. Select Business Tier > Web Service > Web Service Data Control.
In the url field of the next window give the WSDL file location of the BPEL process. Give a suitable name in the Name field. Choose the proper service method which we are going to call.
In the next screen click on add button for the processes which you want to initiate from your ADF application.
Click on next two times. In the end point authentication page give the proper username and password if the web service is a secured one. Click on Finish in the next page.
You can see your web service with its method has become a component in the data control pallet.
There is one file InvokeBPEL.xml which holds all the Input/Output parameter signature like the following way ->
id="InvokeBPEL" BeanClass="InvokeBPEL" isJavaBased="false">
There is another file “DataControls.dcx” which holds other information about the webservice specially the WSDL location.
Integrating Web Service Data Control in JSF pages with ADF faces component
Create one JSF/JSP page like InvokeBPEL.jspx in JDeveloper. Now just drug and drop the input parameters of the BPEL process on the JSF page ->
In our case it is Name and Phone no. which we can attach in the JSF page.
Drug and drop process on the page and select methods > ADF Command Button.
Change the name to “Initiate BPEL Process”.
Now, drug and drop the Return variable from InvokeBPEL webservice data control.
Select Texts > ADF Output Text.
Now if you run this page, the page will be displayed as follows ->
After running the page we’ll get the value as follows ->
With ADF application is getting the Name and Phone value from user input, and then it is invoking the BPEL process. In the input parameter of the BPEL process it is passing the name and phone no. as Input parameter. When the BPEL process will end it sends the result to ADF application and ADF is displaying the end result in one ADF faces outputText component.
To know about asynchronous BPEL process from JAVA the above code needs a bit modification. Read the following post to know about that.
More article on BPEL/ESB/SOA, you can find here BPEL/ESB/SOA.
More article on Oracle ADF, you can find here ADF.