Test Client for Factory Server

This example gSOAP client defines proxy classes for the remote object factory server.

Step 1: the Main Program

We wrote the test client program for you. This client implements proxy classes for the remote adder (base class) and counter (derived class) objects defined by the remote factory. Click here to get the source for gSOAP 2.1.7 and higher and select "File - Save As" from your browser's menu. Save this file as factorytest.cpp.

Step 2: Generate the SOAP Stub Routines with the gSOAP Compiler

Before you can compile and run your program, you need to generate C/C++ sources using our gSOAP compiler. The input to the gSOAP compiler is a header file. Click here to get the header file specification Save this file as factorytest.h.

Now use the gSOAP compiler to process the header file:

soapcpp2 factorytest.h
Visit the gSOAP download page to obtain the gSOAP toolkit.

Step 3: Compile Your Server App

Compile the sources. For example, in Linux the command to compile is:
g++ -o factorytest factorytest.cpp soapC.cpp soapClient.cpp stdsoap2.cpp
The files soapC.cpp and soapClient.cpp are generated by soapcpp2. File stdsoap2.cpp consists of the gSOAP runtime library.

Step 4: Try it Out

Obtain and compile the remote object server first. Start the server in one window listening to a port, e.g. 18085:
factory 18085
Run the client test program in another window:
factorytest http://localhost:18085