Wednesday, July 16, 2008

Mediation Flow (StockQuote Application)

StockQuote Application (Mediation Flow) How to

Websphere Integration Developer v612

Contact us...

Table of Contents

Completed StockQuote Application (Mediation Flow)

How to build the StockQuote Application (Mediation Flow)

Completed StockQuote Application (Mediation Flow)

Related links
Source Websphere Integration Developer 6.1.2 runtime
Introduction

The Stock Quote sample demonstrates how you can easily integrate different services and manipulate messages at runtime without affecting the client applications.

This integration is achieved through the Service Component Architecture and mediation functionality provided by the WebSphere® Enterprise Service Bus. The StockQuote mediation service is built with the business integration tools for building mediations: the assembly editor and the mediation flow editor. Mediation flows intercept and modify messages that are passed between existing services (providers) and clients (requesters) that want to use those services.

This sample runs on WebSphere Enterprise Service Bus v 6.1 or WebSphere Process Server v 6.1.

Overview
This Stock Quote sample addresses the business need of a financial services company that provides an interactive Web-based stock market service to its customers.
The company wants to differentiate itself from its competition by offering tiered levels of service. The company's goal is to offer delayed stock quotes to their standard customers and real-time quotes to their premium customers, that is, customers who pay a subscription.
The company wants to:
  1. Offer the delayed and real-time stock quote services as a single service, which dynamically determines which external service to invoke based on the customer's subscription level.
  2. If the real-time service is unavailable, route requests to the delayed service without affecting the running application.
  3. Log all requests to the service to satisfy audit requirements.

StockQuote Application

Business Integration View

The business integration view shows all the resources used by the application (i.e data types, interfaces, etc..).

Assembly Diagram

The Assembly Diagram shows all the components used by the application (i.e export component, mediation flow component, and import components).

StockQuote_MediationFlow - Request

This is the completed StockQuote_MediationFlow: Request

StockQuote_MediationFlow - Response

This is the completed StockQuote_MediationFlow: Response

How to build the StockQuote Application (Mediation Flow)

Steps
  1. Build the library
  2. Build a Mediation Module
  3. Assemble the mediation module
  4. Implement the mediation flow component
Step1 Build the library
Resources such as interfaces and business objects should be contained in libraries so that they can be easily shared by modules.
Start building the Stock Quote sample by creating the resources library and its contents.
  1. Create a library and call it Resources
  2. Import a WSDL file into the Resources library. Refer to WSDL file at right for further details.
  3. Create business objects (3) in the Resource library. Refer to business objects diagram at right for further details.
  4. Create an interface (1) called StockQuoteService in the Resource library. Refer to interface diagram at right for further details.
Completed Resource library
WSDL File
Note: use the wsdl file found in IBM Websphere Integration Developer 6.1.2.
E:Program FilesIBMSDP70Sharedpluginscom.ibm.wbit.samples.content_6.1.200.v20080615_0659artifactsstockquotewsdl
Business objects diagram
Interface diagram
Step2 Build a Mediation Module
Create a mediation module called StockQuote.
Configure it to use the Resources library and to generate a default mediation flow component called StockQuote_MediationFlow
Step3 Assemble the Mediation Module
Mediation modules contain assembly diagrams that are wired together to form the integrated service application.
The StockQuote mediation module consists of the following elements:

  1. StockQuoteService has a WSDL interface, called StockQuoteService, and uses SOAP/JMS web service binding so that the servlet front end can connect to the mediation module by using JAX-RPC. In this sample, you will create the StockQuoteService interface and generate the WSDL file.

    - Drag the Resources Interfaces StockQuoteService to the Assembly diagram to create an Export with no Binding component.

    - Rename the component to StockQuoteService.

    -Generate Web Services binding on StockQuoteService
  2. StockQuote_MediationFlow contains the mediation flow. In this sample, you will create and implement the StockQuote_MediationFlow component.
  3. RealtimeService has a web service binding and an interface that matches the real-time (premium) service. In this sample, you will import the WSDL file RealtimeService.wsdl.

    - Drag the Resources Interfaces RealtimeServicePortType to the Assembly diagram to create an Import with Web Service Binding component.

    - Rename the component to RealTimeService.

  4. DelayedService has a web service binding and an interface that matches the delayed (standard) service. In this sample, you will import the WSDL file DelayedService.wsdl.

    - Drag the Resources Interfaces DelayedServicePortType to the Assembly diagram to create an Import with Web Service Binding component.

    - Rename the component to DelayedService.


Step4

No comments: