Book Image

Oracle Service Bus 11g Development Cookbook

Book Image

Oracle Service Bus 11g Development Cookbook

Overview of this book

Oracle Service Bus 11g is a scalable SOA integration platform that delivers an efficient, standards-based infrastructure for high-volume, mission critical SOA environments. It is designed to connect, mediate, and manage interactions between heterogeneous services, legacy applications, packaged solutions and multiple Enterprise Service Bus (ESB) instances across an enterprise-wide service network. Oracle Service Bus is a core component in the Oracle SOA Suite as a backbone for SOA messaging. This practical cookbook shows you how to develop service and message-oriented (integration) solutions on the Oracle Service Bus 11g. Packed with over 80 task-based and immediately reusable recipes, this book starts by showing you how to create a basic OSB service and work efficiently and effectively with OSB. The book then dives into topics such as messaging with JMS transport, using EJB and JEJB transport, HTTP transport and Poller transports, communicating with the database, communicating with SOA Suite and Reliable Message Processing amongst others. The last two chapters discuss how to achieve message and transport-level security on the OSB.
Table of Contents (19 chapters)
Oracle Service Bus 11g Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

The Oracle Service Bus 11g (OSB) is a scalable SOA integration platform that delivers an efficient, standards-based infrastructure for high-volume, mission critical SOA environments. It is designed to connect, mediate, and manage interactions between heterogeneous services, legacy applications, packaged applications, and multiple Enterprise Service Bus (ESB) implementations (such as other OSB instances, Microsoft BizTalk, IBM WebsSphere ESB, SAP-XI, ...and so on) across an enterprise-wide service network. Oracle Service Bus is a core component of the Oracle SOA Suite.

This practical cookbook shows you how to develop service- and message-oriented (integration) solutions on the Oracle Service Bus 11g.

This practical cookbook shows you how to develop service- and message-oriented (integration) solutions on the Oracle Service Bus 11g.The book contains more than 80 practical recipes, showing how to efficiently develop on the Oracle Service Bus. In addition to its cookbook style, which ensures the solutions are presented in a clear step-by-step manner, the explanations go into great detail, which makes it good learning material for everyone who has experience with the OSB and wants to improve. Most of the recipes are designed in such a way that each one is presented as a separate, standalone entity and reading of prior recipes is not required. The finished solution of each recipe is also made available electronically.

What this book covers

Chapter 1, Creating a Basic OSB Service, teaches how to structure a project through the Eclipse OSB plugin, what conventions and best practices to apply, and how to use proxy and business service to create a simple message flow on the Oracle Service Bus. We will also learn how to test an OSB service through the Service Bus console and through soapUI.

Chapter 2, Working Efficiently with OSB Artifacts in Eclipse OEPE, presents some tips and tricks for simplifying working in Eclipse with the OSB Plugin. We will also learn how to use the visual debugger for step-by-step debugging of OSB services.

Chapter 3, Messaging with JMS Transport, shows how to use the JMS transport for sending and receiving message through JMS queues and topics. Additionally this chapter also shows how to use other tools such as soapUI and QBrowser to support the testing of JMS applications.

Chapter 4, Using EJB and JEJB Transport, teaches us how to use the EJB and JEJB transport for integrating and exposing EJB session beans.

Chapter 5, Using HTTP Transport, presents how to use the HTTP transport for implementing RESTful web services and how to implement a custom transport which uses WebSockets to implement server-side push messaging.

Chapter 6, Using File and Email Transports, shows how to use the File and FTP transport for reading and writing files and how to use the Email transport for receiving and sending emails from an OSB service.

Chapter 7, Communicating with the Database, shows with different recipes how the DB adapter can be used to integrate an OSB service with a relational database, and how the AQ adapter can be used to implement messaging between OSB and an Oracle database.

Chapter 8, Communicating with SOA Suite, teaches us how to use the SOA direct transport to natively communicate between SOA Suite service components and OSB services.

Chapter 9, Communication, Flow Control, and Message Processing, presents how to use different actions from the Communication, Flow Control, and Message Processing section of the OSB Design Palette.

Chapter 10, Reliable Communication with the OSB, contains recipes that will show how to use the various features of the OSB and WebLogic JMS to implement reliable message processing.

Chapter 11, Handling Message-level Security Requirements, shows different options for securing OSB services on the message-level to guarantee end-to-end security between an initial sender and an ultimate receiver.

Chapter 12, Handling Transport-level Security Requirements, contains recipes for securing OSB services on the transport protocol level.

What you need for this book

To develop and test the recipes in this book, an Oracle Service Bus 11g Patch Set 3 (11.1.1.4 or higher) and an Oracle Database11g (XE or Enterprise edition) needs to be installed on the system. For Chapter 8, a full installation of Oracle SOA Suite 11g (11.1.1.4 or higher) including Enterprise Manager needs to be installed as well.

An installation of JDeveloper with the SOA Suite extension (11.1.1.4 or higher) is necessary for Chapter 2, Chapter 3, Chapter 7 and Chapter 8.

To use the web-based consoles, either Internet Explorer or Firefox is necessary.

We have developed all the recipes on the so-called "developers" installation of Oracle Service Bus 11g and Oracle SOA Suite 11g. This means that all the software is running on one single Admin Server and there are no additional Managed Servers needed, limiting the resources needed on the system. When we started writing the book, Oracle Service Bus Patch Set 3 (11.1.1.4) was the actual release and we have implemented all the recipes using this version. Keep that in mind when interpreting the screenshots, although most of the time this is transparent and not relevant. A place where it is certainly relevant is when entering the URI of the OSB server (that is, to open the Service Bus console). In our installation, having only an Admin Server, the port we use throughout the book is always 7001. Make sure to change that in case of a different installation.

For testing some of the recipes, the latest version of soapUI needs to be available. In Chapter 3, QBrowser and HermesJMS will be used to test JMS queues and topics.

For Chapter 6, an FTP server needs to be available. The corresponding recipe guides you through the installation of CoreFTP Server. Also in Chapter 6, an e-mail server and e-mail client is needed. The corresponding recipe describes the necessary steps for installing Apache James as the mail server and Mozilla Thunderbird as the e-mail client.

To guide you through the installation of the various components, we have written an extra document only available electronically. To download the installation guide, go to the Packt homepage for the OSB cookbook and download the ZIP file containing the code for the book. Included in the ZIP file is a PDF document named OsbCookbookInstallationGuide.pdf.

OSB Cookbook standard environment

The OSB Cookbook standard environment is a set of artifacts, representing the environment that most of the recipes make use of.

Part of the environment is a database schema to be installed in an Oracle database, containing a few tables and AQ objects. The database schema can be installed by running the script setup\database\install.cmd.

Another part of the environment is installed on the WebLogic server. This includes artifacts stored in the JNDI tree, such as DataSource or Connection Factories as well as the necessary JMS objects for Chapter 3. These artifacts are installed through a WLST script, which is called from an ANT script. Install it by running the script setup\wlst\install.cmd.

These two scripts are part of the ZIP file for this book, downloadable from the Packt website.

Who this book is for

If you are an intermediate SOA developer who is using Oracle Service Bus to develop service and message-orientated applications, then this book is for you. The book assumes that you have a working knowledge of fundamental SOA concepts and Oracle Service Bus.

Recipes

To keep the initial preparation of each recipe short, a lot of the recipes start from a base setup, which in most cases is an already existing OSB project including some initial artifacts and some base configuration. All the base setup artifacts are available in the chapter-<N>\getting-ready\<recipe-name> folder available in the ZIP file for this book. Each recipe refers to the corresponding folder in the Getting Ready section.

It will often be necessary to import an existing OSB project into Eclipse OEPE (for example, the OSB Plugin). The recipe Importing an already existing project into Eclipse OEPE in Chapter 1, Creating a Basic OSB Service, explains how to do that.

The solution of each recipe is available electronically in the folder chapter-<N>\solution\<recipe-name>, which is also part of the ZIP file for this book.

For most of the recipes we have created a simple, schematic diagram, representing the solution and the participating artifacts. The following image shows such a diagram taken from Chapter 1, Creating a Basic OSB Service.

The following diagram shows a legend with the different symbols and their meanings used throughout this book.

We strongly believe in the adage "a picture is worth a thousand words" and hope that these schematic diagrams will help the reader to quickly understand the setup of each recipe.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Open <HERMES_HOME>\bin\hermes.bat and add the following JAVA_HOME and PATH variable right at the beginning".

A block of code is set as follows:

<configuration>
  <location>
    <directory>c:\work\files\in</directory>
    <filename>OtherProperties.xml</filename>
  </location>
</configuration>

Any command-line input or output is written as follows:

keytool -exportcert -alias clientKey -storepass welcome -keystore c:\client_2.jks -file c:\client_2.cer

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Navigate to the Configuration tab, and select the Outbound Connection Pools tab".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.