344 Patterns: Implementing Self-Service in an SOA Environment
10.7.7 Update the Web service clients to use the bus
This section describes how to regenerate the Web service client code we
generated earlier in “Creating an EJB Web service client” on page 317, this time
using WSDL generated for the Web service at the bus.
This changes the following:
򐂰 Endpoint address
The endpoint address used by Web service consumers to invoke a Web
service provider will change to invoke the inbound service on the bus rather
than the provider directly.
򐂰 WSDL name space
By going through the service integration bus, the WSDL definition namespace
changes. This requires that we regenerate the Web service client stubs and
the service references in our J2EE applications. It does not affect the
in-transit SOAP message.
When an inbound service is exported from WebSphere Application Server, it is
packaged in a ZIP file. The ZIP file contains four WSDL files. Each WSDL file
describes a portion of the service.
Assuming that our sample bus is called ITSOMartBus and the service we are
looking at is called CreditCheckInboundService, these files are named:
򐂰 ITSOMartBus.CreditCheckInboundServiceBindings.wsdl
Defines the binding and transport for each operation in the service.
򐂰 ITSOMartBus.CreditCheckInboundServicePortTypes.wsdl
Imports the port type, operations, and messages for the service from an
HTTP server.
򐂰 ITSOMartBus.CreditCheckInboundServiceService.wsdl
Defines the service and port for the service.
򐂰 ITSOMartBus.CreditCheckInboundServiceNonBound.wsdl
Imports a port type and defines a non-specific binding and service. Not used
in this scenario.
Note: Ensure the WebSphere Application Server V6 unit test environment is
started prior to completing these steps. Check this by examining the status of
the server in the Servers view of the J2EE perspective.
Chapter 10. Web services scenario 345
Import the generated WSDL
The WSDL files generated by WebSphere Application Server for the inbound
services have to be imported into your workspace.
To import the CreditCheckInboundService WSDL, perform the following tasks:
1. In the workbench select File Import.
2. The import dialog box is shown. Scroll down. select Zip file, and click Next.
3. In the next panel:
a. Specify the location of the zip file containing the WSDL by either entering
the path into the pull-down box labelled From zip file or by clicking Browse
and selecting the file form the file dialog box.
b. In the right panel uncheck the box labelled
ITSOMartBus.CreditCheckInboundServiceNonbound.wsdl.
c. Select the project into which to import the WSDL files. Click Browse and
expand CreditCheckClient ejbModule META-INF, select wsdl, and
click OK.
d. Click Finish to import the files.
4. Repeat these steps to import the HomeDeliveryInboundService WSDL into
the ClientDelivery project.
Create the namespace mapping files
When you generate a Web service client, Rational Software Architect creates
Java class implementations of all the XSD components defined by the Web
service. The name of each Java class is derived from the name of the XSD
component. The package name of each Java class is derived from the
namespace of the XSD component.
The Java package name is based on the host part of the namespace name. For
example, an XSD component that belongs to the package:
http://www.ibm.com/CreditCheck.wsdl
Would be stored in a Java package called:
www.ibm.com
It is common to have multiple namespaces defined with a common host part.
Examples include www.ws-i.org, www.w3c.org and schemas.xmlsoap.org. It is
Note: Certain characters that are valid in a host part of a URI are not valid in a
package name, such as a dash (-) character. In these cases those characters
will be mapped to a different character.

Get Patterns: Implementing Self-Service in an SOA Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.