WebSphere

Service gateway with messaging or HTTP bindings

A service gateway allows routing to multiple endpoints using a messaging or HTTP binding. Requests can have the headers, body or both manipulated in a mediation module before being forwarded to the service provider.

About this task

Using WebSphere® Integration Developer you can build a gateway service, which allows routing messages to multiple endpoints using messaging or HTTP binding. This allows the gateway to handle different portTypes with a single generic export. Requests containing different portTypes arrive at a generic endpoint, which is the entry into the gateway. These requests can have the headers, body or both manipulated in a mediation module before being forwarded to the service provider. There are two types of service gateways, the dynamic service gateway and the static service gateway:
  • The dynamic service gateway is a generic mediation that modifies the header information in the message. In a dynamic service gateway, the endpoint address is determined at runtime.
  • The static service gateway is a generic mediation that modifies the information contained in body and the header of a message. In a static service gateway, the endpoint address is known when the message enters the gateway.
    Note: WSDL has to be available for the static service gateways.
The following bindings are supported in a service gateway scenario:
  • JMS
  • Generic JMS
  • MQ JMS
  • MQ
  • HTTP
Figure 1. Actor (service requester) and system (ESB)
Service requests can be routed to different service endpoints depending the entries in your registry.

The following sections explain how to use bindings with static and dynamic service gateways.

Building a dynamic service gateway with messaging or HTTP bindings

About this task

These steps provide an overview, they do not include all instructions for creating a dynamic service gateway. For complete instructions refer to the WebSphere Integration Developer documentation
Procedure
  1. The integration developer completes the following steps:
    1. Create a new mediation module. Click this link to go to the topic for WebSphere Integration Developer.
    2. Import the predefined Service Gateway interface and protocol (such as HTTP or JMS) related resources into the project. Click this link to go to the topic for WebSphere Integration Developer.
    3. Open the mediation module assembly, and add a mediation flow component to the assembly. Click this link to go to the topic for WebSphere Integration Developer.
    4. Add the Service Gateway interface to the mediation flow component. Click this link to go to the topic for WebSphere Integration Developer.
    5. Create an import for the mediation module using the predefined Service Gateway interface: Click this link to go to the topic for WebSphere Integration Developer.
      1. Generate bindings for the import. Click this link to go to the topic for WebSphere Integration Developer. The import will be configured with Service Gateway Data Handler and Service Gateway Function Selector.
    6. Create an export for the mediation module using the predefined Service Gateway interface. Click this link to go to the topic for WebSphere Integration Developer. For HTTP bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For JMS bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For Generic JMS bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For MQ JMS bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For MQ bindings, see: Click this link to go to the topic for WebSphere Integration Developer.
      1. Generate a binding for the export.Click this link to go to the topic for WebSphere Integration Developer.. The export will be configured with Service Gateway Data Handler and Service Gateway Function Selector
    7. Generate the mediation flow implementation by completing the following steps.
      1. Optional: Log the message to a database.Click this link to go to the topic for WebSphere Integration Developer.
      2. Select a transform primitive to convert the header information.Click this link to go to the topic for WebSphere Integration Developer.
      3. Select a routing mediation primitive (such as the Endpoint Lookup primitive or Database Lookup primitive) that will use information in the service message object (SMO) to determine the final endpoint for the message. This endpoint address should then be populated into the /header/SMOHeader/TargetAddress section of the SMO.Click this link to go to the topic for WebSphere Integration Developer..
      4. Add any mediation primitives required in the response flow, for example, logging or transformation primitives.Click this link to go to the topic for WebSphere Integration Developer..
  2. The runtime administrator deploys and administers the mediation module by completing the following steps.
    1. Deploy the mediation module. Use the runtime administrative console to install the EAR file as a new application. Click this link to go to the topic for WebSphere ESB. Click this link to go to the topic for WebSphere ESB for z/OS. Click this link to go to the topic for WebSphere Process Server. Click this link to go to the topic for WebSphere Process Server for z/OS.
    2. Start the application associated with the mediation module. Use the runtime administrative console to start the application associated with the SCA module (mediation modules are types of SCA modules). Click this link to go to the topic for WebSphere ESB. Click this link to go to the topic for WebSphere ESB for z/OS. Click this link to go to the topic for WebSphere Process Server. Click this link to go to the topic for WebSphere Process Server for z/OS.

Results

When the service request invokes the mediation module, the service request will be manipulated and routed to the correct endpoint.

Example

Figure 2. Request flow for dynamic service gateway
A module contains a mediation flow component. The module export has a service gateway interface, and the import has a service gateway portType.
Figure 3. Response Flow for dynamic gateway binding
The figure shows a response flow that contains a Message Logger mediation primitive that can log messages to a database.

Building a static service gateway with messaging or HTTP bindings

About this task

These steps provide an overview, they do not include all instructions for creating a static service gateway. For complete instructions refer to the WebSphere Integration Developer documentation
Procedure
  1. The integration developer completes the following steps:
    1. Create a new mediation module. Click this link to go to the topic for WebSphere Integration Developer.
    2. Import the predefined Service Gateway interface and protocol (such as HTTP or JMS) related resources into the project. Click this link to go to the topic for WebSphere Integration Developer.
    3. Open the mediation module assembly, and add a mediation flow component to the assembly. Click this link to go to the topic for WebSphere Integration Developer.
    4. Add the Service Gateway interface to the mediation component. Click this link to go to the topic for WebSphere Integration Developer.
    5. Add the specific imports for the end services (with associated interfaces) with the correct configuration. Click this link to go to the topic for WebSphere Integration Developer.
    6. Create an export for the mediation module using the predefined Service Gateway interface. For HTTP bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For JMS bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For Generic JMS bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For MQ JMS bindings, see: Click this link to go to the topic for WebSphere Integration Developer. For MQ bindings, see: Click this link to go to the topic for WebSphere Integration Developer.
      1. Generate a binding for the export.
      2. Select the Service Gateway Function Selector for the export.
      3. Select the Service Gateway Data Binding for the export.
    7. Generate the mediation flow implementation by completing the following steps. Click this link to go to the topic for WebSphere Integration Developer.
      1. Optional: Select a Message Logger mediation primitive.Click this link to go to the topic for WebSphere Integration Developer..
      2. Select a Message Filter mediation primitive and configure to route the message.Click this link to go to the topic for WebSphere Integration Developer..
      3. Add a Set Message Type mediation primitive to assert the body type to the corresponding protocol-based message, such as JMSTextBody, JMSBytesBody, HTTPText or HTTPBytes. Click this link to go to the topic for WebSphere Integration Developer..
      4. Add a Data Handler mediation primitive and configure it to convert the protocol-based message to the specific business object (BO). Click this link to go to the topic for WebSphere Integration Developer..
      5. Select an XSL Transform mediation primitive to convert the message type and modify any values required. Click this link to go to the topic for WebSphere Integration Developer..
      6. In the response flow, include a Data Handler primitive to convert from a specific BO to a generic protocol based message, such as JMSTextBody, JMSBytesBody, HTTPText or HTTPBytes. Click this link to go to the topic for WebSphere Integration Developer..
      7. Optional: Add a Message Logger mediation primitive to the response flow. Click this link to go to the topic for WebSphere Integration Developer..
  2. The runtime administrator deploys and administers the mediation module by completing the following steps.
    1. Deploy the mediation module. Use the runtime administrative console to install the EAR file as a new application. Click this link to go to the topic for WebSphere ESB. Click this link to go to the topic for WebSphere ESB for z/OS. Click this link to go to the topic for WebSphere Process Server. Click this link to go to the topic for WebSphere Process Server for z/OS.
    2. Start the application associated with the mediation module. Use the runtime administrative console to start the application associated with the SCA module (mediation modules are types of SCA modules). Click this link to go to the topic for WebSphere ESB. Click this link to go to the topic for WebSphere ESB for z/OS. Click this link to go to the topic for WebSphere Process Server. Click this link to go to the topic for WebSphere Process Server for z/OS.

Results

When the service request invokes the mediation module, the service request will be manipulated and routed to the correct endpoint.

Example

Figure 4. Request flow for static service gateway
A module contains a mediation flow component. The module export has a service gateway interface; the module imports have body specific portTypes.
Figure 5. Response flow for static service gateway
The figure shows a response flow with four callout responses, each with a Data Handler primitive; all Data Handlers are wired to one Message Logger.

task Task topic

Terms of use | Feedback


Timestamp icon Last updated: 20 June 2010 00:38:50 BST (DRAFT)


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wbpm.scenarios.esb1.620.doc/tasks/twesb_usecasejmsaware.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).
iDoc on