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

Generating a simple pass-through proxy service


After we have created the business service wrapping the external web service, we can now create the proxy service. The proxy service will allow a consumer to call our service on the OSB. If the OSB needs to support the same web service interface as the backend service does, then the quickest and easiest way is to create a pass-through service:

Getting ready

This recipe continues with the result of the previous recipe. If necessary, the basic-osb-service project at that stage can be imported from here: \chapter-1\getting-ready\business-service-created.

How to do it...

In Eclipse OEPE, perform the following steps:

  1. In the project tree, right-click on the CustomerService.biz artifact and select Oracle Service Bus | Generate Proxy Service.

  2. Enter CustomerService in the File name field and select the proxy folder for the location of the new proxy service.

  3. Click on the Finish button.

  4. Click on the Transport tab and check the value of the Endpoint URI field. It should be /basic-osb-service/proxy/CustomerService.

  5. Navigate to the Message Flow tab and have a look at the message flow, which has been generated by Eclipse OEPE. A Route node with a nested Routing action has been created with its Invoking properties set to Use inbound operation for outbound:

How it works...

Applying this recipe created the simplest possible proxy service. The proxy service offers the same SOAP-based web service interface as the business service/external service, so it's basically just doing a pass-through of the request and response message.

This can be handy if we want to use the OSB for adding an additional abstraction layer to apply service virtualization. If all the service consumers no longer access the external services directly, but only through the OSB proxy-service, a lot of the features of OSB can be used transparently by a service consumer, such as SLA monitoring and alerting, service pooling and throttling, or message validation. This directly supports the main goal of service virtualization—adding operational agility.

By setting the Invoking property to Use inbound operation for outbound, we make sure that the whole WSDL with all its operations is handled by one single Routing action. The inbound operation name on the proxy service is used as the outbound operation name invoked on the business service. Apart from the Routing action there are no other actions in this proxy service. By that, both the request and the response messages in the $body variable are not touched by the OSB. This guarantees that the overhead of adding OSB as a service virtualization layer has minimal impact on the performance.

See also

See recipe Creating a proxy service with a WSDL-based interface, if the proxy should offer a different web service interface than the external service provider.

For deploying and testing the service check the next two recipes in this chapter.