list archives . users mailing list

Subject: Re: adding new porttype to Grid Data Service

Date view Thread view Subject view Author view Attachment view

From: M.Jackson (michaelj@epcc.ed.ac.uk)
Date: Jun 10, 2003 08:35

Hi Gurmeet,

> Yes we intend to upgrade to OGSA-DAI release 2.5 . I have one doubt. If
> I want to extend the functionality of OGSA-DAI should I go about adding
> a new porttype or extend the activity map to do my specific functions.
> Which would be more easier to implement and integrate with future
> OGSA-DAI releases.

Apologies for the delayed reply. Unfortunately in answer to your question
the activity of extending OGSA-DAI to provide a new portType is
non-trivial and would require:

Editing our GDS source code
OR
Creating a new GDS class + Editing our GDSF code.

However, for your information I include instructions below to get you as
far as generating code from GWSDL.

Adding a new activity may be an easier option. If you could submit a new
query to the list the appropriate experts will be in touch.

Regards

mike

These instructions apply to OGSA-DAI 2.5 and Globus Toolkit 3 Alpha
4. Some aspects have changed for Globus Toolkit 3 Beta - in relation to
GWSDL->WSDL->Java activities but the basic principles remain the same. You
should consult the Globus documentation for more info on these activities.

Pre-requisites:

-Downloaded version of Globus Toolkit 3 Alpha 4.
-ANT_HOME environment variable set to directory of your ANT
 distribution
-PATH environment variable includes ANT_HOME/bin

There follows an example GWSDL file which extends the GridDataService
portType [which extends both GridDataPort and GridDataTransportPort
portTypes]. This defines a new portType "MikesNewPort" with an operation
"sampleOp":

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="NewPort"
  <!-- Namespace for the new portType -->
  targetNamespace="http://some.url/someService/mikesNewPort"
  xmlns:mikesptns="http://some.url/someService/mikesNewPort"
  <!-- Namespace for types required by the new portType -->
  xmlns:sampletypes="http://some.url/sampleSchemas"
  xmlns:gds="http://ogsadai.org.uk/service/gds"
  xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI"
  xmlns:gwsdl="http://www.gridforum.org/namespaces/2003/03/gridWSDLExtensions"
  xmlns:sd="http://www.gridforum.org/namespaces/2003/03/serviceData"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://schemas.xmlsoap.org/wsdl/">

  <import namespace="http://ogsadai.org.uk/service/gds"
          location="../gds/grid_data_service.gwsdl"/>
  <import location="../../ogsi/ogsi.gwsdl"
          namespace="http://www.gridforum.org/namespaces/2003/03/OGSI"/>

  <!-- Define types for input and output messages -->
  <types>
    <xsd:schema targetNamespace="http://some.url/sampleSchemas"
     xmlns:tns="http://some.url/sampleSchemas"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI">
      <xsd:element name="sampleInput">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="someInput" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="sampleOutput">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="someOutput" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </types>

  <message name="SampleInputMessage">
    <part name="parameters" element="sampletypes:sampleInput"/>
  </message>
  <message name="SampleOutputMessage">
    <part name="parameters" element="sampletypes:sampleOutput"/>
  </message>

  <gwsdl:portType name="MikesNewPort" extends="gds:GridDataServicePort">
    <operation name="sampleOp">
      <input message="mikesptns:SampleInputMessage"/>
      <output message="mikesptns:SampleOutputMessage"/>
      <fault name="Fault" message="ogsi:FaultMessage"/>
    </operation>
  </gwsdl:portType>
</definitions>

You can generate code from this example as follows:

-Place the contents of the <OGSA-DAI>/src/xml file within a new
 <GLOBUS-BINARY>/schema/ogsadai directory.
 where <GLOBUS-BINARY> is the directory of the Globus distribution that
 contains the "build-services.xml" ANT script.

-Place the above file in a new directory
 <GLOBUS-BINARY>/schema/ogsadai/ogsadai-extension.

-Create a file <GLOBUS-BINARY>/schema/NStoPkg.properties with the
 following content:

http\://ogsa.globus.org/security/authentication/types=org.globus.ogsa.security.authentication
http\://ogsa.globus.org/security/authentication/bindings=org.globus.ogsa.security.authentication
http\://ogsa.globus.org/security/authentication/service=org.globus.ogsa.security.authentication
http\://www.gridforum.org/namespaces/2003/03/OGSI=org.gridforum.ogsi
http\://www.gridforum.org/namespaces/2003/03/OGSI/service=org.gridforum.ogsi
http\://www.gridforum.org/namespaces/2003/03/OGSI/bindings=org.gridforum.ogsi.bindings
http\://www.gridforum.org/namespaces/2003/03/serviceData=org.gridforum.ogsi
http\://www.gridforum.org/namespaces/2003/03/gridWSDLExtensions=org.gridforum.ogsi
http\://ogsadai.org.uk/service/grid_data_service=uk.org.ogsadai.wsdl
http\://ogsadai.org.uk/faults/gds=uk.org.ogsadai.wsdl.faults

-Convert GWSDL to WSDL:

ant -buildfile build-services.xml
-Dbuild.schema.dir=ogsadai/ogsadai-extension -Dwsdl.root=mikes_port_type
GWSDL2WSDL

-Generate bindings:

ant -buildfile build-services.xml -Dbinding.root=ogsadai-extension
-Dbuild.schema.dir=ogsadai/ogsadai-extension
-Dporttype.wsdl=mikes_port_type.wsdl generateBinding

-Generate classes:

ant -buildfile build-services.xml
-Dschema.file.dir=ogsadai/ogsadai-extension
-Dschema.file=mikes_port_type.wsdl -Dstubs.timeout=-1
-Dstubs.dest=JavaSource generateStubs
 uk/org/ogsadai/wsdl/faults

-Classes reside in <GLOBUS-BINARY>/schema/JavaSource

-The class url/some/someService/mikesNewPort/MikesNewPort.java
 when compiled provides an interface which provides all the operations of
 this new portType. This will include: GridService, GridDataPort,
 GridDataTransportPort operations and, of course, the MikesNewPort
 operation:

  public java.lang.String sampleOp(java.lang.String someInput) throws
  java.rmi.RemoteException, org.gridforum.ogsi.FaultType;

-Other classes generated reside in the following directories within
 JavaSource:

 The usual Stub class which handles serialization and deserialization:
 -url/some/someService/mikesNewPort/bindings/NewPortSOAPBindingStub.java

 The following are classes which take URLs etc and provide
 access to the MikesNewPort interface and so provide clients with the
 means to access the service:
 -url/some/someService/mikesNewPort/service/
   NewPortService.java
   NewPortServiceLocator.java
   NewPortServiceGridLocator.java

 The standard fault classes for the GDS which are identical to those in
 <OGSA-DAI>/src/java/uk/org/ogsadai/wsdl/faults:

 -uk/org/ogsadai/wsdl/faults
  GridDataServiceExceptionType.java
  GridDataServiceSystemExceptionType.java
  GridDataServiceUserExceptionType.java
  InvalidPerformDocumentExceptionType.java

 Additional classes relating to input and output messages for the GDS, GDT
 and MikesNewPort portTypes:

 -uk/org/ogsadai/schemas/gds
  ActivityInputType.java Parameter.java
  ActivityOutputType.java Perform.java
  ActivityType.java PerformResponse.java
  ActivityTypeListType.java Request.java
  ActivityTypeType.java ResponseType.java
  DocumentationType.java ResultType.java
  Execute.java Terminate.java
  GridDataServicePerformType.java Value.java
  GridDataServiceResponseType.java WithParameter.java

 -uk/org/ogsadai/schemas/gdt
  GetBlock.java GetResponse.java PutFully.java
  GetFully.java PutBlock.java PutResponse.java

 -url/some/sampleSchemas/
  SampleInput.java
  SampleOutput.java


Date view Thread view Subject view Author view Attachment view