BACK TO MAIN PAGE

Remote Object Factory and Simple ORB Server

This example gSOAP server provides a platform-independent remote object factory and simple ORB.

Step 1: the Main Program

We wrote the main server program for you. This server implements adder (base class) and counter (derived class) remote objects for remote addition and counting as an example. Adding your own classes should be straight forward. A lease-based model is used for object management. Objects can be remotely instantiated by clients and the lease is extended with every remote method invocation. Objects are purged from the object pool after their lease expires (after a certain idle time). 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 factory.cpp.

Step 2: Generate the SOAP Skeleton 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 factory.h.

Now use the gSOAP compiler to process the header file:

soapcpp2 factory.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 factory factory.cpp soapC.cpp soapServer.cpp stdsoap2.cpp
The files soapC.cpp and soapServer.cpp are generated by soapcpp2. File stdsoap2.cpp consists of the gSOAP runtime library.

Step 4: Try it Out

Get the client test program (factorytest.cpp) to test the server.