WCT as a Web Service

The WCT tool besides the command line execution can also be invoked through a web service. Below is a description of enabling the tool as a web service and a simple example of its use.

Deploying using Tomcat

The WCT software can be published as a web service endpoint and be enhanced with its interoperability advantages. The framework used as the SOAP protocol implementation is Axis and all necessary libraries are distributed with the WCT distribution as a ready-to-use war file (wct.war). Therefore no additional Axis installation is needed. The described installation is specific for the Tomcat web server (Tomcat Page) and it was tested with the 5.5.17 version of Tomcat distribution.

To deploy the war file simply copy it to the web application directory of the Tomcat server (usually $CATALINA_HOME/webapps). If the Tomcat is configured to automatically load war contents the application should be available through address http://localhost:8080/wct of a standard Tomcat installation (if not, please change the address according to you local Tomcat configuration). The browser should display two links which navigate to Execution and Configuration servlets. To activate the web service endpoint Axis framework needs to be notified by using the admin client. This can be done using the following command:

java -classpath $AXIS_CLASSPATH \
	org.apache.axis.client.AdminClient \
	-s/wct/services/AxisServlet deploy-wct.wsdd
        

The $AXIS_CLASSPATH points to all necessary jar files needed by the framework. They can be obtained from the Axis project page (http://ws.apache.org/axis/java/releases.html) or extracted from the wct.jar file. The deploy-wct.wsdd is the deployment descriptor file and is distributed together with the WCT package.

To check if the WCT web service is operational use the following address:

http://localhost:8080/wct/services/IWfConstructionService?wsdl

This should result in a wsdl xml file of the WCT service.

Testing the Web Service

To use the WCT web service using the Axis framework a proper client code has to be executed. Such client is implemented as one of the WCT's classes and can be used by invoking the following command:

java -classpath wct-x.x.x.jar:$AXIS_CLASSPATH \
	net.kwfgrid.wct.client.WctClient workflow-file.xml \
	http://localhost:8080/wct/services/IWfConstructionService \
	http://localhost:8080/wct/services/IWfConstructionService \
	composeAbstractWorkflow CTM
      	

There are 4 arguments which need to be provided for successful client execution. First is the workflow file name, second is the web service endpoint address, then web service namespace needs to be specified and operation name as the third and fourth argument. The fifth optional argument is a semicolon separated list of virtual organization names.

If one would like to implement their own web service client plaese refer to the Axis Homepage for guidance or to any other SOAP protocol implementor.