Getting Started with Oracle SOA Suite 11g R1
A Hands-On Tutorial
As the concept of Service-Oriented Architecture has matured, it has triggered the
emergence of new, sophisticated, and specialized tools: Enterprise Service Buses (ESB)
for service virtualization, BPEL for orchestration, Human Workflow, Business Rules for
externalizing key pieces of logic, and so on. As a result, developers now have a rich set of
tools to work with. However, this can itself present a challenge: how can one keep up
with all these various tools and their capabilities? One of the key goals of Oracle SOA
Suite 11g is to assemble these tools in a cohesive, simple-to-use, and highly-integrated
development environment. This book, organized around a tutorial that is built in an
iterative fashion, will guide you through all the components of the suite and how they
relate to each other.
The authors are part of the Oracle SOA Suite product management team, and the idea
of the book came as we were delivering an earlier version of this material, as an
accelerated internal training at Oracle—before the product was even released. These
training sessions were very well received and we decided it was worth sharing this
material with a larger audience.
This book is not meant to be used as reference material—it is an accelerated learning
path to the Oracle SOA Suite. The focus is on breadth rather than on depth. More
specifically, we wanted to highlight the key capabilities and role of each product in the
Oracle SOA Suite and explain how they can be put to work together to deliver highly
capable and flexible applications. Too often we, as developers, tend to stretch the limits
of (not to say abuse!) a few technologies, simply to stay within our comfort zone—and
because there is always so little time to learn new things. With its streamlined format, we
hope this book will give you the confidence to further explore some of these technologies
you had never looked at before.
What This Book Covers
The principal aim of this book is to get you operational with Oracle SOA Suite 11gR1
quickly and easily. In this spirit, the largest part of this book is dedicated towards a set of
hands-on step-by-step tutorials that build a non-trivial SOA composite that you can
deploy, test, run, monitor, and manage.
Chapter 1 starts the book off with a quick refresher on some of the useful concepts
regarding SOA and services and concludes with an introduction to Service Component
Chapter 2 discusses the key challenges in the technical implementation of SOA-based
applications and how Oracle SOA Suite 11g leverages SCA principles to address
Chapter 3 describes the business and technical requirements for a purchase order
(PO) processing composite and gives you an overview of how the complete solution
will be built up in a set of discrete steps using a series of tutorials using Oracle SOA
Chapter 4 gives you the necessary instructions for download, installation, and
configuration of Oracle SOA Suite 11gR1.
The core functionalities of the PO processing composite that is described in Chapter 3 are
built in Chapters 5 through 10. This series of chapters will teach you the basics of
working with Oracle SOA Suite 11g and the IDE (JDeveloper).
You start building the composite using a mediator, as well as web services and database
adapters. You then add a file adapter and a BPEL (Business Process Execution
Language) component to create a process that orchestrates the overall flow, adding
human interaction, creating conditional process execution using business rules, and
accessing external services via a JMS (Java Message Service) adapter. At the end of each
and every chapter, you will have a composite that can be deployed, run, and tested. You
are advised to go through these tutorial chapters, 5-10 in a sequential manner.
The tutorials in Chapters 11 through 19 let you add more functionality to the composite
and explore some of the operational features of Oracle SOA Suite 11gR1. You will learn
service re-use and virtualization using Oracle Service Bus (OSB), explore some of the
composite life cycle management features, test the composite using the unit testing
framework, incorporate exception handling, add security policies to a service, set up a
business activity-level tracking of the composite transactions using Oracle Business
Activity Monitoring (BAM), work with events using the unified services and events
platform of Oracle SOA Suite 11g, handle data using Service Data Object (SDO)
specification, and connect the composite to a Business-to-Business (B2B) gateway using
By the end of Chapter 19, you should have a good grasp of all components in Oracle
SOA Suite 11gR1, and be able to create modular, full-featured service composites. The
concluding remarks in Chapter 20 will briefly discuss some of the ways you could use
such composites to provide business benefits.
Event Delivery Network
This allows for a fully-declarative, business-oriented, rather than developer-oriented
approach for using events in a SOA application.
Another feature of EDN is the ability to publish and subscribe to these events from a
variety of programming environments such as Java, PL/SQL, SOA Composites, and
With EDN, Oracle has fostered the concept of events in the context
of SCA, and this has given birth to an additional SCA specification:
the “Assembly Model Specification Extensions for Event Processing
and Pub/Sub”. Since EDN in Oracle SOA Suite 11g predates the
specification, you will find differences in the details, but the concepts
are the same and EDN will eventually be aligned with the standard
that emerges from the specification.
Creating and managing event definitions
Events are defined using an Event Definition Language (EDL), an XML schema used
to build business event definitions. An EDL consists of the following:
- A global name.
- Custom headers: These can be used for content-based routing without having
to parse the XML payload and apply XPath queries to get at the value to be
used for the routing decisions. For instance, one can put the purchase order
type in the custom header. This easily accessible custom header could then be
used to efficiently decide how to process delivered events.
- Payload definition: Typically this is an XML schema for the business data
that needs to accompany the event. For example, a “NewPO” event’s payload
definition will be a schema for a purchase order.
Event definitions can be created declaratively in JDeveloper in a couple of different
ways depending on triggering conditions.
To publish events from a SOA composite, one would create new event definitions
and register them with the SOA Infrastructure. It is this option that you will be able
to try out later in this chapter during the hands-on exercise.
If you want to raise events on one or more database operations such as insertion of
a new row or update of an existing one, you can use ADF-BC to define these events.
Application Development Framework (ADF), a model-view-controller pattern
based UI development framework for creating Rich Internet Applications (RIAs)
and Business Components (BC) , an object-relational mapping tool, provide an
easy way to define events. ADF-BC has built-in support for associating these events
with database actions like insert, delete, and modify. For example, an event called
“NewCustomerAdded” could be generated every time a new customer record is
inserted into the database.
Registered events, their subscribers, and any faulted deliveries can all be tracked and
monitored using the Oracle Enterprise Manager, in the same fashion that you would
be managing and monitoring other aspects of your SOA infrastructure.
Consuming events from the Event Delivery Network
The first step to consume an event is to discover its definition. Event definitions can
be stored locally in a composite or globally on the server—in either case, they can be
discovered through the JDeveloper resource catalogue.
To subscribe to an event within an SOA composite application, you start by defining
a Mediator component, selecting the event of interest from a list of registered events
in the network.
To further refine a subscription, and narrow down the information you will receive,
you can define an XPath-based filter on your subscriptions. For example, for an event
named “NewPOCreated”, you could either subscribe to all “NewPOCreated” events
(default when no filter is defined) or only those where the order amount is more than
a million dollars (by defining an XPath-based filter on the order amount field within
Tutorial: Use of Event Delivery Network (EDN) and POProcessing
Let’s try out a simple EDN use case. You extend the POProcessing example that you
have been building in previous chapters.
Chapters 11-19 can be done in any order after completing Chapter 10.
In order to follow the tutorial in this chapter you must have either
completed the tutorial from Chapter 10 or higher, or set up the
environment as described in Chapter 4 and deployed the solution
for Chapter 10, which can be found in c:\po\solutions\ch10.
To illustrate the usage of events, you modify the existing POProcessing composite
to accept new orders from two sources: the Web Service interface, which you have
already implemented, and another application that will publish events to indicate
Modifying the composite to consume events
In this step, you modify the POProcessing composite to use EDN. You add a new
mediator component called receivePO, which subscribes to an event called NewPO
and sends the received PO to the routePO service.
Defining the event
- Open the POProcessing application in JDeveloper and open composite.xml,
and click on the Event Definition Creation icon:
- Click on OK to complete the event definition.
- Close the POEvents.edl panel.
- Save all.
You have just created a new event called POEvent.
It is now available to this and other composites
to subscribe to or publish. Whenever this event is delivered,
it will also carry with it a document for the new purchase order.
Subscribing to the NewPO event
- Drag-and-drop a Mediator component onto the composite.
- Name the mediator receiveNewPO.
- Select Subscribe to Events for the Template.
- Click on the + to add an event. Select the NewPO event from the Event
- Double-click on the receiveNewPO mediator and define a new
transformation map. In the transformation-map, map the all the fields from
the source to the target.
- Close the mediator and save all.
Deploying and testing
- Deploy the POProcessing composite to the server.
- Browse to the EM console at http://localhost:7001/em.
- Right-click on folder SOA-infra (SOA_server1) under folder SOA:
- Select the event and click on the Test… button to publish the event.
- In the pop-up window, enter the following XML and click on Publish:
<productName>Sony Bluray DVD Player</productName>
- You should get a “The Event published successfully” message.
- Click on SOA-infra in the navigation panel on the left to get
the SOA-infra dashboard.
- Click on the POProcessing composite to view new instances. You should see
an instance created for processing the event you just published. Click on the
instance ID to view the fl ow trace.