This module provides base routines and data structures used throughout the rest of the GROWL library. For convenience we will also describe in this chapter the procedure used to create the various WSDL and XML files, headers and code stubs which will appear in the $(GROWL)/include directory.
Version: 1.0
Public calls: none
Public modules: libbase.a, libgrowl.a
Other modules required: gSOAP v2.1.4
Date: 2004
Origin: Hand-Knitted Software, R.J. Allan, CCLRC Daresbury Laboratory
Language: C
Conditions on external use: Standard, see separate chapter
This module is used by including the $(GROWL)/lib/libgrowl.a library or the library $(GROWL)/Base/lib/libbase.a. It is not used on its own and there are no callable procedures. It is included in the makefiles for the other user packages.
A sample of the $(GROWL)/include/growl_namespaces.h file which lists the remote methods is shown here:
[frame=single]
//gsoap Resources service name: Resources
//gsoap Resources schema namespace: http://InfoPortal/Resources
int Resources__xmlDescription(char *xmlDescriptionRequest,
char **xmlDescriptionResponse);
int Resources__mdsLast(char *mdsLastRequest, char **mdsLastResponse);
int Resources__xmlAll(char **mdsAllResponse);
int Resources__machineList(char **mdsAllResponse);
//gsoap Authentication service name: Authentication
//gsoap Authentication schema namespace: http://HPCPortal/Authentication
int Authentication__getDelegation(char *uid, char *passPrase, int ttl,
char *oldId, char **sessionId);
int Authentication__testDelegation(char *oldId, char **sessionId);
int Authentication__rmDelegation(char *oldId, char **response);
//gsoap Jobs service name: Jobs
//gsoap Jobs schema namespace: http://HPCPortal/Jobs
int Jobs__jobRun(char *sessionId, char *target, char *directory,
char *environment, char *executable,
char *arguments, char **response);
//gsoap Transfer service name: Transfer
//gsoap Transfer schema namespace: http://HPCPortal/Transfer
int Transfer__gridFTP(char *sessionId, char *source, char *sname,
char *target, char *tname, char **response);
//gsoap R service name: R
//gsoap R schema namespace: http://R/R
int R__testR(char *input1, char *input2, char **testRResponse);
int R__rCommand(char *command, char *input1, char *input2,
char **rCommandResponse);
This file is processed by the gSOAP compiler to create WSDL files. XML files with sample request and result strings for all methods and code stubs and headers required to build the rest of the library are also poduced. This is achieved simply by the command
$(GSOAPDIR)/soapcpp2 -c growl_namespaces.h
Please bear in mind that there is no publish-discover mechanism yet in GROWL as there is in some other Web service frameworks, so remote method information is hard coded like this. We are reviewing the use of a local UDDI registry to make this more flexible [#!UDDI!#].
Note we have used different service names for each module to create a separate WSDL file for each one. This is important if the endpoints are different, but is really an issue for the service rather than the client end. Separate namespace mapping files are then also created. Because all these these namespace map files are equivalent, so one of them is copied to Growl.nsmap. The source is then contained in namespaces.c.
[frame=single] #include "growl.h" #include "soapH.h" #include "Growl.nsmap"
The makefile simply builds a namsspace map and associated structure required in the other modules. It is built separately to avoid duplicate entries in the libgrowl.a libary. It library object is namespaces.o.
The separate header file $(GROWL)/include/growl.h is provided for convenience. It contains advance declarations of all the local GROWL library routines which are callable by the user. A sample is shown:
[frame=single] # ones from InfoPortal #include 'growl_resources.h' # ones from HPCPortal #include 'growl_authentication.h' #include 'growl_jobs.h' #include 'growl_ftp.h' # ones from R #include 'growl_r.h'
Each included file is for a specific set of functions which share a common server endpoint (a GROWL module). This allows a certain amount of configuration as the server can be easily specified at compile time. The following example shows the growl_r.h file with the single remote test methods testR and rCommand.
[frame=single] // Web cache information #include "webcache.h" // SOAP endpoint for R Web service despatcher #define growl_server "http://tardis.dl.ac.uk/R/SOAP/modules/GROWL.cgi" // function prototypes int growl_testR(char *input1, char *input2, char **result); int growl_rCommand(char *command, char *input1, char *input2, char **result);