Introduction
The MonALISA
Web Service provides an interface for publishing
the monitoring data and farm configuration
using a WSDL/SOAP technology. This way any client can connect and
receive selected data.
It is available in the MonALISA Service and in the Web Repository
(the Web Repository contains data gathered from several ML services).
The Web Service
was developed using
Apache AXIS.
For a detailed description of the Web Service visit the
MonALISA Web Service
page.
Deploying MonALISA as a Web Service
By default the Web Service will not be deployed when you start
the MonALISA
Monitoring Service. If you wish
to start the Web Service
you need to set the following parameters in your ml.properties file:
lia.Monitor.startWSDL=true
lia.Monitor.wsdl_port=6004
You must then restart the MonALISA Service:
cd $MonaLisa_HOME/Service/CMD
ML_SER restart
Firewall Requirement
If you plan to access the Web Service from outside your firewall you must
open TCP port 6004 (or whatever port you have set above) for incoming
requests.
Once the Web Service is running try to access the following URL from
a web browser:
http://your_hostname:6004/axis/services/MLWebService
Web Service Clients
The MonALISA developers provide
Web Service Clients for accessing the monitored data either from
a MonALISA service or from a Web Repositoty. Three different types of
clients
were developed: One based on
Apache AXIS, one on
Apache WSIF and one on
Perl SOAP:Lite modules.
All three clients are in a single tar file which can be
downloaded from
here.
To deploy the clients download the latest tar file
(currently monalisaWSClients-1.0.1.tar.gz) on
the host from which you plan to access the MonALISA Web Service and
untar it. Go to the created monalisaWSClients directory
and run the script install.sh. It will prompt you for the
Web Service URL which will be
stored in a file ./conf/env.MONALISA_WS. This URL will be
used as the default Web Service URL by all clients. Running the
script will also create ./conf/env.JAVA_HOME.
In my case I have set:
[stratos@salonica monalisaWSClients]$ ./install.sh
Please enter the MonALISA Web Services URL : http://salonica.itd.bnl.gov:6004/axis/services/MLWebService
Configuration completed successfully.
You must then decide which clients to use. You have three choices:
The Java-Axis clients, the WSIF clients or the Perl SOAP::LITE clients.
Using the JAVA-AXIS Clients
To use the Java-Axis Clients go to WS-Clients/Java-Axis directory.
There you should find a couple of subdirectories,
each for a different operation (getValues, getConfiguration).
Go to one of them and run the generate_classes script:
cd getValues
./generate_classes
The script generate_classes invokes the WSDL2Java utility
to access the WSDL file of the Web Service and create
the Java packages that are needed (under ./lia/ws/ and ./ws/lia/).
Then run compile_classes to compile the Java classes, including
the provided Client.java class:
./compile_classes
You are now ready to run run_client (with the appropriate options)
to invoke the MonALISA Web Service. The availaible options for the
run_client script are listed in the Readme file, but basically
the format has as follows:
./run_client FarmUnit ClusterUnit Host Parameter FromTime ToTime
the FromTime and ToTime above are in milliseconds.
Example
cd monalisaWSClients/WS-Clients/Java-Axis/getValues
./run_client "bnl-itd" "Master" "localhost" "Load5" -600000 0
Use my version of the Java-Axis Client
Here I provide a Java class (myClient.java) which can be used instead
of the Client.java class provided by monalisaWSClients.tar.gz. To
download it click here: myClient.java
Using the Perl SOAP::Lite Clients
To use the Perl clients go to WS_Clients/Perl. The first thing you need to do
is install two Perl Modules SOAP::LITE and TIME::HIRES. Two scripts
install_soap_lite and install_time_hiref are provided
that will install these two modules. The scripts must be run by root.
You should then go to one of the subdirectories (getValues or
getConfiguration) and execute the perl script Client.pl
Example
./Client.pl "bnl-itd" "Master" "localhost" "Load5" -600000 0
The arguments are the same with those used in the Java-Axis Clients.
Using the Java-Axis Clients on Windows
On a Windows machine, instead of running the script
generate_classes, you can invoke the WSDL2Java utility manually
(provided that you have Java and AXIS installed):
java -cp C:\axis-1_1\lib\axis.jar;C:\axis-1_1\lib\axis-ant.jar;
C:\axis-1_1\lib\commons-discovery.jar;
C:\axis-1_1\lib\commons-logging.jar;
C:\axis-1_1\lib\jaxrpc.jar;
C:\axis-1_1\lib\log4j-1.2.8.jar;
C:\axis-1_1\lib\saaj.jar;
C:\axis-1_1\lib\wsdl4j.jar
org.apache.axis.wsdl.WSDL2Java -v -o MonaLisa
http://salonica.itd.bnl.gov:6004/axis/services/MLWebService?wsdl
Parsing XML file: http://salonica.itd.bnl.gov:6004/axis/services/MLWebService?w
sdl
Generating MonaLisa\lia\ws\WSNode.java
Generating MonaLisa\lia\ws\Result.java
Generating MonaLisa\lia\ws\WSConf.java
Generating MonaLisa\lia\ws\WSFarm.java
Generating MonaLisa\lia\ws\WSCluster.java
Generating MonaLisa\ws\lia\MLWebServiceService.java
Generating MonaLisa\ws\lia\MLWebServiceServiceLocator.java
Generating MonaLisa\ws\lia\MLWebService.java
Generating MonaLisa\ws\lia\MLWebServiceSoapBindingStub.java
The above creates the necessary Java packages under the directory MonaLisa
(the -o option).
Copy either Client.java or
myClient.java
in the MonaLisa directory, compile it
using javac and you are ready.
Current Issues with the MonALISA Web Service
I currently have the following two issues with the MonALISA Web Service
(I am using the version v1.0.1 of the MonALISA Service and version 1.0.1
of the Web Service Clients):
- The Web Service does not start if you are using a Web proxy and
you have set JAVA_OPTS="-Dhttp.proxyHost=192.168.1.3 -Dhttp.proxyPort=3128"
The above issue has been resolved as of version v1.0.6
- The Web Service Clients get null values for all properties of the
Result objects returned by the Web Service.
The above issue has been resolved as of version v1.0.2
Stratos Efstathiadis - page was last modified