----- Original Message -----
From: "Nicholas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 05, 2003 15:18
Subject: Re: wsdl and documentation
> > i never thought it'd be simple :(. And like I said
> > before: xdoclet. Though I
> > still think you should write the WSDL and generate
> > the server and client
> > code from it, as if it was just another IDL syntax.
>
> Anyone know about any Ant tasks to do exactly this ?
<axis-wsdl2java>
The build file snippet I use to do this does the following
1. check that the source is up to date w.r.t the .WSDL file
2. create the soap api in build/axis/generated/ package tree
3. copy some (but not all) of the generated stuff to build/axis/src. I strip
out the bits I dont want.
My IDE and main <javac> task includes build/axis/src in the list of files to
compile, and depends on the "soapapi" target.
The hard part is now that WSDL is butt-ugly.
<!--
=================================================================== -->
<!-- SOAP -->
<!--
=================================================================== -->
<target name="check-soapapi">
<uptodate property="soapapi.uptodate"
targetfile="${build.axis.dir}/uptodate.txt"
srcfile="${zoo.wsdl}" />
</target>
<!-- create client and server stubs using axis -->
<target name="create-soapapi"
depends="init,check-soapapi"
unless="soapapi.uptodate"
>
<axis-wsdl2java
output="${build.axis.generated.dir}"
serverside="true"
skeletondeploy="true"
url="${zoo.wsdl}"
verbose="true"
testcase="true"
>
<mapping
namespace="http://zoo/"
package="${axis.soapapi.package}" />
<mapping
namespace="http://ranier:8080/zoo/dtds/zoo.xsd"
package="${axis.soapapi.package}.data" />
</axis-wsdl2java>
</target>
<!-- copy all but the zoo.java class and the test case -->
<target name="soapapi"
depends="create-soapapi"
unless="soapapi.uptodate"
description="pull generated classes into a directory for inclusion into
javac">
<mkdir dir="${build.axis.src.dir}/${axis.soapapi.package.dirs}"/>
<copy todir="${build.axis.src.dir}/${axis.soapapi.package.dirs}">
<fileset
dir="${build.axis.generated.dir}/${axis.soapapi.package.dirs}">
<include name="**/*.java"/>
<exclude name="ZooBindingImpl.java"/>
<exclude name="ZooTestCase.java"/>
<exclude name="ZooLocator.java"/>
<exclude name="ZooBindingStub.java"/>
<include name="*.wsdd"/>
</fileset>
</copy>
<touch file="${build.axis.dir}/uptodate.txt"/>
</target>