The client takes the rank of the matrix as an argument on the command line.
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 is a specification of the matrix class for the magic square (consisting of row vectors) and the RPC function:
class vector
{ public:
int *__ptr;
int __size;
struct soap *soap;
vector();
vector(int n);
~vector();
void resize(int n);
int& operator[](int i);
};
class matrix
{ public:
vector *__ptr;
int __size;
struct soap *soap;
matrix();
matrix(int n, int m);
~matrix();
void resize(int n, int m);
vector& operator[](int i);
};
int ns1__magic(int rank, matrix *result);
|
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 magic magicclient.cpp soapC.cpp soapClient.cpp stdsoap2.cpp