Step 3: Configuring the deployment in WSDD

Up to this point, we have written the two most important parts of a Grid Service: the service interface (GWSDL) and the service implementation (Java). Now, we somehow have to put all these pieces together, and make them available through a Grid Services-enabled web server! This step is called the deployment of the Grid Service.

One of the key components of the deployment phase is a file called the deployment descriptor. It's the file that tells the web server how it should publish our Grid Service (for example, telling it what the our service's GSH will be). The deployment descriptor is written in WSDD format (Web Service Deployment Descriptor). The deployment descriptor for our Grid Service could be something like this:

<?xml version="1.0"?>
<deployment name="defaultServerConfig" xmlns="http://xml.apache.org/axis/wsdd/"
  xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <service name="progtutorial/core/first/MathService" provider="Handler" style="wrapped">
    <parameter name="name" value="MathService"/>
    <parameter name="className" value="org.globus.progtutorial.stubs.MathService.MathPortType"/>
    
    <parameter name="baseClassName" value="org.globus.progtutorial.services.core.first.impl.MathImpl"/>
    <parameter name="schemaPath" value="schema/progtutorial/MathService/Math_service.wsdl"/>

    <!-- Start common parameters -->
    <parameter name="allowedMethods" value="*"/>
    <parameter name="persistent" value="true"/>
    <parameter name="handlerClass" value="org.globus.ogsa.handlers.RPCURIProvider"/>
  </service>

</deployment>
[Note]

This file is $TUTORIAL_DIR/org/globus/progtutorial/services/core/first/server-deploy.wsdd. If you're using the provided example files, you'll notice there is an extra <service> tag. You can safely ignore it for now. It will be explained later on.

Let's take a close look at what all this means...

The 'service name'

<service name="progtutorial/core/first/MathService" provider="Handler" style="wrapped">

This specifies the location where our Grid Service will be found. If we combine this with the base address of our Grid Service container, we will get the full GSH of our Grid Service. For example, if we are using the GT3 standalone container, the base URL will probably be http://localhost:8080/ogsa/services. Therefore, our service's GSH would be:

http://localhost:8080/ogsa/services/progtutorial/core/first/MathService

The 'service name' (again)

<parameter name="name" value="MathService"/>

Although this might seem confusing, the <service> element has both a name attribute (the one seen above) and name parameter. The parameter simply contains a brief description of the service (e.g."MathService")

className and baseClassName

<parameter name="className" value="org.globus.progtutorial.stubs.MathService.MathPortType"/>
<parameter name="baseClassName" value="org.globus.progtutorial.services.core.first.impl.MathImpl"/>

In strict WSDD, this parameter would refers to the class which implements the service interface (in our case, MathImpl from the previous page). However, notice how the value of this parameter is the MathPortType stub interface mentioned in the previous page.

Since Grid Services are a tad more complex that plain web services, it's necessary to distinguish between the className and the baseClassName. The className refers to the interface that exposes all the functionality of the grid service (MathPortType), and baseClassName is the class that provides the implementation for our grid service. In our case, baseClassName is the MathImpl class we implemented in the previous page. When we see operation providers (in the next section) we'll see that the baseClassName doesn't need to include an implementation for all the methods exposed in the className (we'll see that it's possible to delegate some or all of the our methods to special classes called operation providers)

The WSDL file

<parameter name="schemaPath" value="schema/progtutorial/MathService/Math_service.wsdl"/>

The schemaPath tells the grid services container where the WSDL file for this service can be found. No, that's not a typo, I said WSDL, not GWSDL. Remember that GWSDL is a (non-standard) extension of WSDL, so it must first be converted to WSDL so it can be truly interoperable with existing web services technologies. This WSDL file (Math_service.wsdl) will be generated automatically by a GT3 tool when we compile the service.

The common parameters

<!-- Start common parameters -->
<parameter name="allowedMethods" value="*"/>
<parameter name="persistent" value="true"/>
<parameter name="handlerClass" value="org.globus.ogsa.handlers.RPCURIProvider"/>

These are three parameters which we'll see in every grid service we program.