WebSphere Web Services Client for C++, Version 1.0.1 Operating Systems: Linux, Solaris

Client development and deployment

Web Services Client for C++ enables you to manage messaging between a client and web service server.

Web services are based on files called WSDLs, which are XML files containing all the information relating to services that are available at a particular location on the internet. At their simplest level, WSDLs describe request and response message pairs in detail, and contain all the information that is relevant to the web service. The Web Services Client for C++ package provides a Java program, the WSDL2Ws tool. This tool enables you to turn a WSDL into a suite of C++ stubs and data objects that you can call and pass information to, and that request information from the server and then wait for the corresponding reply before passing the response data objects back to the client. The stubs hide the internet communication from the application writer. All you need to know is the name of the service, the method it contains and the structure of any data objects that are passed.

There are two distinct ways of using Web Services Client for C++:

Both of these approaches work well, but the second approach is not recommended because the client application writer has to be more aware of the API and of the communication protocols between the client and server. Also, if changes are required, the writer has to make the changes to the code manually, which is more prone to error. The recommended implementation is to use a WSDL to describe messages and any associated XSD, and then use the WSDL2Ws tool to generate the stubs.

The following three diagrams describe the actions that are required to turn a WSDL into a web service using this recommended implementation of Web Services Client for C++.

Generation of client stubs from WSDL source file

Figure 1 illustrates the first step, which is to convert the WSDL into a set of C++ client stubs that can be called by the client application.

Figure 1. Process flow between WSDL source file and C++ stubs
This diagram shows the first step in the process of turning a WSDL into
a web service, illustrating the process flow between the WSDL source file
and C++ stubs, and showing the WSDL being passed into the WSDL2Ws tool that
generates the stubs.

Communication between client and server applications

As shown in Figure 2, the client application calls a method on a service in the stubs. This method calls a number of underlying methods in the AxisClient library, which generates the SOAP message that communicates with the server.

Figure 2. Process flow between client and server applications using stubs generated by WSDL2Ws
This diagram shows the second step in the process of turning a WSDL source
file into a web service, illustrating the process flow between the client
and server applications using the generated C++ stubs. The client application
calls a method on a service in the stubs, which then calls a number of underlying
methods in the AxisClient library, generating the SOAP message that communicates
with the server.

Addition of web service handlers

You can add web service handlers to the AxisClient library to allow further processing of the SOAP message, either before it is transmitted to the server or after the corresponding reply has been received from the server. The Web Service Deployment Descriptor (WSDD) file controls how handlers are used. Figure 3 is an amended version of Figure 2, showing how handlers can be hooked into the AxisClient library.

Figure 3. Process flow between client and server applications using generated stubs, and request and response handlers
This diagram shows the third step in the process of turning a WSDL into
a web service, illustrating the process flow between the client and server
application when request and response handlers are hooked into the AxisClient
library. The handler definitions are specified in the WSDD file.


Concept topic

Terms of Use | Rate this page

Timestamp iconLast updated: 12 Dec 2005
(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)