Glossary Client Example

This example shows you how to create a client that will interact with Luhala's Glossary service to provide you with a list of word definitions and synonyms.

The client program needs one argument: a word. The program prints a list of word definitions and synonyms.

Step 1: Write the Main Program

We wrote an example client program for you: click here and select "File - Save As" from your browser's menu.

Step 2: Generate the SOAP Stub Routines

Before you can compile and run your  program, you must generate C/C++ sources using our stub compiler. The generated sources take care of the SOAP serialization and deserialization of the data required to access the SOAP service.

The input to our stub compiler is a specification of the names of the SOAP methods (with optional namespaces) and the data structures given as C/C++ declarations. You can get this header file specification here.

To generate the sources, click here to use our SOAP Stub Compiler (sorry, this is not working yet: please get the compiler from the download page). This will produce a web page containing the C/C++ sources for:

soapStub.h
soapH.h
soapC.cpp
soapClient.cpp
soapServer.cpp
You need to save these sources to your local drive under the file names as indicated.

Two files are not generated but are required to build your application: stdsoap2.h and stdsoap2.cpp. Save these files to your local drive too.

Step 3: Compiling Your Client App

Compile the sources. For example, in Linux the command to compile would be:
g++ -o glossary glossary.cpp soapC.cpp soapClient.cpp stdsoap2.cpp

Step 4: Try it Out

Execute the command "glossary test"