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

Creating a business service to call an external SOAP-based web service


With the basic folder structure of the OSB project in place, we are ready to create our first OSB service. We will start with the business service Customer Service which will act as a wrapper of the external service. Business services in OSB are required definitions to exchange messages with enterprise information systems—such as databases and queues or other web services. The external service is a web service offered by a fictive CRM system. The business service will allow the definition of all sorts of properties for controlling how the external service is invoked:

Getting ready

Make sure that the external web service we want to invoke is started by running the script \chapter-1\getting-ready\misc\customer-external-webservice\start-service.cmd. This service is implemented using soapUI's capabilities for creating mock services.

Verify that the service is running and available by asking it for its WSDL definition. Enter the following URI in a browser window: http://localhost:8088/mockCustomerServiceSOAP?WSDL:

How to do it...

In Eclipse OEPE, perform the following steps:

  1. In the project tree, right-click on the business folder and select New | Business Service.

  2. Enter CustomerService into the File name field, check a second time that the business folder is selected, and click on the Finish button:

  3. A new business service artifact is created in the business folder and the editor for the business service opens automatically.

  4. Navigate to the General tab, if it does not already have the focus, and select the WSDL Web Service radio button.

  5. Click on the Browse button and a pop up window will show up, where the WSDL resource of the external service to be wrapped, can be selected.

  6. Click on the Consume button.

  7. A second pop-up window will show up where the WSDL resource can be specified:

  8. Select URI in the Service Resource drop-down listbox.

  9. In the URI field, enter the URL of the WSDL resource to consume. The external service provides its WSDL through the following URL: http://localhost:8088/mockCustomerServiceSOAP?WSDL.

  10. Click on the OK button and Eclipse will consume the WSDL from this URL.

  11. Select the CustomerServiceSOAP port on the next window.

  12. Click on the OK button.

  13. Select Yes on the pop-up message window to confirm that the transport configuration settings will be overwritten by the information from the selected WSDL.

  14. Save the OSB project by selecting File | Save.

  15. In the Project Explorer, right-click on the imported WSDL file mockCustomerServiceSOAP.wsdl and select Rename. Enter CustomerService.wsdl into the New name field of the pop-up window and confirm.

  16. In the Project Explorer, drag the CustomerService.wsdl file into the wsdl folder and drop it there. All the references to the WSDL file are automatically adapted by Eclipse OEPE.

  17. Navigate to the Transport tab and check that the Endpoint URI has been replaced with the service endpoint setting from the WSDL that we consumed:

  18. Save the artifact by selecting File | Save or by clicking on the Save toolbar button.

How it works...

The business service acts as a wrapper of our external service. Once created, we will no longer have to use the WSDL to refer to the external service, but can use the business service. This forms an additional abstraction layer, which will become handy later in some of the more advanced recipes to enable functionality in the OSB, which is applied before the real endpoint is invoked, such as SLA monitoring, service throttling, service pooling, and others. Sentence is too long, runs on too long. Would be better split into two sentences.