OSB Tutorial for beginners
OSB Tutorial for beginners
19/02/2014
2
Table of Content
3
1. What is Oracle Service Bus
Oracle Service Bus is a market-leading enterprise service bus built from the ground up for Service Oriented
Architecture (SOA) life cycle management. It provides foundation capabilities for service discovery and
intermediation, rapid service provisioning and deployment, and governance. This service-infrastructure software
adheres to the SOA principles of building coarse-grained, loosely coupled, and standards-based services, creating a
neutral container in which business functions may connect service consumers and back-end business services,
regardless of underlying infrastructure. Below figure illustrates the role of Oracle Service Bus as a service
intermediary in an enterprise SOA architecture.
4
2.1 Service Management
Service management is intended for system administrators and operators who manages and monitor Oracle
Service Bus.
Prerequisites
To develop and run the Oracle Service Bus tutorials, you must create an Oracle Service Bus domain using the
Oracle Fusion Middleware Configuration Wizard. Please refer the following link to install Oracle Service Bus
http://docs.oracle.com/cd/E23943_01/doc.1111/e15017/install_osb.htm
Open a browser window and enter the following URL to open the Oracle Service Bus Console for the Service Bus
Tutorial domain: http://localhost:7001/sbconsole
Log in with the user name and password that you specified when created the domain.
3.2 Create a session and setup a project
Using Oracle Service Bus Console, you can monitor resources and configurations in Oracle Service Bus
environment. You can perform system monitoring without initiating a session. However, you must first create a
5
session in the Oracle Service Bus console to update or delete resources and modify their configuration properties. The
following figure illustrates the change centre pane available on Oracle Service Bus console.
In addition to creating and activating sessions, the change centre allows you to perform the functions summarized
in the following table.
Click To
Edit Edit is to create a new session
Exit Discontinue the session and save the session state.
Discar End the current session without saving the changes.
d
Activa Save the current session's configuration to the run time.
te
When you click Activate, the Activate Session page is displayed. In this
page, the user and session name of the session are displayed. If required, you
can add a description. Click Submit to save the current session's configuration to
the run time.
In the Oracle Service Bus Console Change Centre click Create to create a new session.
In the Oracle Service Bus Console navigation pane, select the Project Explorer.
6
In the Enter New Project Name field in the Projects section, type SampleProject as shown in fig,
7
3.4 Creating a Project Folder
In the project explorer, click the SampleProject project to open the associated project page.
On the Project page, in Folders, enter the folder name in the field provided. In this case, enter WSDL as displayed
in the following fig,
A WSDL defines the public contract (interface specification) between a client and a service, whether the service is
a proxy service or a business service. It is the formal description of a web service. A WSDL is used to describe what a
web service's interface is, where it resides, and how to invoke it. You create the WSDL resource first since subsequent
service registration tasks depend on it. The WSDL is subsequently used to register the business service with the proxy
service.
To Import a WSDL
In the Oracle Service Bus Console Change Centre click Create to create a new session.
In Oracle Service Bus Console navigation pane, select the Project Explorer.
In the project explorer, click the WSDL folder.
In the Resources pane, from the Select Resource Type list, select WSDL.
8
Enter the following information in the Create a New WSDL Resource page (as shown in below figure)
9
Click Browse. Select the XSLT from appropriate location.
In the project explorer, select the SampleProject project. The project folder is expanded to show the directory
structure of the project.
Select the ProxyService folder.
In the Select Resource Type list, select Proxy Service. Proxy service – Generation configuration page is displayed
as below.
10
In Service Type, select WSDL Web Service, thin click Browse.
Select the SampleWsdl WSDL. The Select WSDL Definitions pane is populated with the content categories of the
WSDL.
In Select WSDL Definitions pane, from the Ports category, click helloPort, which is the WSDL port for the
SampleWsdl WSDL (helloPort).
Click Submit. The port name is displayed in the WSDL port text field as shown below.
11
3.8 Creating the Business Service
In the Oracle Service Bus Console Change Centre click Create to create a new session.
In the Project Explorer, select the BusinessService folder.
In the Select Resource Type list, select Business Service.
The Create a Business Service - General Configuration page is displayed as shown in below
12
Select none for the Load Balancing Algorithm, since load balancing is relevant only when a service specifies
multiple end points.
Accept the default settings for the remaining options on the page and click Next.
In the Create a Business Service-HTTP Transport Configuration page, accept the default settings on this page, then
click Next.
In the Create a Business Service-SOAP Binding Configuration page, accept the default settings and click Next.
In the Message Handling page, click Next.
Click Save to accept the configuration settings.
To enable monitoring:
- Click the Operational Settings tab.
- Select the Enabled check box for the Monitoring field.
- Click Update.
- Activate the session.
Oracle Service Bus proxy services can be configured to validate messages passed between clients and
business services. Validation actions can be configured at any stage in the message-handling pipeline. However these
actions are usually configured in the early stages to eliminate erroneous messages.
13
4.2 Add Validation stage
In the Actions column associated with the SampleProxyService, click the Edit Message Flow icon. [ ]
Click the SampleProxyService node, and then select Add Pipeline Pair.
14
Click Save, to save the configuration.
Edit the <Expression>, click XSLT Resources tab and select the appropriate XSLT from Browse option.
15
Click RouteNode1, and select Edit Route.
Click Add an Action, and select Routing under Communication.
If something goes wrong inside the proxy service, then the call will come to Service Error handler.
Prerequisites
Need to have error handler XSLT, to propagate proper error response to consumer
16
Click Error Handler and Add Stage.
Click the new added stage, and then select Edit Stage.
Click on Add an action, select Validate under Message Processing.
Click Add an action and select Replace.
17
Edit the <Expression>, click XSLT Resources tab and select the appropriate error handler XSLT from Browse
option.
Paste the request and accept all the default settings and click execute
18
- The trace for service invocations on the request path
- The trace for the routed service
- The trace for the service invocations on the response path
- Changes made to the message context between the entry point of the route node (on the request path) and the
exit point (on the response path)
6. FAQ’s
2. What is the common issue that occurs while migrating OSB to 11g?
In osb11g, if any one of the operations got defined in binding, but not in port type or message name,
then the WSDL will show conflict.
But the same scenario will go through in osb10g until and unless if there any syntax error.
7. References
http://www.oracle.com/technetwork/articles/jumpstart-for-osb-development-page--097357.html
https://java.net/downloads/oraclesoasuite11g/OSB/osb_examples_tutorials_111140_and_later.pdf
https://java.net/projects/oraclesoasuite11g/pages/OSB
19
Thank You
Contact
IT Services
Business Solutions
Consulting
All content / information present here is the exclusive property of Tata Consultancy Services Limited (TCS). The content /
information contained here is correct at the time of publishing. No material from here may be copied, modified, reproduced,
republished, uploaded, transmitted, posted or distributed in any form without prior written permission from TCS.
Unauthorized use of the content / information appearing here may violate copyright, trademark and other applicable laws,
and could result in criminal or civil penalties. Copyright © 2011 Tata Consultancy Services Limited