Introduction
WebSphere® ESB V7.0 introduces the Proxy Gateway pattern extending the capabilities of the Static and Dynamic Service Gateway patterns that were introduced in WebSphere ESB V6.2. This sample demonstrates a typical Service Gateway scenario showing built-in routing capabilities of the proxy gateway.
Service Gateway is a typical mediation has a single service consumer and a single service provider (or multiple service providers of the same type). The mediation acts as an intermediary between the two entries completing any processing, such as message manipulation, on the way. There is a separate mediation for each service provider and service consumer. This scenario is shown in Fig 1.
By using the Service Gateway pattern logic the mediation can be written once and used across all service interactions. The Service Gateway pattern provides the ability to have a single mediation that will handle the request for multiple service consumer types and service provider types, as shown in Figure 2.
Overview
By using the Service Gateway pattern logic the mediation can be written once and used across all service interactions. The Service Gateway pattern provides the ability to have a single mediation that will handle the request for multiple service consumer types and service provider types, as shown in Figure 2.
Overview
This sample creates a Proxy Gateway, which is a type of Service Gateway.
Architecture of the Proxy Gateway
The concept of a Proxy Gateway is based on the primary goal of a Service Gateway: to provide a generic capability across a multitude of service providers. The diagram below shows the relationship between a Proxy Gateway, Proxy Group, Service Provider and Virtual Service.
General processing template of a Gateway where Service consumers go into the mediation component through a virtual service.
General processing template of a Gateway where Service consumers go into the mediation component through a virtual service.
Ø Proxy Group: collection of Service Providers that can be grouped together into a logical set.
Ø Proxy Gateway: The entities that will complete the Gateway function for one or more Proxy Groups.
Ø Virtual Services: the exposed endpoint of the Proxy Gateway for each service provider within the associated Proxy Group
Implementation
We need to complete the following steps to build our application.
Ø Create a Proxy Gateway.
Ø Deploy Proxy Gateway.
Ø Business Space configuration.
Ø Test the application.
Create a Proxy Gateway:
Use the Proxy Gateway wizard to build a Proxy Gateway:
Open WebSphere® Integration Developer in a new workspace.
Select Window > Show view > Patterns Explorer to open the Patterns view, as shown below.
Create a new Proxy Gateway in the Patterns Explorer tab. Right-click Proxy Service Gateway and select Create New Instance.
Enter EAIProxyGateway as the Integration Solution name and click OK. The New Pattern Instance panel opens, as shown in below.
Accept the default configuration for the Proxy Gateway and click Generate. The Proxy Gateway wizard generates the required artifacts and a summary panel opens.
Scroll down and click the requestResponse Request Flow diagram to open the Mediation Flow Editor. A single Gateway Endpoint Lookup primitive is created by default.
Select the Gateway Endpoint Lookup Primitive and go to properties à Details. The panel should similar to this:
The details section shows the Lookup Method selected (URL) and populates a default Proxy Group called EAIProxyGateway ProxyGroup. When the application is installed, WebSphere ESB will check if EAIProxyGroup exists. If not, WebSphere ESB will create a new Proxy Group within the built-in configuration store and create an association between the Proxy Gateway and Proxy Group.
When the application is removed from the runtime the association between the Proxy Gateway and Proxy Group is removed, but the Proxy Group configuration remains. You can redeploy the application without losing configuration information associated with the Proxy Group (such as Virtual Services).
You can delete the Proxy Group manually using the Business Space console, when there are no associated Proxy Gateways.
The generation of the Proxy Gateway is now complete and the mediation module can be deployed on the runtime environment.
Deploy Proxy Gateway:
To be able to run and test this application it must be built and deploy the application.
If you did not build the sample yourself, you must import the completed sample application. Download the samples from Download Section and import the Proxy Gateway.zip project interchange file.
When you have imported the project, build and deploy the EAI_AccountServiceand the EAIProxyGateway_Gateway projects to a WebSphere ESB 7.0 server. Use the Add/Remove Projects option in the context menu to define a server in the Servers view, or install the server by using the Administration Console.
Business Space configuration:
To access the Business Space console open a Web browser and go to: http://<hostname>:<port>/BusinessSpace.
For example, http://localhost:9444/BusinessSpace
Note: the <hostname>:<port> name varies based on your server configuration.
The login screen is displayed.
In the User ID name field enter admin, and in the Password field, enter admin.
Note: When using Business Space for the first time the welcome screen is displayed. Within Business Space there are spaces, templates, pages and widgets. A space is a collection of pages that can be built based on a template, and a page can contain a number of widgets. WebSphere ESB and WebSphere Process Server include a number of built-in templates and widgets to provide an enhanced ready-to-use experience.
Create a new space so that the Proxy Gateway widget is available. You can do this by creating a new space and page, then adding the Proxy Gateway widget to that page; or by using the Service Administration template:
Go to Manage Spaces > Create Space.
In the Space Name field, enter Proxy Service Administration.
Select the Create a new space using a template check box. Select the Service Administration template from the menu. Click Save. You are returned to the Space Manager page.
Click the Proxy Service Administration Space link.
Select Proxy Gateway. The Proxy Gateway section includes the EAIProxyGatewaywidget. This widget shows the associations between a Proxy Gateway and Proxy Group.
Our first task is to associate a service provider with the Proxy Group, and create and expose a virtual service on the Proxy Gateway:
Click the EAIProxyGatewayProxyGroup row and select the pencil icon at the end of that row.
The Proxy Group view is displayed and all the associated services are listed. Ensure you have deployed the EAI_AccountService file.
In the WSDL Location field, enter http://localhost:9081/EAI_AccountServiceWeb/sca/AccountServiceExport1?wsdl
Click Add Service.
The WSDL will be processed by WebSphere ESB runtime and a subset of the information is displayed, as shown in below figure. Select the Enable Virtual Service check box and click Save.
The widget shows the one virtual service deployed within the Proxy Group.
Test the application:
When we have completed the steps to configure your settings in Business Space, requests can be routed and resolved WSDLs can be returned. This section shows the mechanism of testing the Proxy Gateway using the Web Service Explorer within WebSphere Integration Developer:
In WebSphere Integration Developer, go to Window > Open Perspective > Other > Web.
To start the Web Services Explorer, click Run > Launch Web Services Explorer.
Select the WSDL page icon as shown in below figure.
Click WSDL Main Link. The WSDL page loads.
Enter in the WSDL URL field:
http://localhost:9081/EAIProxyGateway_GatewayWeb/sca/
EAIProxyGateway_GatewayExport_WS_SOAP11/AccountServiceExport1_AccountServiceHttpService?wsdl,
http://localhost:9081/EAIProxyGateway_GatewayWeb/sca/
EAIProxyGateway_GatewayExport_WS_SOAP11/AccountServiceExport1_AccountServiceHttpService?wsdl,
and click Go. This loads the WSDL into the Web Service Explorer.
Click the getAccountDetails operation. Enter a value for the account number and click Go. The expected result is shown below:
Conclusion
Conclusion
This article introduced you to the proxy gateway pattern, which provides a Web service gateway that is fast to build and meets the majority of requirements with an out of the box experience. The article started with an overview of service gateway patterns and then went into detail on the architecture of a proxy gateway. It showed you how the built-in configuration store is administered using Business Space. The development tools provided, specifically the Patterns Explorer used to generate a proxy gateway implementation, was described. An end-to-end example showed you how to build, configure, and test a proxy gateway.
Downloads
File Name
|
Description
|
Size
|
Download
|
Proxy Gateway.zip
|
Proxy Gateway Sample
|
32 KB
| |
Service Gateway in IBM WESB.pdf
|
Service Gateway in IBM WESB Document
|
635 KB
|