Consuming OSB Services from Oracle BPM

Consuming OSB Services from Oracle BPM

As discussed in my previous post, using Oracle BPM to consume services exposed through Oracle Service Bus is the most common type of integration.  In the diagram below you can see the highlighted path that is taken in this case.  All of the communication is between the BPM execution engine, Service Bus, and the back end web services.

BPM OSB Integration

There are two possible methods to consume the services from OSB in Oracle BPM.  The first case is the same as consuming any other web service in Oracle BPM.  The second case involves using an Oracle Service Bus connector in Oracle BPM in order to provide better tooling to the developer when consuming the services.  Whichever method you choose to use during development will result in the same execution at runtime using standard web service calls.  In either case, these integrations are limited to SOAP services exposed over HTTP.  Currently SOAP over JMS (or any other protocol) is not supported.

I will now go through an example of consuming a service using both of these methods.

Oracle Service Bus Resources

In this post we will use an example OSB Service called HelloBPM.  This is a WSDL based Proxy Service that simply takes in a name and transforms it into a response message of “Hello Name!”  Below is the Proxy Service listed in the OSB console:

In order to consume this service as a standard web service, we need to know the URL of the WSDL.  By looking at the details of this proxy service in the OSB console, we see the endpoint URL is /OBPM/Services/HelloBPM.  We will use this in the next section:


Consuming as Standard Web Service

Within Oracle BPM, the first step in consuming a service either as a Web Service or as an OSB Service is to create a module to hold the service.  For the example of consuming the service as a standard Web Service, I have created a module named WebServices.  Once the module is created, you can right click on it and go to Catalogue Component -> Web Service.  This will bring up the Web service wizard you will use to consume the service:

The first step in the wizard is to provide the WSDL file.  As we saw in the OSB console earlier, the endpoint for our service is /OBPM/Services/HelloBPM.  We use that endpoint along with our OSB server host and port to retrieve the WSDL.  The complete address to the WSDL ishttp://localhost:7001/OBPM/Services/HelloBPM?wsdl

After the introspecting of the service is complete, click finish and you will see a HelloBPM web service module has been created within your WebServices module.  This new web services module will contain the service all related schemas are used within the service.  This service can now be used within your process.



Consuming using Service Bus Connector

Consuming the same service as an OSB service is very similar to the standard web service.  For this example, I have created a module named OSBServices to hold the OSB Service version.  This time we will right click on the OSBServices module and select Oracle Service Bus from the Catalogue Component menu.

Because we have not consumed a service from OSB yet we need to create a new OSB configuration.  You can provide any name you want for the configuration and select next.

You will then be required to enter the host, port, and login credentials of your OSB server.

Once the OSB configuration has been created you can browse the resources in OSB by project.  You can see below that OBPM is the selected project and it contains a single proxy service  called HelloBPM.

Once you click next, this service is consumed in much the same way as when using the standard web service.  Below is a very similar set of resources created in your catalog underneath your OSBServices module.  As with the other option, your service is now ready for use within your process.



As you have seen in this post, the two ways to consume OSB services within Oracle BPM are very similar.  However, we find the OSB integration makes it easier for a BPM developer to consume services.  If you do not use the OSB integration, the WSDL address for each individual service needs to be provided to the BPM developer to consume the service.  However, if you have a small number of services that have not previously been consumed through OSB, it is often easiest to use the standard web service method.

Referenced from Avion Consulting Blog

Post Tagged with , , , , , ,