Oracle Service Bus Introduction
Oracle Service Bus (previously known as Weblogic ALSB) is a light weight messaging component of SOA Suite. In addition to providing basic routing and transformation services, OSB also provides advanced capabilities for service abstraction.
As of version 184.108.40.206, OSB can only run on Weblogic platform. Since it runs in a separate JVM, there is an overhead in communicating with rest of SOA Suite components.
Though OSB is similar to Mediator component at the conceptual level, there are specific scenarios when OSB will be very useful.
OSB has a built-in feature to modify service end point at run time. This would be very useful when virtualizing external services, probably hosted by various partners.
OSB can also be used to throttle services, thus limiting the number of invocations. This can be valuable in meeting client service level agreements as well as preventing services from being swamped.
In other cases, Mediator will offer more benefits since it is available in the same JVM as rest of SCA components.
OSB service invocation overview
OSB service invocation happens through two different layers: proxy service and business service. Proxy service is an entry point for all service invocations. Ideally proxy service should present canonical interfaces to clients.
Proxy service then routes inbound message through a series of steps (aka pipes). Each step can perform distinct operations such as transformation, enrichment and logging etc., eventually this message is routed to Business Service which is just a reference to target service. Similarly, output message from business services follows reverse flow through outbound pipeline, proxy service and finally to the client.
Input and output pipe lines are also responsible for transforming data from and to canonical format.
In subsequent lessons, we will explore various features of OSB.
OSB Sample Application
In this lesson we are going to create our first Hello World OSB service. This requires us to create a Business Service, a Proxy Service and import an External Service we created earlier using BPEL.
Installed Hello World BPEL process is a pre-requisite for this lesson. Also, please see Introduction to OSB for an overview of the product.
Login to OSB console using the URL http://localhost:7001/sbconsole. This URL may change based on your server’s hostname and port number.
Click on “Create” under Change Center to create an exclusive session for our Helloworld project. This ensures that resulting changes are not in conflict with other users’ work.
Create a project to hold XML artefacts and WSDLs. Click on Project Explorer at the bottom left side of the console. Enter “helloworld” as the project name.
Click on helloworld project to get to the project details page.
Create three folders to hold Business Service, Proxy Service and External Service resources: BusinessService, ProxyService, and ExtService respectively.
Create External Service
Lets import WSDL required to invoke HelloWorld external service. Click on ExtService folder link. From Create Resource drop down, select “Resource from URL” option.
Get Hello World BPEL process’s WSDL from EM Console.
Copy Hello World BPEL Process’s WSDL URL for URL/Path field. Enter other field values as shown below. Click on Next.
From Load Resources page, we can see that OSB has imported WSDL as well as referenced XSD file. Click on Import button.
Import confirmation is shown in the next screen.
Create Business Service
Click on BusinessService folder link from Project Explorer on the left side to go back to project folder.
Let us create a Business Service using the imported resources. From Create Resource menu, select Business Service.
Enter HelloWorldBS for Service Name.
Click on Browse next to WSDL Web Service to open up WSDL we added in previous steps. Click on HelloWorldBPEL WSDDL link.
Select HelloWorldProcess_pt port type and click on Submit.
Click on Next to go to Transport Configuration page. We can leave the default values. Click on Last button to go to summary page. Click on Save to complete creation of Business Service.
From Resource section, we can see that HelloWorldBS business service is successfully created.
Create Proxy Service
Click on ProxyService folder link from Project Explorer. Under Resources section, select Proxy Service from Create Resource combo box.
Enter values as shown below.
Select Business Service and click on Browse button to see the list of available business services. Select HelloWorldBS from the list and click on Submit.
Click on Last and then Save from summary page to create Proxy Service. We can see HelloWorld proxy service successfully created from Project details page.
Create Message Flow
Since Proxy Service is created based on an existing Business Service, request is already configured to be routed from proxy service to business service. Let us verify this. Click on Edit Message Flow icon from Actions section.
From Edit Message Flow window, we can see the message flow is already established. Click on Cancel to go back to project details page.
Let us save our work. Click on Activate button from Change Center. Click on Submit button.
Testing Proxy Service
Click on ProxyService folder link from Project Explorer.
Click on Launch Test Console action as shown below.
Leave the default values for all fields except for Payload. Enter orafmwschool as input element value. Click on Execute.
We can see the request and response XML documents. Observe response document contains “Hello orafmwschool” as the result element value.
This completes the Helloworld OSB lesson.
For indepth understanding of OSB click on