I'm thinking of doing some work around making the ant build scripts for
projects
which use the Web Service Control (WSC) a bit easier to implement.
Currently
there is a bunch of build file work necessary to generate and build a WSC.
I would like to try to simplify it as much as possible.

Here are the steps required to generate a web service control:

1) Generate supporting classes from the WSDL file. This step is optional if
the
   classes already exist.
2) Generate the WSC from the WSDL file.

Here's one possible solution:

*) Create ant build files for generating the types from a WSDL.  Currently
   one for Axis gen and one for xmlbean gen.  One of these could be imported

   into the project's build.xml
*) Create ant build file for WSC generation, different targets for each type

   of WSDL file location (URL, file, dir). This build file could also be
imported
   into the project's build file.

This approach would make it pretty easy to generate the types and WSC from a
WSDL file.
It also keeps the main ant build file pretty clean (See example build file
below).
One disadvantage with the approach is that the target locations for the
generated
source files and the settings for the WebServiceControlGenerator Ant task
are hidden
and less easily modified.


Any Beehive users/devs out there have an opinion or other suggestions on
this?


  - Thanks,
      Chad


Sample build file:


<project name="controls-blank" default="usage" basedir=".">

    <property environment="os"/>
    <property file="build.properties"/>
    <import file="${beehive.home}/beehive-imports.xml"/>
    <import file="${beehive.home}/ant/beehive-tools.xml"/>

    <!-- ADDED FOR WSC SUPPORT -->
    <import file="${beehive.home}/ant/axis-type-generation.xml/>
    <import file="${beehive.home}/ant/wsc-generation.xml/>
    <property name="wsdl.src" location="${basedir}/wsdls"/>
    <!-- END ADDED FOR WSC SUPPORT -->

    <property name="source.dir" location="${basedir}/src"/>
    <property name="build.dir" location="${basedir}/build"/>
    <property name="build.classes" location="${build.dir}/classes"/>
    <property name="build.beansrc" location="${build.dir}/beansrc"/>
    <property name="build.jar" value="mycontrols.jar"/>

    <path id="build.classpath">
        <pathelement path="${build.classes}"/>
        <path refid="controls.dependency.path"/>
    </path>

    <target name="clean" description="Delete all generated files">
        <delete dir="${build.dir}"/>
        <delete file="velocity.log"/>
    </target>

    <target name="build" description="Build control sources">
        <mkdir dir="${build.classes}"/>
        <mkdir dir="${build.beansrc}"/>

        <!-- ADDED FOR WSC SUPPORT -->
        <antcall target="gen-types-from-wsdl"/>
        <antcall target="gen-wsc-from-wsdl-dir"/>
        <!-- END ADDED FOR WSC SUPPORT -->

        <build-controls srcdir="${source.dir}"
                        destdir="${build.classes}"
                        tempdir="${build.beansrc}"
                        classpathref="build.classpath"/>

        <control-jar destfile="${build.dir}/${build.jar}" basedir="${
build.classes}" />
    </target>

</project>

Reply via email to