Index: build.xml
===================================================================
--- build.xml	(revision 1810)
+++ build.xml	(revision 1811)
@@ -103,7 +103,12 @@
       <property name="morphosourcedir" value="../morpho" />
       <property name="defaultcontenttype" value="application/octet-stream" />
       <property name="utilitiesdir" value="../utilities" />
-
+      <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
+      <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
+      <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
+      <property environment="env"/>
+      <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
+    
       <!-- Make sure these paths match the location of the jar files
            on your system, the defaults should usually work -->
       <property name="jsdk"
@@ -219,6 +224,14 @@
       <property name="ver.src" value="${ver.dir}/src"/>
 
       <property name="package.home" value="edu/ucsb/nceas/metacat" />
+      <path id="webservicepath">
+        <pathelement location="."/>
+        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
+        <pathelement location="${build.dest}"/>
+        <fileset dir="${env.GLOBUS_LOCATION}/lib">
+           <include name="*.jar"/>
+        </fileset>
+      </path>
    </target>
 
    <target name="prepare" depends="init">
@@ -644,5 +657,74 @@
       <outputproperty name="indent" value="yes"/>
     </xslt>
   </target>
-
+  
+  
+  
+  <target name="compileinterface" depends="clean,prepare">
+    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
+  </target>
+  
+  <target name="generateWSDL" depends="compileinterface">
+    <echo message="Generating wsdl from ${interface.name} interface"/>
+    <java classname="${java2wsdl.tool}"
+          dir="${build.dir}" fork="yes"
+          classpathref="webservicepath"  failonerror="true" >
+      <arg value="-P"/>
+      <arg value="${interface.name}PortType"/>
+      <arg value="-S"/>
+      <arg value="${interface.name}Service"/>
+      <arg value="-y"/>
+      <arg value="WRAPPED"/>
+      <arg value="-u"/>
+      <arg value="LITERAL"/>
+      <arg value="-l"/>
+      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
+      <arg value="-n"/>
+      <arg value="http://${services.namespace}/${interface.name}"/>
+      <arg value="${interface.package}.${interface.name}"/>
+    </java>
+  </target>
+  
+   <target name="decorateWSDL" depends="generateWSDL">
+      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
+      <java classname="${wsdldecorator.tool}" dir="${build.dir}"
+            fork="yes"
+            classpathref="webservicepath" failonerror="true" >
+        <arg value="${binding.file}"/>
+        <arg value="${wsdl.file}"/>
+      </java>
+   </target>
+   
+   <target name="generatestubs" depends="decorateWSDL">
+      <echo message=" Generating stubs " />
+      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
+            classpathref="webservicepath" failonerror="true" >
+         <arg value="../${wsdl.file}"/>
+    </java>
+  </target>
+  
+  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
+     <echo message=" Compiling stubs " />
+     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
+     <echo message=" Compiling impl " />
+     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
+  </target>
+  
+  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
+     <echo message=" jar stubs classes " />
+     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
+     <echo message=" jar impl classes " />
+     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
+  </target>
+  
+  <target name="gar" depends="jarStubsAndImpl">
+     <echo message=" jar the gar file"/>
+     <mkdir dir="${build.dir}/gar"/>
+     <mkdir dir="${build.dir}/gar/schema/edu"/>
+     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
+     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
+     <copy file="server-deploy.wsdd" todir="${build.dir}/gar" />
+     <copy file="${build.dir}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
+     <jar destfile="${interface.name}.gar" basedir="${build.dir}/gar"/>
+  </target>
 </project>
