- OVERVIEW
The available SOAP interface is an initial effort to provide modelling services across the web. The current implementation is only a prototype, therefore results are still far from a production release.
The implementation is completely based on gSOAP v2.5 (http://gsoap2.sourceforge.net) and has only been tested with Linux. gSOAP seems to be compliant with "Windows, Unix, Linux, Pocket PC, Mac OS X, TRU64, VxWorks, etc". However, parts of the openModeller SOAP server code are not prepared to run in other platforms - these parts include sigpipe handling (if multi-threading is enabled), unique temporary file name generator (mkstemp function), and process forking.
Note: although the SOAP server is already prepared to run as a multi-threaded daemon server, openModeller is not!!
CURRENT FUNCTIONALITY:
- Server can run as a CGI application, stand alone server (daemon), or multi-threaded server.
- Server can handle getAlgorithms requests (returning metadata about all available algorithms).
- Server can handle createModel requests (which is now actually generating distribution maps).
- Server can handle getDistributionMap requests (returning maps as DIME attachments).
- A simple command line perl client is available (depends on
SOAP::Lite)
- COMPILING
By default the SOAP server is not compiled. To enable it:
./configure --enable-soap
make
Note: gSOAP doesn't need to be installed to run openModeller's SOAP server - all necessary files are included in the distribution.
USE INSTRUCTIONS:
- First you will need to set an environment variable called OM_SOAP_TMPDIR indicating where the distribution maps, tickets, and log file should be generated. For instance:
Using bash:
export OM_SOAP_TMPDIR=/tmp/om
Using tcsh:
setenv OM_SOAP_TMPDIR /tmp/om
- To run the server as a CGI application, just put it inside an
accessible cgi-bin directory:
cp om_soap_server /var/www/cgi-bin/om_soap_server.cgi
- To run the server as a stand alone non-multi-threaded service,
just start it passing as a parameter the port number and then
another parameter indicating the number of threads (=1):
./om_soap_server 8085 1 &
- To run the server as a stand alone multi-threaded service, just
start it passing as a parameter the port number and then another
parameter indicating the number of threads (>1).
./om_soap_server 8085 10 &
- Run the client to test your server (you'll need perl and the
SOAP::Lite module):
./sampleClient.pl --server=http://localhost:8085/
For more options, use:
./sampleClient.pl --help
TODO-LIST:
- Use the ticket file as a log file.
- Move distribution map creation to a new method createMap.
- Implement getModel.
- Synchronize request/response XML structures with format used in model serialization.
- Get available layers from a layer server.
- Accept input layers from remote machines.
- Implement getFileFormats (need changes in openModeller).
- Implement garbage collecttion for distribution maps.
- Implement sigpipe handler.
- Find portable and better solution to unique temporary files.
- Find a way to track progress of model generation.
- MAINTENANCE
- To change anything in the SOAP interface it is necessary to have gSOAP installed.
- To generate the SOAP stubs and skeletons use:
soapcpp2 om_soap.hh
- To activate server debug logging, add -DDEBUG in the beginning of om_soap_server_CPPFLAGS in Makefile.am
