The client program needs three arguments: an integer, an operator (+, -, *, or /), and an integer. For example, "calc 1 + 2".
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. For this example, the input to the compiler for this example are just the function prototypes
//gsoap ns service style: rpc //gsoap ns service encoding: encoded int ns__add(int a, int b, int *result); int ns__subtract(int a, int b, int *result); int ns__multiply(int a, int b, int *result); int ns__divide(int a, int b, int *result);which is sufficient to generate all the C/C++ sources necessary to build your client!
The method names are "Add", "Subtract", "Multiply", and "Divide". Integers "a", "b", and "result" are arguments that correspond to the request ("a" and "b") and response ("result") XML schema definitions of the service.
To generate the sources, click here to use our SOAP Stub Compiler. This will produce a web page containing the C/C++ sources for:
soapStub.h soapH.h soapC.cpp soapClient.cpp soapServer.cppYou 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.
g++ -o calc calc.c soapC.cpp soapClient.cpp stdsoap2.cpp