0% found this document useful (0 votes)
10 views

OSB Tutorial for beginners

The document is a tutorial for beginners on Oracle Service Bus (OSB), detailing its functionalities, components, and how to create services within the OSB environment. It covers essential topics such as service management, service virtualization, and the process of creating proxy and business services, including validation and error handling stages. Additionally, it includes instructions for testing the application and addresses common FAQs related to OSB.

Uploaded by

shyam sivaraman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

OSB Tutorial for beginners

The document is a tutorial for beginners on Oracle Service Bus (OSB), detailing its functionalities, components, and how to create services within the OSB environment. It covers essential topics such as service management, service virtualization, and the process of creating proxy and business services, including validation and error handling stages. Additionally, it includes instructions for testing the application and addresses common FAQs related to OSB.

Uploaded by

shyam sivaraman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

OSB Tutorial for beginners

19/02/2014

British Airways Plc


TTH
Sri Ram R [555436]
Oracle Service Bus
[email protected]
Confidentiality Statement
Include the confidentiality statement within the box provided. This has to be legally
approved
Confidentiality and Non-Disclosure Notice
The information contained in this document is confidential and proprietary to TATA
Consultancy Services. This information may not be disclosed, duplicated or used for any
other purposes. The information contained in this document may not be released in
whole or in part outside TCS for any purpose without the express written permission of
TATA Consultancy Services.

Tata Code of Conduct


We, in our dealings, are self-regulated by a Code of Conduct as enshrined in the Tata
Code of Conduct. We request your support in helping us adhere to the Code in letter and
spirit. We request that any violation or potential violation of the Code by any person be
promptly brought to the notice of the Local Ethics Counselor or the Principal Ethics
Counselor or the CEO of TCS. All communication received in this regard will be treated
and kept as confidential.

2
Table of Content

1. What is Oracle Service Bus .......................................................................................................................................... 4


2. OSB Functional Components Overview ....................................................................................................................... 4
2.1 Service Management ............................................................................................................................................... 5
2.2 Service Virtualization ............................................................................................................................................. 5
2.3 Configuration Framework ....................................................................................................................................... 5
2.4 Unified Policy Management & Security ................................................................................................................. 5
2.5 Adaptive messaging ................................................................................................................................................ 5
3. How to create a service in OSB .................................................................................................................................... 5
3.1 Log in to Oracle Service Bus Console .................................................................................................................... 5
3.2 Create a session and setup a project ........................................................................................................................ 5
3.3 Starting a session and creating a project ................................................................................................................. 6
3.4 Creating a Project Folder ........................................................................................................................................ 8
3.5 Creating the WSDL Resource ................................................................................................................................. 8
3.6 Creating XSLT ........................................................................................................................................................ 9
3.7 Creating the Proxy Service ................................................................................................................................... 10
3.8 Creating the Business Service ............................................................................................................................... 12
3.9 Creating Schema ................................................................................................................................................... 13
4. Adding Stages in Proxy service .................................................................................................................................. 13
4.1 Validation stage..................................................................................................................................................... 13
4.2 Add Validation stage............................................................................................................................................. 14
4.3 Transform Request ................................................................................................................................................ 15
4.4 Route to Business Service ..................................................................................................................................... 15
4.5 Add Service Error Handler ................................................................................................................................... 16
5. Testing the Application ............................................................................................................................................... 18
6. FAQ’s.......................................................................................................................................................................... 19
7. References ................................................................................................................................................................... 19

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.

For more info: https://java.net/downloads/oraclesoasuite11g/OSB/osb_examples_tutorials_111140_and_later.pdf


The Oracle Service Bus design-time tooling lets you configure a proxy service to suit your needs and to manage
Web services by controlling the service and policy configurations and by monitoring system and operations tasks.
Oracle Service Bus relies on Oracle Weblogic Server run-time features.
2. OSB Functional Components Overview
Oracle Service Bus allows you to manage web services and deliver authentic message brokering through the
configuration of proxy services in the Oracle Service Bus design-time environment. Oracle Service Bus manages the
routing and transformation of messages in an enterprise system to promote seamless application integration. The
following diagram illustrates key functional components of Oracle Service Bus.

For more info: https://java.net/downloads/oraclesoasuite11g/OSB/osb_examples_tutorials_111140_and_later.pdf

4
2.1 Service Management

Service management is intended for system administrators and operators who manages and monitor Oracle
Service Bus.

2.2 Service Virtualization


Service Virtualization is meant for the following,
 To modify service end points in run time
 Provide multiple end points for failover and load balancing
 Modify transport protocols
 Re-try services transparently in case of failures

2.3 Configuration Framework


The Configuration Framework gives you full control over your Oracle Service Bus production environment.

2.4 Unified Policy Management & Security


Oracle Service Bus enables unified security policies and identity management to be applied to XML
applications across the enterprise.

2.5 Adaptive messaging


Adaptive messaging provides flexible message handling and manipulation between clients and services. For
example, a client could send a SOAP message over HTTP through Oracle Service Bus, which can in turn transform
the message and invoke a back-end EJB.

3. How to create a service in OSB

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

3.1 Log in to Oracle Service Bus Console

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.

3.3 Starting a session and creating a project

 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,

 Click Add Project


The SampleProject project is created and listed in the Project Explorer under Projects.
You must create a project folder WSDL first, and add a WSDL resource to it. The WSDLs are the basis on which
you create the business services and the proxy service. You subsequently create other folders and resources for this
scenario.

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,

 Click Add Folder.


 The WSDL folder is displayed in the list of project folders for the SampleProject project.
 Repeat the previous steps to create the following additional folders: ProxyService, BusinessService and XSLT.
When all the four folders are created, click Activate; enter a description of the changes you just made, and click
Submit to save the project directory structure.

3.5 Creating the WSDL Resource

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)

- Enter SampleWsdl as resource name


- Click Browse. Select the WSDL from appropriate location. Optionally, enter information in the Resource
Description field to describe the resource.
- Click Save

3.6 Creating XSLT

 Go to XSLT folder under SampleProject.


 Select XSLT under Create resource.

9
 Click Browse. Select the XSLT from appropriate location.

3.7 Creating the Proxy Service

 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.

 Click Next to continue configuring the proxy service.


 Accept the default protocol, http.
 Set the Endpoint URI to /SampleProject/SampleProxyService. This is the URI to which the client will send its
messages.
 Accept the default for the Get All Headers option (No), and click Next. Create a Proxy Service-HTTP Transport
Configuration page will be displayed.
 Click Last. Review the summary and save it.

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

 Enter a name for the service. In this case, enter SampleBusinessService.


 For Service Type, select WSDL Web Service, and then click Browse. Select the WSDL and port on which to base
the business service:
- In the WSDL Browser, select the appropriate WSDL.
- Select the port (helloPort) for the WSDL.
- Click Submit.
 Click Next.

 Accept the default protocol, http.

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.

3.9 Creating Schema


 Go to WSDL folder, select XML Schema in Create Resource as follows,

 Import the schema and give Save.

4. Adding Stages in Proxy service

4.1 Validation stage

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.

Configure the Request Actions for the Proxy Service


 Click the Request icon and select Add Stage.
 Click Stage1, then select Edit Name and Comments.
 Enter validate request in the Name field and click Save.
 Click the validate request stage and give Edit Stage.
 Click on Add an action, select Validate under Message Processing

 Give ‘*’ in <XPath>, and enter ‘body’ in variable text field.


Note: * represents the entire payload.
 Select WSDL/Schema in <Resource>.
 Select the Raise Error on validation failure option.

14
 Click Save, to save the configuration.

4.3 Transform Request

 Add another stage – Transform Request. Click Edit Stage.


 Click Add an action and select Replace.

 Give ‘*’ in <XPath>, enter ‘body’ in variable text field.


 Select Replace Entire Node

 Edit the <Expression>, click XSLT Resources tab and select the appropriate XSLT from Browse option.

4.4 Route to Business Service

 Click PipelinePairNode1, select Add Route from menu options

15
 Click RouteNode1, and select Edit Route.
 Click Add an Action, and select Routing under Communication.

 Click <Service> and select the SampleBusinessService.


 Select the operation to be invoked from drop down box of invoking field.

4.5 Add Service Error Handler

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

 Click the SampleProxyService and select Add Service Error Handler.

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.

 Give ‘*’ in <XPath>, enter ‘body’ in variable text field.

17
 Edit the <Expression>, click XSLT Resources tab and select the appropriate error handler XSLT from Browse
option.

5. Testing the Application


 In Oracle Service Bus Console, make sure the current session is activated
 Select Resource Browser > Proxy Services in the left panel.
 Click on Launch Test Console icon in Actions column for SampleProxyService to launch the test console

 Paste the request and accept all the default settings and click execute

 The invocation trace section contains of following categories of information

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

1. What is the difference between ‘*’ and ‘.’ In Xpath?


If you give ‘*’ in Xpath Editor, entire payload will get replaced. But if the input payload is null,
replace action will not occur.
If you give ‘.’ in Xpath Editor, entire payload will get replaced even it is null.

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.

3. How to pass http headers from proxy service to underlying service?


Go to the Configurational Details of the corresponding proxy service then select ‘Yes’ for Get All
Headers under Transport Configuration tab.

4. What is “Use chunked Streaming mode”?


Set “Use chunked Streaming mode” as Disabled. This should avoid the following problems,
- Client requests get a read timed out error
- The BEA-380000 error "Request Entity Too Large" appears in the logs
- The last executed OSB instance continuously retries every 5 minutes

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

For more information, contact [email protected] (Email Id of ISU)

About Tata Consultancy Services (TCS)

Tata Consultancy Services is an IT services, consulting and business solutions


organization that delivers real results to global business, ensuring a level of certainty no
other firm can match. TCS offers a consulting-led, integrated portfolio of IT and IT-
enabled infrastructure, engineering and assurance services. This is delivered through its
unique Global Network Delivery ModelTM, recognized as the benchmark of excellence in
software development. A part of the Tata Group, India’s largest industrial conglomerate,
TCS has a global footprint and is listed on the National Stock Exchange and Bombay
Stock Exchange in India.

For more information, visit us at www.tcs.com.

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

You might also like