In this second part of the serie about communication between Oracle Service Bus and Composite Applications from the SOA Suite we will discuss the synchronous communication from the service bus to the composite application.
When developing composite applications, you could expose these services to the outside world to be used by customers. In these cases you could decide to make use of a service bus in front of the services to virtualize them.
Sync call from Oracle Service Bus to SOA Suite Composite
Oracle SOA Suite Composite Application
In JDeveloper create a new SOA Application with an empty SOA Project in it.
For this blog i created a simple synchronous HelloWorld bpel process which will return the “Hello ” + the inputparameter string.
To be able to invoke the bpel process we need to expose the service interface of the bpel process.
Drag the Direct Binding Service Adapter to the left swim lane.
For the service interface i will just re-use the wsdl of the bpel process.
In the first part of this serie we used ‘Reference’ type for the Direct Binding. In this case we want to invoke the composite from our Oracle Service Bus project, so we will be using the ‘Service’ Type.
Deploy the application. If we lookup the process in the Enterprise Manager and select it we will see a overview of the next components in it
In the first part of the serie we used the Hello_PS_Direct with the ‘Reference’ usage for the DirectBinding and in this blog we will be using the ‘Service’ usage.
Oracle Service Bus
For the development of the Oracle Service Bus process we need a few components
- Proxy Service
- Business Service (invoking the bpel process)
Create a new OSB Configuration Project in Oracle Enterprise Pack for Eclipse.
Creata a new OSB Project.
Communication with the Oracle SOA Suite components will make use of the new SOA-DIRECT transport available in the Oracle Service Bus 11g.
- The SOA-DIRECT transport provides native connectivity between the Oracle Service Bus and the Oracle SOA Suite service components.
- The SOA-DIRECT transport supports wsdl type services with soap1.1 and soap1.2 or XML Bindings.
- The SOA-DIRECT transport supports the following features: (copy/paste)
- Invocation of any SOA binding component services through Java remote method invocation (RMI)
- WS-Addressing, including optional auto-generation of ReplyTo properties for asynchronous callbacks
- Identity propagation
- Transaction propagation
- Optimized RMI transport for invoking SOA services
- High availability and clustering support
- Failover and load balancing (not available for services in the Service Callback role
- Connection and application retries on errors
To be able to invoke the bpel service we will need the service endpoint.
In JDeveloper go to the ‘Application Server Navigator’. Select the soasuite applicationserver > SOA > soa_server1 > default > your composite name > name of your expose service interface. Right mouse click on it and select ‘Copy Path’.
If we look into the wsdl we will see it created two services for us (soap1.1 and soap1.2) with the t3 endpoint in it.
<wsdl:service name="DServiceHelloWorld"> <wsdl:port name="DServiceHelloWorldDirectBindingPort11" binding="client:HelloBPELProcessDirectBinding1.1"> <soap:address location="t3://xesoa11g.iteye.local:8001/default/DirectBindingComposite!1.0/DServiceHelloWorld" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> </wsdl:port> <wsdl:port name="DServiceHelloWorldDirectBindingPort12" binding="client:HelloBPELProcessDirectBinding1.2"> <soap12:address location="t3://xesoa11g.iteye.local:8001/default/DirectBindingComposite!1.0/DServiceHelloWorld" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/> </wsdl:port> </wsdl:service>
In your Oracle Service Bus project (switch ide again), import the wsdl resource from the location we just copied. The import will create a wsdl + xsd from the bpel process for us.
Create a new Busines Service in this project and use the next settings.
We’ll be using a wsdl based business service, and for this interface we will use the wsdl we just imported.
By default the soa-direct transport is selected with the t3 endpoint of our bpel process (direct binding interface).
On the SOA-DIRECT Transport tab we can select some other settings. Since we will be invoking a synchronous bpel process the ‘Synchronous client’ option will do just fine and the rest isn’t needed.
- JNDI Service Account – Configurat security credentials for the jndi lookup of the target soa service Role – Synchronous Client/Asynchronous Client/Service Callback, depending on the service you invoke
- Callback Proxy – needed for the Asynchronous Client, specify the proxyservice where to deliver the callback
- Fault Proxy- needed for the Asynchronous Client, specify the proxyservice where to deliver the fault situations
- WS-Addressing version, needed for Asynchronous Client, specify the version of WS-Addressing is provided in the request or proxy service pipeline
- Dispatch Policy – Select the instance of Oracle WebLogic Server Work Manager that you want to use for the dispatch policy for this endpoint
From the business service generate the proxy service. This will be a SOAP over HTTP service based on the same wsdl of the business service.
Publish the Oracle Service Bus project to the server.
Test the proxy service and see if the outcome is correct
The steps we need to communicate sync from the Oracle Service Bus with the Composite Application :
Create a composite application with Direct Binding Service Reference. Import the resources in your Oracle Service Bus project. Create a business services based on these ans use the SOA-DIRECT transport to communicate with the composite application.
In the other parts of this serie i will discuss the asynchronous flows between the Oracle Service Bus and the Composite Applications.