Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Oracle Service Bus 11g Development Cookbook

You're reading from  Oracle Service Bus 11g Development Cookbook

Product type Book
Published in Jan 2012
Publisher Packt
ISBN-13 9781849684446
Pages 522 pages
Edition 1st Edition
Languages

Table of Contents (19) Chapters

Oracle Service Bus 11g Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Creating a basic OSB service 2. Working Efficiently with OSB Artifacts in Eclipse OEPE 3. Messaging with JMS Transport 4. Using EJB and JEJB transport 5. Using HTTP Transport 6. Using File and Email Transports 7. Communicating with the Database 8. Communicating with SOA Suite 9. Communication, Flow Control, and Message Processing 10. Reliable Communication with the OSB 11. Handling Message-level Security Requirements 12. Handling Transport-level Security Requirements 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.

You have been reading a chapter from
Oracle Service Bus 11g Development Cookbook
Published in: Jan 2012 Publisher: Packt ISBN-13: 9781849684446
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}