Level: Introductory Bob O’Hanlon (bob_ohanlon@uk.ibm.com), Staff Software Engineer, IBM
23 Feb 2005 Updated 26 Jul 2005 This article is describes how to create a Web services gateway, configure existing back-end Web services, and then test
their invocation over the SOAP/HTTP protocol in IBM® WebSphere® Application Server V6.
Overview
The Web services gateway available in WebSphere Application Server V5, has been re-based on the Service Integration Bus (hereafter referred to as Bus) and Web services enablement in V6. The gateway is essentially a tool that gives administrators an easy way to map Web services across the Bus. It enables the mapping of different protocols. In this article, one protocol (SOAP/HTTP) is used for the Web service invocation. A SOAP/HTTP request comes into the gateway and is then re-targeted to an external service, also over SOAP/HTTP. This article guides you through the process of creating a gateway service.
The configuration
The planned configuration is shown in Figure 1. The diagram depicts how request and response messages flow through the Bus, and highlights the different steps required for configuring a gateway service, as follows:
- Create an endpoint listener and reply destination and connect it to the Bus.
- Create a gateway instance on the Bus.
- Create a gateway service on the gateway instance, including creating and configuring:
- Request and response destinations for the gateway
- An outbound service and an outbound service destination
- An outbound port and an outbound port destination
- An inbound port
Figure 1. Overview of the planned configuration
We'll complete the configuration using the Application Server administration console. This article assumes you've already configured a Bus and completed the steps in the SIBWS - Completing the installation in the WebSphere Application Server Information Center. In this article, we'll use DeveloperWorksBus as the SIBus name.
Create an endpoint listener
The endpoint listener is the entry point for your SOAP/HTTP message into the gateway. You'll need to configure the listener before you create your gateway service.
- From the administration console navigation pane, select Servers => Application servers.
- In the content pane, select
server_name
.
- Under Additional Properties, select Endpoint Listeners => New.
Figure 2. Configuring an endpoint listener
- On the Endpoint Listeners page, specify the following values:
-
Name:
SOAPHTTPChannel1
-
URL Root:
http://host_name:port_number/wsgwsoaphttp1/. This will be the context route of the service endpoint.
-
WSDL serving HTTP URL Root:
http://host_name:port_number/sibws. This will be the context route of the WSDL address.
- Click OK.
- Select the endpoint listener SOAPHTTPChannel1.
- Under Additional Properties, select Connection Properties.
- Select New, then select DeveloperWorksBus
- Click OK, then save the configuration.
Create a gateway instance
The gateway instance provides you with a single point of administration for your Web service requests, where access to Web services can be enabled and controlled for selected users. Before you can create a gateway service, you have to create the gateway instance.
- From the administration console navigation pane, select Service integration => Buses.
- In the content pane, select DeveloperWorksBus.
- Under Additional Properties, select Web service gateway instances.
- On the Web service gateway instances page, select New.
Figure 3. Creating the gateway instance
- On the Web service gateway instances creation page, specify the following values:
-
Name:
DeveloperWorksGateway. (This is an arbitrary name chosen for this article; you can name your gateway as you wish.)
-
Gateway namespace:
http://developer.works. (Again, this is an arbitrary name; you can supply your own namespace specific to this gateway instance.)
-
Default proxy WSDL URL:
http://host_name:port_number/sibws/proxywsdl/ProxyServiceTemplate.wsdl. This is the default proxy WSDL supplied.
- Apply and save your changes.
Create a gateway service
When you create a gateway service, you need to associate it with a single external service. You do this by supplying the external service WSDL when creating the gateway service. The gateway service is created from within the administrative functions of a gateway instance. If you are using the sample supplied with this article, you'll need to install the application StringService.ear.
- From the navigation pane, select Service integration => Buses.
- In the content pane, select
DeveloperWorksBus.
- Under Additional Properties, select Web service gateway instances.
- On the Web service gateway instances page, select DeveloperWorksGateway.
- On the DeveloperWorksGateway page, under Additional Properties, select Gateway services.
- On the Gateway services page, select New.
- Select WSDL-defined Web service provider as the type of target service.
- Click Next. The New Gateway Service wizard opens. The following sections describe how to complete the wizard to create a gateway service.
Step 1: Specify gateway service and destination names
In this step, we'll specify names for the gateway service and destinations.
Figure 4. Specify gateway service and destination names
- Enter these values:
-
Gateway service name:
DeveloperWorksGatewayService. (This is an arbitrary name; you can name your gateway service as you wish.)
-
Gateway request destination name:
DWGSRequestDestination.
This destination processes request messages for the gateway.
-
Gateway response destination name:
DWGSResponseDestination.
This destination processes response messages for the gateway.
(Gateway response and request destination names are arbitrary.)
Note: In Application Server, a destination is defined as a virtual location within a service integration bus, to which applications attach as producers, consumers, or both to exchange messages.
We're not using mediations, so only the above values are required.
- Click Next.
Step 2: Locate the target service WSDL
In this step, we'll supply the external service WSDL address.
Figure 5. Locating the target service WSDL
- Enter these values:
-
WSDL location type:
URL
-
WSDL location: The WSDL URL or the WSDL file that you want to use. If you're using the sample application, the URL is:
http://host_name:port_number/StringService/wsdl/stringService.wsdl
- Click Next.
Step 3: Select the service
In this step, we'll select the service in the WSDL we want to configure. The sample application WSDL has only one service, which is selected by default.
Figure 6. Select the service
Click Next.
Step 4: Select ports
In this step, we'll select the port in the WSDL we want to configure. The sample application WSDL has only one port.
Figure 7. Select ports
Select the default port and click Next.
Step 5: Name the service and port destinations
In this step, we'll set up the external service as an outbound service, and associate its destination with the gateway request and reply destinations we created in step 1. The wizard sets some defaults for you on this page based on the WSDL. You can override these values as desired.
Figure 8. Name service and port destinations
- If you are using the sample application, enter these values:
-
Outbound service name:
StringServiceOutboundService
-
Service destination name:
StringServiceOutboundServiceDestination
-
Port destination name:
StringServiceOutboundPortDestination
- Click Next.
Step 6: Select points for service and port destinations
In this step, we'll select the Bus member to use. (When you initially created your Bus, you would have added the server to the Bus in order for it to become a Bus member.).
Figure 9. Select points for service and port destinations
Select the Bus member and click Next.
Step 7: Select endpoint listeners
In this step, we'll specify the endpoint listener we created earlier, SOAPHTTPChannel1.
Figure 10. Select endpoint listeners
Click Next.
Step 8: Define UDDI publication properties
If you want to publish the service to a UDDI, you can do so in this step.
Figure 11. Define UDDI publication properties
Select Finish and save your changes.
Test the gateway service
We've now finished configuring our gateway service and are ready to test it. As in previous releases, the gateway has generated some new WSDL that can be exposed to service requesters. If you're using the sample, you can view the WSDL interface at this address: http://host_name:port_number/sibws/wsdl/DeveloperWorksBus/DeveloperWorksGatewayService
You can view the WSDL binding and port type definitions by appending ?wsdl=bindings or ?wsdl=porttypes to this URL respectively.
If you're using the sample client, you can derive from the WSDL interface and bindings the required parameters for a Dynamic Invocation Interface (DII) JAX-RPC invocation of this gateway service, as follows:
-
Operation namespace:
http://service.string
-
Service namespace:
http://developer.works/Service
-
Endpoint:
http://host_name:port_number/wsgwsoaphttp1/soaphttpengine/DeveloperWorksBus/
DeveloperWorksGatewayService/SOAPHTTPChannel1InboundPort
Test the gateway service using the stringClient with these parameters:
java stringClient <Endpoint_Address> <Operation_Namespace> <Service_Namespace> <string> |
The client sends a string, and the service should successfully return the string you sent.
Conclusion
We've now used the Web services gateway to enable an existing Web service as a destination in the Bus and then exposed that destination as a gateway Web service using the wizard. As you worked through the wizard, all the configuration artifacts were created and configured for you. You can achieve the same results by separately configuring outbound and inbound services and ports in the Application Server administration console, but the method shown here is much simpler. In addition you now have the benefits of using a gateway service.
Download | Description | Name | Size | Download method |
|---|
| sample code | DevWorks_Gateway_Sample.zip | 1.6 KB | FTP | HTTP |
|---|
Resources
About the author  | 
|  | Bob O'Hanlon works in IBM Web Services Test in Hursley, England. He has been responsible for testing the Web services gateway since its initial emergence as a technical preview in WebSphere Application Server V4. He has contributed to the Application Server V5 and V6 Information Centers. |
Rate this page
|