WebSphere

Service gateway with Web service bindings

A service gateway allows routing to multiple endpoints using a Web service 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 a Web service 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.
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 Web service bindings with static and dynamic service gateways.

Building a dynamic service gateway with Web service bindings

About this task

These steps provide an overview, they do not include all instructions for creating service gateways for static Web service bindings. For complete instructions refer to the WebSphere Integration Developer documentation.
Procedure
  1. The integration developer completes 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 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. Create an import using the predefined Service Gateway interface and connect this to a newly created reference on the mediation flow component. Click this link to go to the topic for WebSphere Integration Developer.
      1. Generate a Web service binding 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 Generic Gateway interface: Click this link to go to the topic for WebSphere Integration Developer.
      1. Generate a Web service 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 gateway binding
This figure shows the request flow for dynamic gateway binding
Figure 3. Response Flow for dynamic gateway bindingThis figure shows the response flow for dynamic gateway binding

Building a static service gateway with Web service 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.
Restriction: The static service gateway scenario supports only document literal wrapped and document literal styled Web service messages
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 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 (with associated interfaces). 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. Click this link to go to the topic for WebSphere Integration Developer.
      1. Generate a Web service 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 module implementation by completing the following steps
      1. Optional: Add any logging and header transformation primitives. Click this link to go to the topic for WebSphere Integration Developer..
      2. Add a Set Message Type primitive to assert the anyType in body to the textBody. Click this link to go to the topic for WebSphere Integration Developer..
      3. Use a Message Filter primitive to determine the type of the messages, based on the context and header information in the SMO.Click this link to go to the topic for WebSphere Integration Developer..
      4. Use a Data Handler primitive to transform the body into the required type. The Data Handler primitive requires a special configuration for Web service requests. Use the XML datahandler with the target defined as /body and the source defined as /body/message/value.Click this link to go to the topic for WebSphere Integration Developer.
      5. Use additional primitives to look into the body and change any values. Click this link to go to the topic for WebSphere Integration Developer.
      6. In the response flow, use a Data Handler primitive to convert from the specific interface back into the Service Gateway interface. The Data Handler primitive requires a special configuration for the Web service response. Use the XML datahandler with the source defined as /body and the target defined as /body/message/value . In addition, the textBody will need to be asserted into /body/message. Click this link to go to the topic for WebSphere Integration Developer..
      7. Optional: Add primitives to log and transform the header or body of the message, in 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 binding
This figure shows request flow for static service gateway binding
Figure 5. Response flow for static service gatewayThis figure shows the response flow for static service gateway

task Task topic

Terms of use | Feedback


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


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