Calling BPEL from Oracle Service Bus
By Antony Reynolds on Oct 03, 2008
Calling BPEL from the Oracle Service Bus
The latest SOA Suite from Oracle now includes the former AquaLogic Service Bus (ALSB), now known as the Oracle Service Bus (OSB). The old Oracle Enterprise Service Bus (ESB) is still available but the preferred Service Bus in Oracle is now the OSB. Currently OSB is only available on WebLogic platform whilst ESB is supported on all SOA Suite platforms. This entry details the steps that I had go through to call BPEL (version 10.1.3.4) from ALSB (version 3.0 which can be downloaded from here). When the Oracle badged version is released some of the problems I had should go away. So here is what I did to get OSB to call BPEL.
Creating the Project and Directories
I began by creating a project in the service bus, I tend to separate components out into sub-folders such as WSDL, Schemas, Proxy and Business Services. This makes it easier for me to find things.
Loading the WSDL
In the BPEL console I navigated to the WSDL for the process I wanted to call and saved it locally. In my OSB projects WSDL folder I then uploaded the BPEL WSDL. After doing this it complained that:
The WSDL "AddBPELProcess.wsdl" was successfully created with validation errors. View the WSDL/Conflicts to see detailed diagnostic messages.
Drilling down into the loaded WSDL I got a more specific error message explaining what the conflict was:
One of the WSDL dependencies is invalid.
By default JDeveloper creates a WSDL that imports its type definitions from a separate XML schema. This XML schema file by default has the same name as the WDSL file but with a .xsd extension. The service bus was complaining because it couldn’t find that schema. I would obviously have to fix this.
Loading the Schema and Resolving the Reference
BPEL stores the schema at the same location as the WSDL file. So if the URL of my WSDL file was “http://w2k3/orabpel/default/AddBPELProcess/1.0/AddBPELProcess?wsdl” then the URL of my XSD would be “http://w2k3/orabpel/default/AddBPELProcess/1.0/AddBPELProcess.xsd”. I needed to first of all download from BPEL the schema file and then I uploaded it to the Schema folder I had created in my service bus project. I then went back to my WSDL folder, drilled down into my BPEL process WSDL and went into the the “Edit References” screen. Here I was able to browse for my uploaded schema and match it to the schema expected by the WSDL. Saving these changes gave me a WSDL that the service bus was happy with.
Creating the Business Service
My BPEL process was to be a back end service or business service in the service bus. having loaded the WSDL for the service I was now ready to create a business service. I went to the BusinessServices folder and added a business service using the WSDL I had just uploaded. I chose to use the port rather than the binding in the WSDL as this would provide me with the physical endpoint of the service from the WSDL, avoiding me having to specify it. After creating the business service I then activated my changes so I could test out the business service from the service bus test screen.
Testing the Business Service
After activating my changes I clicked on the little bug icon next to my business service expecting to see a nice test screen, but all I got was an ugly error message.
Error Accessing Test Configuration
Underneath this message was some more detail.
An unexpected error occured accessing information about the WSDL of the service:
com.bea.wli.config.component.NotFoundException: Can not compute effective WSDL for : BusinessService Chapter19/BusinessServices/AddIntegers
Still not very helpful. A quick search of the internet turned up this useful blog entry by Berthold Maier (thank goodness for my schoolboy German).
Fixing the WSDL
It turns out that the service bus didn’t like the partner link elements at the end of the WSDL. Personally I think it should have ignored them if it didn’t understand them, but c’est la vie! I edited the WSDL in the service bus and commented out the partner link information.
I was then able to commit the changes and go back to the business service test screen which now appeared correctly and allowed me to invoke the BPEL process.
More Thoughts on WSDL
The above steps let me call my process, but I did have to manually edit the WSDL. I could have avoided this by uploading to the service bus the WSDL from within my JDeveloper project which is missing the binding information. But this raises another set of issues and I prefer to work with what is deployed, particularly as I cannot guarantee access to the JDeveloper version of the WSDL and even if I had access I have no guarantee that the deployed WSDL and the WSDL in JDeveloper are the same.
When calling BPEL from the service bus remember two key things
- Upload any referenced schema or wsdl files into the service bus.
- Remove the partner link information from the wsdl obtained from JDeveloper.
Apart from those two issues everything else seemed to work fine.
I have to say that I find the newly acquired Oracle Service Bus very capable and has lots of nice features such as support for throttling, configuration history and dashboards. And best of all the next release will have tighter integration with BPEL, what's not to like?