Osb Examples Tutorials 0
Osb Examples Tutorials 0
April 2010
Contents
1 Oracle Service Bus Examples ............................................................................................... 2
2 Introduction to the Oracle Service Bus Tutorials.................................................................. 5
3 Getting Started with the Oracle Service Bus Tutorials ....................................................... 11
4 Tutorial 1. Routing a Loan Application ............................................................................... 16
5 Tutorial 2. Transforming a Loan Application ...................................................................... 46
6 Tutorial 3. Validating a Loan Application............................................................................ 74
Oracle Service Bus Examples and Tutorials
A preconfigured domain that lets you run the examples and modify input
parameters in a Web application.
A set of example source files for reference and for using to reconstruct the
examples in the tutorials.
Note: Oracle Service Bus version 11.1.1.3 does not include the example source
files. To complete the tutorials, you must download the required files. For download
information, see “Before You Begin” in 2 Introduction to the Oracle Service Bus
Tutorials.
2
Oracle Service Bus Examples and Tutorials
Examples Description
Oracle Service Bus provides the following examples:
All other loan applications are routed to another business service for
processing. The target business service responds, indicating whether the loan
application is approved or rejected.
A primary mortgage company uses Oracle Service Bus to identify and re-route
loan applications that are easy to sell to secondary mortgage companies. A
loan application with a principal request of $25,000,000.00 can be sold to a
secondary mortgage company. For such a loan application, a Web service
lookup is performed to retrieve the customer's credit rating.
The credit rating information is added to the loan application and the
application is then forwarded to the secondary mortgage company's Web
service to be processed. All other loan applications are routed to another
business service for processing. The target business service responds
indicating whether the loan application is approved or rejected.
3
Oracle Service Bus Examples and Tutorials
When installing Oracle Service Bus, you must select the custom installation option
and select the Oracle Service Bus Examples to install.
The example and tutorials are based on using an Admin-only domain with Oracle
Service Bus running on an Admin server.
When the domain starts, the examples page automatically appears in a browser.
Click Load the Examples to deploy the examples. Click Reload the Examples
only if you have changed your domain.
4
Oracle Service Bus Examples and Tutorials
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. Figure 2-1 illustrates the role of Oracle Service Bus as a
service intermediary in an enterprise SOA architecture.
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.
5
Oracle Service Bus Examples and Tutorials
6
Oracle Service Bus Examples and Tutorials
Oracle Service Bus lets you implement proxy services independently and configure
them dynamically, as driven by your business needs, without requiring costly
infrastructure development and re-deployment efforts. The configuration functions
are separated from the management functions in Oracle Service Bus.
A proxy service can route messages to multiple business services; you can choose to
configure a proxy service with an interface that is independent of the business
services with which the proxy service communicates. In such cases, you can
configure a proxy service message flow definition to route a message to the
appropriate business service and map the message data into the format required by
the business service interface.
Business services are Oracle Service Bus definitions of the enterprise services that
exchange messages during business processes. A business service and its interface
can be defined and configured using the Oracle Service Bus design-time tooling. To
configure a business service, you must specify its interface, the type of transport it
uses, its security requirements, and other characteristics.
A business service definition is similar to that of a proxy service, but it does not have
pipelines (a message flow).
7
Oracle Service Bus Examples and Tutorials
pipelines are accompanied by a set of message context variables that contain the
message contents. They can be accessed or modified by actions in the pipeline
stages.
Pipeline Pairs
Pipeline pairs are request and response pipelines. The request pipeline definition
specifies the actions that Oracle Service Bus performs on request messages to the
proxy service before invoking a business service or another proxy service. The
response pipeline definition specifies the processing that Oracle Service Bus
performs on responses from the business or proxy service that the proxy service
invokes before returning a response to a client.
8
Oracle Service Bus Examples and Tutorials
You will use the Oracle Service Bus Console design-time tooling in the tutorials,
though you can perform similar tasks in the Oracle Service Bus IDE.
In the tutorials, you will use the console to create the proxy services that interact
with the service clients and business services. As you work through the tutorials, you
will:
Learn how to configure proxy services to process the input and output
messages in a message flow.
Create, read, and update configuration objects, such as proxy services and
Web Services Description Language resources (WSDLs).
See how Oracle Service Bus uses session management to allow configuration
changes locally, and then instantiate the changes in the core environment.
Configure resources such as WSDLs, Service Callouts, XQueries, and business
services.
9
Oracle Service Bus Examples and Tutorials
After you complete the Getting Started steps for the tutorials, complete the first
tutorial, Routing a loan application, to become familiar with Oracle Service Bus, then
proceed to the other tutorials in any order. The tutorials include:
3 Getting Started with the Oracle Service Bus Tutorials describes the task to
complete before starting the tutorials.
4 Tutorial 1. Routing a Loan Application is based on scenarios that
demonstrate how Oracle Service Bus facilitates the routing of messages
within an enterprise.
5 Tutorial 2. Transforming a Loan Application describes how a proxy service is
configured with a routing node, transformations, and a Web service callout
(Service Callout) to allow content-based routing and message enrichment
through Oracle Service Bus.
6 Tutorial 3. Validating a Loan Application describes how a Oracle Service Bus
proxy service can be configured to validate a message passing from a client
to a business service.
10
Oracle Service Bus Examples and Tutorials
After completing this section, you will know how to deploy a typical Oracle Service
Bus environment in which you can define resources and design Web services. You
must complete all the tasks in this section before you start the tutorials.
In the first tutorial, you will become familiar with the basic functionality of Oracle
Service Bus that facilitates Web service mediation, including message routing and
Web service resource creation. In subsequent tutorials you will develop and
customize Web services for routing, transforming and validating a loan application.
11
Oracle Service Bus Examples and Tutorials
The files (including pre-built business services) that support the building of the
tutorial solutions are located in the following directory:
OSB_ORACLE_HOME\samples\servicebus\examples
Note: Oracle Service Bus version 11.1.1.3 does not include the example source
files. To complete the tutorials, you must download the required files. For download
information, see “Before You Begin” in 2 Introduction to the Oracle Service Bus
Tutorials.
The tutorial files contain properties that you must set to run the tutorials. In the
tutorial, you can use four different business services. Each business service also has
a set of files associated with it. The structure for each of the business services is the
same.
The directory structure for one of the business services–the NormalLoan business
service, is described in Table 3-1 and Table 3-2. You can explore the other
directories as an exercise.
Filename/Location Description
/src/setEnv.cmd/.sh This file sets the environment properties.
/src/examples.properties This file contains business service build and deployment
properties.
Table 3-2 Sample Files Provided for Business Services the Tutorials
Filename/Location Description
OSB_ORACLE_HOME\ The files contained in this directory are those required
samples\servicebus\ by the normalLoan business service. The same file
examples\src\examples\ structure exists for the other three business services
webservices\jws_basic\ used in this tutorial (ManagerLoanReview,
normal LoanSaleProcessor, and CreditRating).
SimpleBean.java The jws-181 Web service definition.
/client/LoanStruct.java The definition of the message.
build.xml The build script that is used to build each of the
services using ant.
12
Oracle Service Bus Examples and Tutorials
Filename/Location Description
*.wsdl A Web service Definition Language (WSDL) file defines
each of the services.
/client/Main.java The Java client with which
each of the business
services interacts.
Note:
The example and tutorials are based on using an Admin-only domain. If
the tutorial domain you create includes managed servers, you may need
to change the port numbers in the services you create to the correct
managed server ports.
creditLoan_jws_basic_ejb
largeLoan_jws_basic_ejb
13
Oracle Service Bus Examples and Tutorials
manager_jws_basic_ejb
normalLoan_jws_basic_ejb
3. Click Install.
14
Oracle Service Bus Examples and Tutorials
4. Navigate to
OSB_ORACLE_HOME\samples\servicebus\examples\build\webservices.
6. Accept the remaining defaults by clicking Next, then click Finish. The
application is deployed automatically.
http://localhost:7001/sbconsole
Log in if necessary with Oracle Service Bus Console the user name and password
that you specified when you created the domain.
Tutorial 1. Routing a Loan Application which describes how you can configure Oracle
Service Bus with the resources required for the loan application routing scenario.
Each of the tutorials include instructions to design and configure the Oracle Service
Bus resources, and procedures you can use to test the completed configurations.
15
Oracle Service Bus Examples and Tutorials
Prerequisites
Tutorial Objectives
Definition of the Scenario
Tasks in This Tutorial
Prerequisites
You must complete 3 Getting Started with the Oracle Service Bus Tutorials before
1
Tutorial Objectives
The objective of this tutorial is to create and test a routing scenario using the
graphical environment provided in Oracle Service Bus Console. It includes the
following tasks:
16
Oracle Service Bus Examples and Tutorials
Figure 4-1 summarizes the logical architecture to support this scenario. It illustrates
how Oracle Service Bus mediates the messaging between the clients and the
business services in your enterprise.
Figure 4-1 Expose a Loan Application Request Web Service via Oracle
Service Bus
Note:
If the loan application is processed by the NormalLoan business service,
MANAGER is replaced with NORMAL in the generated response.
17
Oracle Service Bus Examples and Tutorials
Required Resources
The following table lists the resources required to develop and run this tutorial.
Tutorials.
The Change Center in the console allows you to create and manage sessions. All
updates to the system configuration during the current session are saved as
temporary files. These changes effective only when the current session is activated.
Figure 4-2 illustrates the Change Center pane available on Oracle Service Bus
Console.
18
Oracle Service Bus Examples and Tutorials
In addition to creating and activating sessions, the Change Center allows you to
perform the functions summarized in the following table.
Click To
Create Create a new session. You must create a session to make changes to the
configuration. You can exit this session using the Exit function, then re-
enter it by clicking Edit. Once in the session, you can continue to modify
the resources.
Edit Enter a session that you previously created and exited. You must activate a
session before you can use Edit.
Exit Discontinue the session and save the session state. Click Edit to re-enter
the discontinued session.
Discard End the current session without saving the changes.
Activate Save the current session's configuration to the run time.
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.
Note:
It is recommended that you click Create before modifying any system
configuration settings on the console. It is a good practice to save your
configuration changes incrementally and enter comments for those
changes. To save and activate configuration changes in the current
session, you must click Activate after you have completed making a set
of changes.
19
Oracle Service Bus Examples and Tutorials
There are pre-defined resources types in the Oracle Service Bus system
environment. Each resource type is represented as a sub folder within the Project
folder. You can create and configure resources of different types within the resource
type folders.
This section describes the tasks to start a session and create a MortgageBroker
project under the Projects folder. For this scenario, you will create three resource
folders in the MortgageBroker project to hold each of the following pre-defined
resource types:
ProxyService
BusinessService
WSDL
1. In the Oracle Service Bus Console Change Center click Create to create a
new session.
2. In the Oracle Service Bus Console navigation pane, select the Project
Explorer.
The project explorer opens in the navigation pane and a Project page is
displayed on the console.
3. In the Enter New Project Name field in the Projects section, type
MortgageBroker as shown in Figure 4-3.
20
Oracle Service Bus Examples and Tutorials
The MortgageBroker 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.
2. On the Project page, in Folders, enter the folder name in the field provided.
In this case, enter WSDL as displayed in Figure 4-4.
The WSDL folder is displayed in the list of project folders for the
MortgageBroker project.
5. When all three folders are created, click Activate, enter a description of the
changes you just made, and click Submit to save the project directory
structure.
21
Oracle Service Bus Examples and Tutorials
To Import a WSDL
1. In the Oracle Service Bus Console Change Center click Create to create a
new session.
2. In Oracle Service Bus Console navigation pane, select the Project Explorer.
4. In the Resources pane, from the Select Resource Type list, select WSDL.
22
Oracle Service Bus Examples and Tutorials
5. Enter the following information in the Create a New WSDL Resource page
(see Figure 4-6):
a. Enter normalLoan as the resource name.
b. Click Browse. Select the WSDL associated with the normal loan
process:
OSB_ORACLE_HOME\samples\servicebus\examples\src\examples\web
services\jws_basic\normal\NormalLoanApprovalService.wsdl
Note: In Oracle Service Bus 11.1.1.3, get the WSDL from the location
where you extracted the downloaded resources as described in “Before
You Begin” in 2 Introduction to the Oracle Service Bus Tutorials.
This step completes the creation of the normalLoan WSDL resource in the WSDL
folder. Activate the session.
23
Oracle Service Bus Examples and Tutorials
parameters listed in the following table to create the resource in the project’s /WSDL
folder.
Configuration
Parameter Value
WSDL Resource Name managerApproval
ManagerApprovalService OSB_ORACLE_HOME\samples\servicebus\examples\src\examples\we
WSDL bservices\jws_basic\manager\ManagerApprovalService.wsdl
Note: In Oracle Service Bus 11.1.1.3, get the WSDL from the location
where you extracted the downloaded resources as described in
“Before You Begin” in 2 Introduction to the Oracle Service Bus
Tutorials.
1. In the Oracle Service Bus Console Change Center click Create to create a
new session.
24
Oracle Service Bus Examples and Tutorials
The Select a WSDL page is displayed. The proxy service is based on the
WSDL resource that you originally created, hence you must reference the
resource here.
25
Oracle Service Bus Examples and Tutorials
8. In Select WSDL Definitions pane, from the Ports category, Click helloPort,
which is the WSDL port for the normalLoan WSDL (helloPort).
9. Click Submit. The port name is displayed in the WSDL port text field as
shown in Figure 4-9.
26
Oracle Service Bus Examples and Tutorials
Note:
The protocol you select on this page determines the format for the
endpoint URI that you will specify in the next step. The assumed default
protocol is http since it is used by most services.
12. Set the Endpoint URI to /loan/gateway1. This is the URI to which the
client will send its messages.
13. Accept the default for the Get All Headers option (No), and click Next. The
Create a Proxy Service-HTTP Transport Configuration page is displayed.
15. On the Operation Selection Configuration page, accept the default selection
algorithm (SOAP Body Type). Click Next.
27
Oracle Service Bus Examples and Tutorials
17. The Create a Proxy Service – Summary page is displayed. This page shows a
summary of configuration settings for the proxy service.
Note:
The default service is an RPC Web service. As a result, the SOAP body
contains the service operation selection information. An operation in a
Java Web service WSDL corresponds to a public method in the Java Web
service. If there are multiple public methods accessible to a client, each
public method type will have an operation definition in the WSDL. For a
SOAP based RPC service, the SOAP body indicates the operation
(method) selected by the client. The SOAP header can also specify the
operation. However, by convention, the SOAP body defines this.
Before registering the proxy service, you can review the configuration
settings and change them if necessary, by clicking Edit icon.
18. After reviewing the proxy service configuration settings, click Save to register
the service.
The Operational Settings tab, as shown in Figure 4-11, has options to enable
monitoring for the proxy service.
28
Oracle Service Bus Examples and Tutorials
To enable monitoring:
2. Select the Enable Pipeline Monitoring check box for the Monitoring
setting.
29
Oracle Service Bus Examples and Tutorials
4. Click Update.
This step completes the configuration of the LoanGateway1 proxy service in Oracle
Service Bus Console.
1. In the Oracle Service Bus Console Change Center click Create to create a
new session.
30
Oracle Service Bus Examples and Tutorials
5. For Service Type, select WSDL Web Service, then click Browse. Select the
WSDL and port on which to base the business service:
a. In the WSDL Browser, select the normalLoan WSDL
b. Select the port (helloPort) for the WSDL.
c. Click Submit.
The text field for the WSDL port service type is populated with the value
selected on the Create a Business Service - General Configuration page.
6. Click Next.
31
Oracle Service Bus Examples and Tutorials
8. Select none for the Load Balancing Algorithm, since load balancing is
relevant only when a service specifies multiple end points.
When you specify multiple end points and a load balancing algorithm, if one
end point is overloaded or not available at run time, the message can be sent
to the next service in the list of end point URIs. In this case, there is only one
service, therefore accepting the default behavior or selecting none does not
affect the behavior of the proxy service at run time.
9. The End Point URI of the business service is the endpoint URI on the server
on which the service is deployed. Ensure that the pre-populated value for the
End point URI in the “Existing URIs” field is
http://<host:port>/njws_basic_ejb/NormalSimpleBean.
The host and port values specified for <host:port> represent the machine
and port on which your Oracle Service Bus server is running.
Note:
Delete any invalid endpoint URI in the existing URI list.
10. Accept the default settings for the remaining options on the page and click
Next.
32
Oracle Service Bus Examples and Tutorials
To enable monitoring:
You have completed the configuration of the NormalLoan business service on Oracle
Service Bus Console.
Follow the same tasks as described in the previous section on creating the
ManagerLoanReview business service, but use the configuration parameters in the
following table.
33
Oracle Service Bus Examples and Tutorials
Configuration
Parameter Value
Business Service Name ManagerLoanReview
ManagerApprovalService managerApproval
WSDL
helloPort
Load Balancing Algorithm none
Endpoint URI http://<host:port>/mjws_basic_ejb/ManagerSimpleBean (this
should already be populated in the “Existing URIs” field.)
Summary
You have created two business services (NormalLoan and ManagerLoanReview), a
proxy service (LoanGateway1) and two WSDL resources (normalLoan and
ManagerApprovalService) that are the resources required for this tutorial.
Once you have configured the proxy service with a base configuration you can
proceed to the next task (Configure the LoanGateway1 Proxy Service) to complete
the configuration of the proxy service by adding the routing behavior for the loan
application in the proxy service message flow.
1. In the Oracle Service Bus Console Change Center click Create to create a
new session.
3. In the Actions column associated with the LoanGateway1 proxy service, click
the Edit Message Flow icon . The Edit Message Flow page for the proxy
service LoanGateway1 is displayed as shown in Figure 4-14.
34
Oracle Service Bus Examples and Tutorials
4. Click LoanGateway1, and select Add Route from the menu options.
5. Click RouteNode1 and select Edit Route from the menu options.
Note:
A stage is an element of a pipeline and also a container for actions
defined in a pipeline. Actions are the elements of a pipeline stage that
define the handling of messages as they flow through a proxy service at
run time.
35
Oracle Service Bus Examples and Tutorials
6. Click the Add an Action link, and select Communication > Routing
Table.
You must configure the routing table to route messages to business services
based on the value of the interest rate element in the incoming message. You
can configure content-based routing by creating an XQuery expression, using
the XQuery Expression Editor.
9. The Variable Structures pane is displayed. Select body from the Select
Structure list.
36
Oracle Service Bus Examples and Tutorials
11. Click the Rate element. The property appears below the XQuery editor in the
Property Inspector field. Click in the XQuery text box and click Copy
Property in the lower right of the XQuery Expression text box. The following
XQuery expression is written in the text box:
37
Oracle Service Bus Examples and Tutorials
$body/exam:processLoanApp/loanRequest/java:Rate
Note:
In Internet Explorer (IE) browsers, you can simply drag the icon next to
the Rate element into the XQuery text editor.
12. Click Validate to validate the XQuery. It is a good practice to do this before
you submit the expression. The expression is validated for syntax. If there are
errors in the expression, they are displayed directly above the Validate
button.
13. Click Save. The routing table is displayed on the Edit Stage Configuration
page. <Expression> is replaced by the expression that returns the value of
the Rate element in the message.
14. In the Operator list, select <. In the associated text field enter the number 5.
38
Oracle Service Bus Examples and Tutorials
The routing table now contains an expression that determines the routing
behavior. If the value in the rate element is less than 5, you must route
according to the routing table configuration.
15. Click the Service link to define the service to which you want to route
messages when the rate is less than five. The Select Service page is
displayed.
a. Select the ManagerLoanReview business service.
b. Click Submit.
16. In the Routing Table Operation list, select the processLoanApp operation.
This is the operation on the ManagerLoanReview business service that is
invoked at run-time if the rate requested in the loan application is less than 5.
You have now defined the case to route the loan application to the
ManagerLoanReview business service. If the rate specified in the loan application is
equal to or greater than five percent, then the message is routed to the NormalLoan
business service. The next section describes how you can add a condition to the
routing table to account for this case (which is the default case).
1. Click the Case icon (below the Routing Table label), then select Insert
Default Case. The else condition (default case) is added to the routing
table.
39
Oracle Service Bus Examples and Tutorials
2. In the Default (else) condition, click the Service link. The Select Service page
is displayed.
a. Select the NormalLoan business service.
b. Click Submit.
3. In the Operation list, select the processLoanApp operation for the service.
This step completes the configuration of the message flow in the route node:
RouteNode1.
5. Click Save on the Edit Stage Configuration page to save the configuration
and return to the Edit Message Flow page.
40
Oracle Service Bus Examples and Tutorials
6. Click Save on the Edit Message Flow page and return to the
MortgageBroker/ProxyServices page.
Summary
Configure the LoanGateway1 Proxy Service completes the configuration of the run-
time message routing behavior in the LoanGateway1 Routing Table. A message is
routed to the ManagerLoanReview business service if the rate specified in the loan
application is less than 5. Otherwise the message is routed to the NormalLoan
business service.
1. In Oracle Service Bus Console, make sure the current session is activated.
41
Oracle Service Bus Examples and Tutorials
4. Replace the default payload in loanRequest field with the following code:
42
Oracle Service Bus Examples and Tutorials
<loanRequest xmlns:java="java:normal.client">
<!--Optional:-->
<java:Name>Smith</java:Name>
<!--Optional:-->
<java:SSN>1234567</java:SSN>
<!--Optional:-->
<java:Rate>4.1</java:Rate>
<!--Optional:-->
<java:Amount>9000000</java:Amount>
<!--Optional:-->
<java:NumOfYear>10</java:NumOfYear>
<!--Optional:-->
<java:Notes>Manager Loan Application Review
Service</java:Notes>
</loanRequest>
5. Accept other default settings and click Execute. The response as in Figure 4-
30 is obtained.
The Invocation Trace section of the test console indicates that the proxy
service routed the request to ManagerLoanReview business service because
the interest rate requested is 4.1 (less than 5).
43
Oracle Service Bus Examples and Tutorials
4. Replace the default payload in loanRequest field with the following code:
<loanRequest xmlns:java="java:normal.client">
<!--Optional:-->
<java:Name>Smith</java:Name>
<!--Optional:-->
<java:SSN>1234567</java:SSN>
<!--Optional:-->
<java:Rate>5.3</java:Rate>
<!--Optional:-->
<java:Amount>9000000</java:Amount>
<!--Optional:-->
<java:NumOfYear>10</java:NumOfYear>
<!--Optional:-->
<java:Notes>Manager Loan</java:Notes>
</loanRequest>
Accept other default settings and click Execute. The response as in Figure 4-31 is
obtained.
44
Oracle Service Bus Examples and Tutorials
The Invocation Trace section of the test console indicates that the proxy service
routed the request to NormalLoan business service because the interest rate
requested is 5.3 (greater than 5).
45
Oracle Service Bus Examples and Tutorials
Prerequisites
Tutorial Objectives
Definition of the Scenario
Prerequisites
You must complete 4 Tutorial 1. Routing a Loan Application before beginning this
1
tutorial.
Tutorial Objectives
This tutorial provides the tasks to create and test a routing and transformation
scenario developed using the graphical environment provided in Oracle Service Bus
Console. Using the Oracle Service Bus Console you will build on what you learned in
4 Tutorial 1. Routing a Loan Application to perform the following tasks:
1
The credit rating information is added to the loan application. The application is then
forwarded to the secondary mortgage company Web service to be processed. Loan
applications with a principal request equal to or less than US $25 million are routed
46
Oracle Service Bus Examples and Tutorials
to a different business service for processing. The target business services respond
indicating whether the loan application is approved or rejected.
Figure 5-1 illustrates where Oracle Service Bus fits in your enterprise to mediate the
messaging between the enterprise services and the business services.
Figure 5-1 Expose a Loan Application Processing Web Service via Oracle
Service Bus
When the loan amount is more than US $25 million, the request pipeline makes a
service callout to the CreditRating business service and receives the credit rating of
the applicant using the $creditRating variable. To fulfill the interface requirements of
the secondary loan company service, the message body is transformed by adding
the credit rating details. The transformed message ($body) is routed to a business
service that handles applications for large loan amounts. The service returns a
response similar to the following:
47
Oracle Service Bus Examples and Tutorials
Required Resources
You will use the MortgageBroker project folder and the directory structure you
created in the previous tutorial to hold the project artifacts. The resources required
for this scenario are described in the following table.
Loan Application.
Create a Session
For this tutorial, you need to use the MortgageBroker project folder, and the
directory structure that you created in 4 Tutorial 1. Routing a Loan Application to
1
48
Oracle Service Bus Examples and Tutorials
1. In the Oracle Service Bus Console Change Center click Create to create a
new session.
2. In the Oracle Service Bus Console navigation pane, select the Project
Explorer.
The project explorer pane is opened in the navigation pane and a project
page is displayed in the console.
WSDL Resource section in 4 Tutorial 1. Routing a Loan Application. However, for this
1
instance, name your resources and base them on the WSDLs listed in the following
table.
Resource
Name Location of the WSDL
loanSale OSB_ORACLE_HOME\samples\servicebus\examples\src\examples\webservices\jws_basic
\large\LargeLoanPurchasingService.wsdl
creditRating OSB_ORACLE_HOME\samples\servicebus\examples\src\examples\webservices\jws_basic
\credit\CreditLoanApprovalService.wsdl
Note: In Oracle Service Bus 11.1.1.3, get the WSDLs from the location where you
extracted the downloaded resources as described in “Before You Begin” in 2
Introduction to the Oracle Service Bus Tutorials.
When you complete this task, the MortgageBroker/WSDL folder contains the WSDL
resources created in this tutorial and in 4 Tutorial 1. Routing a Loan Application as
1
49
Oracle Service Bus Examples and Tutorials
Note:
No units are assigned to the loan amount, but units can be any currency
such as US dollars.
Proxy Service
Name LoanGateway2
Service Type Select the WSDL Web Service (port or binding) option.
50
Oracle Service Bus Examples and Tutorials
After you complete this task, a summary of the configuration settings for the proxy
service is displayed.
When you complete this task, the MortgageBroker/ProxyService folder contains the
proxy services that you created in this tutorial and in 4 Tutorial 1. Routing a Loan
1
configure your services using the names, service types, and endpoint URIs listed in
the following two tables.
51
Oracle Service Bus Examples and Tutorials
Business
Service
Name LoanSaleProcessor
Service Select the WSDL Web Service as the Service Type option.
Type
Select the loanSale WSDL in the Select a WSDL page.
Business
Service
Name CreditRating
Service Select the WSDL Web Service as the Service Type option.
Type
Select the creditRating WSDL in the Select a WSDL page.
52
Oracle Service Bus Examples and Tutorials
Summary
Upon completing all the tasks from Prepare the Environment to Create the
Resources you have created the resources required for this scenario. You have also
configured the proxy service with a base configuration. In the following three tasks
you will configure the proxy service by adding the routing, transformation, and
Service Callout behavior for the loan application messages.
The Resource Browser pane is opened in the navigation pane and the
Summary of Proxy Services page is displayed in the console.
2. In the Actions column associated with the LoanGateway2 proxy service, click
the Edit Message Flow icon.
3. Click LoanGateway2, then select Add Route from the menu. In the
configuration dialog, RouteNode1 is added.
53
Oracle Service Bus Examples and Tutorials
4. Click RouteNode1 and select Edit Route from the menu. The Edit Stage
Configuration page is displayed and contains a single link, Add an Action.
5. Click Add an Action, then select Communication > Routing Table from
the menu.
The Edit Stage Configuration page changes to display the routing table
configuration information.
54
Oracle Service Bus Examples and Tutorials
To configure the routing table to route messages to business services based on the
amount element of the incoming message, you must create an XQuery expression
using the XQuery Expression Editor.
1. In the Routing Table, click the <Expression> link. The XQuery Expression
Editor is displayed.
3. Select body from the Select Structure list in the Variable Structures pane.
5. Click the Amount element. The property appears below the XQuery editor in
the Property Inspector field. Click in the XQuery text box and click Copy
Property in the lower right of the XQuery Expression text box. The following
XQuery expression is written in the text box:
$body/exam:processLoanApp/loanRequest/java:Amount
Note:
In Internet Explorer (IE) browsers, you can simply drag the icon next to
the Rate element into the XQuery text editor.
7. Click Save.
8. In the Operator list, select > and in the associated text field, enter the
number 25000000 (twenty-five million, without commas).
55
Oracle Service Bus Examples and Tutorials
The routing table now contains an expression that determines the routing
behavior. If the value in the Amount field is greater than US $25 million, then
messages are routed according to the routing table configuration.
9. Click the Service link to define the service to which you want to route when
the amount is greater than US $25. Select LoanSaleProcessor, and click
Submit.
You have now defined the case for routing the loan application to the
LoanSaleProcessor business service as shown in Figure 5-8.
When a loan application with a loan amount greater than US $25 million is
identified, a Web service callout (Service Callout) is performed to retrieve the
customer's credit rating. The credit rating information is added to the loan
application. The application is then forwarded to the secondary mortgage company's
business service to be processed.
56
Oracle Service Bus Examples and Tutorials
You must delete the "xsi:type" attribute from the message by adding and
configuring a Delete action as follows:
1. In the Routing Table “Request Actions” pane, select Add an Action >
Message Processing > Delete.
The Delete action is added to the Routing Table Request Action pipeline.
./exam:processLoanApp/loanRequest/@xsi:type
b. Click Validate, then Save. You will return to the Edit Stage
Configuration page.
Delete ./exam:processLoanApp/loanRequest/@xsi:type in
variable body as shown in Figure 5-9.
57
Oracle Service Bus Examples and Tutorials
1. In the Request Actions pane of the Routing Table, click the Delete icon to
bring up the menu, then select Add an Action > Message Processing >
Assign.
The Assign action is added to the Request Action pipeline in the Routing
Table.
3. Navigate to the Variables Structures pane. Select body from the Variables
Structures list.
4. Expand the request element list and copy the loanRequest element into the
XQuery expression text box. The following XQuery expression is written in the
text box:
$body/exam:processLoanApp/loanRequest
5. Click Validate to validate the XQuery, then Save. The routing table is
displayed on the Edit Stage Configuration page. <Expression> is now
replaced by the expression that returns the content of the message to be
sent to the Service Callout service.
58
Oracle Service Bus Examples and Tutorials
This task completes the assignment of value returned by the XQuery expression
($body/exam:processLoanApp/loanRequest) to the loanRequestVariable
variable.
Rename the Namespace of the Input Parameter you Assigned for the
Service Callout
1. In the Request Actions pane of the Routing Table, click the Assign icon to
bring up the menu, then Add an Action > Message Processing >
Rename. The Rename action configuration fields are added to the Request
Actions pane.
2. In the Rename statement, click the <XPath> link. The XPath Expression
Editor is displayed.
3. In the XPath Expression text box, enter the following XPath expression:
.//java:*
4. Click Validate and Save to save the XPath expression and return to the Edit
Stage Configuration page.
You have completed creating a condition in which the XPath expression finds
all the namespaces with the java prefix in the loanRequestVariable context
59
Oracle Service Bus Examples and Tutorials
variable. The next task specifies the namespace to replace the namespaces
identified by the XPath expression.
6. Select the namespace option and enter the following fully qualified new
namespace to be substituted in the message: java:credit.client.
Note:
The default namespace that you are replacing in this case is
java:normal.client.
60
Oracle Service Bus Examples and Tutorials
1. In the Request Actions pane of the Routing Table, click the Rename icon,
then Add an Action > Communication > Service Callout.
The Service Callout action is added to the Request Action pipeline in the
Routing Table.
2. Click the Service Callout to <Service> link. The Select Service page is
displayed.
a. In the Select Service page, select CreditRating.
b. Click Submit.
3. From the Operation list, select processLoanApp. The fields that allow you to
configure the request and response parameters for the service callout are
displayed as shown in Figure 5-12.
61
Oracle Service Bus Examples and Tutorials
This task completes the service callout configuration to invoke the creditRating Web
service. The credit rating returned by this Web service is assigned to the
$creditRating context variable.
Rename the namespace for the message to the namespace required by the
target service using XPath expressions, described in this section.
Insert an new element into the message by adding an element action in the
configuration, described in this section.
1. Click the Service Callout icon to bring up the menu, and select Add an
Action > Message Processing > Rename. The Rename action
configuration fields are added to the Request Actions pane.
2. In the Rename statement, click the <XPath> link. The XPath Expression
Editor is displayed.
3. In the XPath Expression text box, enter the following XPath expression:
.//java:*
4. Click Validate and Save to save the XPath expression and return to the Edit
Stage Configuration page.
62
Oracle Service Bus Examples and Tutorials
5. In the variable text box, enter body. The body context variable contains the
body of the message.
You have completed creating a condition in which the XPath expression finds
all the namespaces with the java prefix in the body context variable. The next
task specifies the namespace to replace the namespaces identified by the
XPath expression.
6. Select the namespace option and enter the fully qualified new namespace to
be substituted in the message. The new namespace you must enter is
java:large.client.
Note:
The default namespace that you are replacing in this case is
java:normal.client.
1. Click the Rename icon to bring up the menu, and select Add an Action >
Message Processing > Insert.
The Insert action configuration fields are added to the Request Actions pane.
63
Oracle Service Bus Examples and Tutorials
d. Click Add.
4. In the XQuery Expression text box, enter the following expression to specify
how the new element is constructed:
<lg:CreditRating>{data($creditRating)}
</lg:CreditRating>
where:
o lg: is the namespace of the element that you add to the message that
should be associated with the java:large.client namespace.
o {} indicates to the XQuery engine that the content between the {} is
not XML and must be interpreted.
At run time, the $creditRating variable is assigned a credit rating value by the
CreditRating business service. (This is the business service to which we
configured a Service Callout action in section Add a Service Callout Action).
64
Oracle Service Bus Examples and Tutorials
./exam:processLoanApp/loanRequest/java:Notes
8. In this statement, replace the namespace java with the namespace lg.
./exam:processLoanApp/loanRequest/lg:Notes
9. Click Validate, then Save to return to the Edit Stage Configuration page.
10. Enter body in the variable text field (the last field in the expression). This is
the context variable into which the new <CreditRating> element is inserted at
run time.
This task completes the configuration of the outbound message. You have added a
credit rating element to the message and changed the message namespace so that
the message complies with the public contract (interface) of the target service.
The next task describes how you can configure the response actions for the
LoanGateway2 proxy service.
65
Oracle Service Bus Examples and Tutorials
complies with the client's public contract (WSDL). You can configure the proxy
service to:
Delete an Element
1. Ensure that the Edit Stage Configuration page for the routing table that you
created and configured in the preceding tasks is open in the Oracle Service
Bus Console. (Click RouteNode1 > Edit Route in the proxy service's Edit
Message Flow page).
2. In the routing table Response Actions pane, select Add an Action >
Message Processing > Delete.
The Delete action configuration fields are added to the Routing Table
Response Actions.
3. Select the <XPath> option. The XPath Expression Editor page is displayed.
a. In the XPath Expression text box, enter the following expression:
./exam:processLoanAppResponse/return/lg:CreditRa
ting
4. Enter body in the variable text field of the <XPath> in variable option in the
Delete action.
66
Oracle Service Bus Examples and Tutorials
You have configured Oracle Service Bus to remove the <CreditRating> element
from the response message, when the message is processed in the response
pipeline.
This section describes how you can rename the namespace to the namespace that
the client requires, that is java:normal.client.
Note:
Recall that you configured the request message to the LoanSaleProcessor
business service to change the namespace to that required by that
service. (See Configure Message Transformation).
1. Click the Delete icon to bring up the menu, then Add an Action >
Message Processing > Rename.
The Rename action configuration fields are added to the Response Actions
pipeline.
.//lg:*
67
Oracle Service Bus Examples and Tutorials
4. Select the namespace option, and in the text field associated with the
namespace, enter java:normal.client.
When these tasks are completed, you have specified that Oracle Service Bus
replaces all namespaces with the prefix lg: in the response message with
java:normal.client as shown in Figure 5-19.
The last task in the configuration of the routing table for the LoanGateway2 proxy
service is to add a default routing case (an else condition) to the case expression.
1. Click the Case icon at the top of the Routing Table, then select Insert
Default Case.
2. Click <Service> in the default case to display the Select Services page.
a. Select the NormalLoan business service.
b. Click Submit.
68
Oracle Service Bus Examples and Tutorials
4. Click Save to save the route node configuration and return to the Edit
Message Flow page for the LoanGateway2 proxy service.
5. Click Save.
3. Click the Launch Test Console icon in Actions column for LoanGateway2 to
launch the test console (see Figure 4-2).
4. Replace the default payload in the loanRequest field with the following code:
69
Oracle Service Bus Examples and Tutorials
<loanRequest xmlns:java="java:normal.client">
<!--Optional:-->
<java:Name>Smith</java:Name>
<!--Optional:-->
<java:SSN>1234567</java:SSN>
<!--Optional:-->
<java:Rate>5</java:Rate>
<!--Optional:-->
<java:Amount>900000000</java:Amount>
<!--Optional:-->
<java:NumOfYear>10</java:NumOfYear>
<!--Optional:-->
<java:Notes>Large Loan Processing</java:Notes>
</loanRequest>
Accept other default settings and click Execute. The response as in Figure 5-22.
The Invocation Trace indicates that the proxy service LoanGateway2 routes the
application to LoanSaleProcessor because the amount of the loan requested is
greater than US $25 million.
70
Oracle Service Bus Examples and Tutorials
4. Replace the default payload in loanRequest field with the following code:
<loanRequest xmlns:java="java:normal.client">
<!--Optional:-->
<java:Name>Smith</java:Name>
<!--Optional:-->
<java:SSN>1234567</java:SSN>
<!--Optional:-->
<java:Rate>5</java:Rate>
<!--Optional:-->
<java:Amount>2000000</java:Amount>
<!--Optional:-->
<java:NumOfYear>10</java:NumOfYear>
<!--Optional:-->
<java:Notes>Normal Loan</java:Notes>
</loanRequest>
Accept other default settings and click Execute. The response as in Figure 5-23.
71
Oracle Service Bus Examples and Tutorials
The Invocation Trace indicates that the proxy service LoanGateway2 routes the
application to NormalLoan business service because the amount of the loan
requested was less than US $25 million.
Best Practices
In this tutorial, you configured the transformation and replaced the namespaces in
the Route node. Alternatively, it is possible to configure the same logic in the
request pipeline in a pipeline pair. The work you must do to accomplish the
transformation and namespace replacement is the same regardless of the model
that you choose.
In the case of the tutorial scenario, it is easier to add the actions to the request and
response actions of the existing route node rather than create a separate pipeline
pair, add a stage, and then add the transformation actions to that stage.
72
Oracle Service Bus Examples and Tutorials
A route node routes messages to five different services. Each service requires the
same transformation. In this scenario, it is a good practice to add a single
transformation to a request pipeline rather than configure five identical sets of
transformations for each routing configuration of every route node. The run-time
execution cost is the same, but the cost of maintaining, configuring, and
understanding the latter implementation is higher and requires greater effort.
73
Oracle Service Bus Examples and Tutorials
Prerequisites
Tutorial Objectives
Definition of the Scenario
Tasks in This Tutorial
Prerequisites
You must complete 4 Tutorial 1. Routing a Loan Application and 5 Tutorial 2.
1
Tutorial Objectives
The objective of this tutorial is to provide tasks to configure Oracle Service Bus
resources that implement message validation and error handling, in Oracle Service
Bus Console. This tutorial includes the following:
Features Highlighted
This tutorial exposes you to the following features of Oracle Service Bus:
74
Oracle Service Bus Examples and Tutorials
Figure 6-1 summarizes the logical architecture to support this scenario and
illustrates how Oracle Service Bus is positioned in the enterprise system environment
to mediate the messaging between the client and the business services.
75
Oracle Service Bus Examples and Tutorials
The error is trapped by a stage error handler which replaces the body context
variable <Notes> field value with the text of the $fault <reason> element. A Report
action then saves the error code and the message body, for later viewing and
searching in the console. The Reply action returns the body context variable to the
client.
Returned by the response pipeline to the client along with the validation error
message
or
Required Resources
Use the MortgageBroker project folder and the directory structure that you created
in the previous tutorial to hold the project artifacts. The resources required for this
scenario are described in the following table.
You will create a proxy service, LoanGateway3, and configure it to route a message
to the NormalLoan business service. You will configure the behavior of the proxy
service by performing the following tasks:
76
Oracle Service Bus Examples and Tutorials
Creating a proxy service and edit the request pipeline to include a validate
action
Using the context variable, $fault, to hold the error
Trapping the error using a stage error handler to write the context variable
element $fault<reason> to the value of the body context variable <Notes>
field.
Application.
Create a Session
For this tutorial, use the MortgageBroker project folder and the directory structure
you created in 4 Tutorial 1. Routing a Loan Application to hold the project artifacts.
1
2. In the Oracle Service Bus Console navigation pane, select the Project
Explorer.
The Project Explorer pane is opened in the navigation pane and a project
page is displayed in the console.
77
Oracle Service Bus Examples and Tutorials
service name and the endpoint URI specified in the following table.
While configuring the proxy service, accept the default settings for the remaining
pages. When the Create a Proxy Service - Summary page is displayed, review the
summary of configuration settings before to registering the proxy service, and click
Save.
When you complete this task, the MortgageBroker/ProxyService folder must contain
the following proxy services you created in this tutorial and the previous tutorials:
LoanGateway1
LoanGateway2
LoanGateway3
Request and response pipelines for the operations on the proxy service
Error handler pipelines defined for stages, pipelines, and proxy services
Each pipeline can include one or more stages, which in turn include actions.
To configure the behavior of the LoanGateway3 proxy service, you must complete
the following tasks.
78
Oracle Service Bus Examples and Tutorials
3. In the Actions column associated with the LoanGateway3 proxy service, click
the Edit Message Flow icon.
The Edit Message Flow page for the proxy service LoanGateway3 is displayed.
The PipelinePairNode1 is created and placed in the message flow. Request and
response pipelines are displayed for this node as shown in Figure 6-2.
3. Enter validate loan application in the Name field and click Save.
1. To edit the stage, click validate loan application, then select Edit Stage.
The Edit Stage Configuration page is displayed.
2. Click the Add an Action link, then select Message Processing > Validate
from the list. The Validate action is added to the stage.
79
Oracle Service Bus Examples and Tutorials
3. In the Validate statement, click the <XPath> link to edit the XPath
expression. The XPath Expression Editor is displayed.
5. In the Variables Structure pane, from the Select Structure list, select body.
7. Copy the loanRequest element into the XQuery Expression text box.
./exam:processLoanApp/loanRequest
80
Oracle Service Bus Examples and Tutorials
The Edit Stage Configuration page displays <XPath> which is replaced by the
XQuery expression.
10. Click <Resource> and select WSDL from the list. The Select a WSDL page
is displayed.
You must validate the message against the resource since the proxy service is
based on the WSDL resource that you originally created.
11. In the Select a WSDL page, select the normalLoan WSDL resource.
The Select WSDL Definitions pane is populated with the content categories of
the WSDL.
a. In the Select WSDL Definitions pane, from the Types category, select
the WSDL type for this WSDL as loanStruct.
b. Click Submit to complete the selection.
12. Select the Raise Error on validation failure option. The Validate action will
be displayed as shown in Figure 6-5.
Note:
Message validation must be done as early as possible in a message flow.
This prevents unnecessary processing of invalid message content. By
raising an exception, further message processing is stopped and an error
response is immediately returned to the client.
81
Oracle Service Bus Examples and Tutorials
1. Click the validate loan application stage, then select Add Stage Error
Handler. The Edit Error Handler page is displayed.
2. Click Error Handler, then select Add Stage. The stage1 node is displayed.
82
Oracle Service Bus Examples and Tutorials
4. Click Validate and Save to save the expression and return to the Edit Stage
Configuration page.
1. To add a Replace, click Add an Action in the “then” section, and select
Message Processing > Replace within the then . . . portion of the If . . .
Then action.
83
Oracle Service Bus Examples and Tutorials
Note:
When adding multiple actions on a page, click the action preceding the
placement of the new action and select the action to be added from
there. Actions are added in sequence.
2. In the Replace statement, click the <XPath> link to edit the XPath
expression. The XPath Expression Editor page is displayed.
3. In the Variable Structures pane, select body from the Select Structure list.
./exam:processLoanApp/loanRequest/java:Notes
84
Oracle Service Bus Examples and Tutorials
7. Click the <Expression> link to display the XQuery Expression Editor page.
10. Select Replace node contents option. You need not replace the entire
node.
Next, you must add a Report action and configure it to report the body context
variable as detailed context, and set a key name of errorCode and the key value to
the actual error code found in the fault context variable.
1. Click the Replace icon and select Add an Action > Reporting > Report.
The report action is added to the page.
85
Oracle Service Bus Examples and Tutorials
3. In the Variables Structures pane, select body from the Select Structure list.
5. In the Key Value field, click <XPath> link. The XPath Expression Editor is
displayed.
6. In the Variable Structures pane, select fault from the Select Structure list.
86
Oracle Service Bus Examples and Tutorials
7. Expand $fault and copy the errorCode in the XPath Expression text box.
This step enables you to index the reporting data by error code. The keys are
a convenient way to identify a message. You can use the error code to search
for reporting entries in the reporting module.
87
Oracle Service Bus Examples and Tutorials
2. Select Add else Condition to add an Else action to the stage error handler.
2. Execute the steps in the Add a Replace Action to the Stage Error Handler
section.
88
Oracle Service Bus Examples and Tutorials
3. Click the <Expression> link to display the XQuery Expression Editor page.
Enter $fault/ctx:reason/text() in the XQuery Text page.
4. Click Validate and Save to validate and save the expression and return to
the Edit Stage Configuration page.
5. Enter Other than validation error in the "with Annotation" text box.
89
Oracle Service Bus Examples and Tutorials
1. Click the Report icon under the If...Then action, and select Add an Action
> Flow Control > Reply. The reply action is added to the page.
2. Select With Failure option. The Report Reply action is displayed as shown in
Figure 6-19.
3. Click Save to save the stage configuration and return to the Edit Error
Handler page.
4. Click Save to save the error handler configuration. You are returned to the
Edit Message Flow page.
90
Oracle Service Bus Examples and Tutorials
2. Click RouteNode1, then select Edit Route. The Edit Stage Configuration
page is displayed.
4. In the route statement, click the <Service> link to define the service to
which you want to route messages. The Select Service page is displayed.
6. Click Save.
91
Oracle Service Bus Examples and Tutorials
If the loan value entered is a non integer, an exception must be triggered and an
error message displayed in the Notes field of the message. If the loan value entered
is an integer, the message must be routed to the NormalLoan business service. The
message returned in the command window indicates whether a validation exception
occurred or the message was routed to the appropriate business service.
92
Oracle Service Bus Examples and Tutorials
Testing Prerequisites
To test the loan application using the test console, be sure you have deployed the
client JARs in the Oracle WebLogic Server console in the earlier section, Load the
1
Scenario One
3. Click the Launch Test Console icon in Actions column for LoanGateway3 to
launch the test console.
4. Replace the default payload in loanRequest field with the following code:
<loanRequest xmlns:java="java:normal.client">
<!--Optional:-->
<java:Name>Smith</java:Name>
<!--Optional:-->
<java:SSN>1234567</java:SSN>
<!--Optional:-->
<java:Rate>5</java:Rate>
<!--Optional:-->
<java:Amount>900000000</java:Amount>
<!--Optional:-->
<java:NumOfYear>10.1</java:NumOfYear>
<!--Optional:-->
<java:Notes>Large Loan Processing</java:Notes>
</loanRequest>
Accept other default settings and click Execute. The response as in Figure 6-22.
93
Oracle Service Bus Examples and Tutorials
This response message indicates that a validation exception occurred because the
loan duration specified was not an integer.
Scenario Two
1. In Oracle Service Bus Console, make sure the current session is activated.
4. Replace the default payload in loanRequest field with the following code:
94
Oracle Service Bus Examples and Tutorials
<loanRequest xmlns:java="java:normal.client">
<!--Optional:-->
<java:Name>Smith</java:Name>
<!--Optional:-->
<java:SSN>1234567</java:SSN>
<!--Optional:-->
<java:Rate>4</java:Rate>
<!--Optional:-->
<java:Amount>300000000</java:Amount>
<!--Optional:-->
<java:NumOfYear>10</java:NumOfYear>
<!--Optional:-->
<java:Notes>Normal Loan</java:Notes>
</loanRequest>
Accept other default settings and click Execute. The response as in Figure 6-23.
The response message indicates that the NormalLoan business service processed
the loan application because the loan duration value was an integer.
95
Oracle Service Bus Examples and Tutorials
Note:
You must have run the tests in To Test the Loan Application Routing
Configuration Using Test Console multiple times (at least five times) to
generate data to enable you to explore the reporting and monitoring
features.
Reporting
Oracle Service Bus includes a JMS Reporting Provider for message reporting. The
Reporting module in the Oracle Service Bus Console displays the information
captured from this reporting provider. You can create your own reporting provider
using the Reporting Service Provider Interface (SPI) if you do not wish to use the
out-of-the-box reporting provider.
The Operations area of Oracle Service Bus Console contains reporting features that
are presented in a drill-down format. When you explore the links presented, the
information is made available to you.
You can add SLA and pipeline alerts to the services you created in the tutorials. To
add alerts, be sure to Create a new session in the Oracle Service Bus Console. Also
be sure to create a simple Alert Destination resource.
SLA Alerts
To add SLA alerts to services, click the service name and add alert rules on the SLA
Alert Rules page. The aggregation interval on each alert determines how
frequently alerts appear in the Dashboard after you execute services.
96
Oracle Service Bus Examples and Tutorials
Pipeline Alerts
3. Edit an existing proxy service message flow to add them. For example, in the
LoanGateway3 message flow, edit the Reply stage in the Error Handler to add
a Reporting > Alert action to a specific location.
Be sure to define alert rules so that when you execute the services in the Test
Console, the alerts are guaranteed to fire.
97