Thanks for the heads-up. I'd never heard of xmltask, but is sounds very
useful.
 

-----Original Message-----
From: Alejandro Calbazana [mailto:[EMAIL PROTECTED] 
Sent: 20 July 2007 12:34
To: axis-user@ws.apache.org
Subject: Re: code generated by wsdl2java

I'm not a fan of storing generated code under source control.

I don't store anything under source control but the WSDL and my
implementation source files.  I let the build generate my skeleton each
time and I always generate an interface.  I have a custom implementation
for my service living outside of the generated source tree and keep this
under source control.  This implementation implements the generated
interface.  I then muck with the services.xml post build to point to my
own service impl.  I use xmltask
(http://www.oopsconsultancy.com/software/xmltask/) to do the dirty work
of adding necessary attributes and elements to the services.xml
document.  Seems to work out ok..

Here is a snap from an ant build:

    <target name="gen" description="Generates source" 
depends="check,conf,init">       
        <echo>
========================================================================
=======
= Generate Source
========================================================================
=======    
           
        </echo>               
      <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true" 
classpathref="CLASSPATH.COMMON">
            <arg line="-uri ${wsdl.uri}"/>
            <arg line="-d adb"/>
              <arg line="-ss"/>
              <arg line="-sd"/>         
              <arg line="-ssi"/>         
            <arg line="-o ${gen}"/>
        </java>   
    </target>


    <target name="build" description="Compiles" 
depends="check,conf,init,gen">
        <echo>
========================================================================
=======
= Build 
========================================================================
=======    
           
        </echo>           
       
        <!-- do build stuff -->
        <javac fork="true" memoryInitialSize="256m" 
memoryMaximumSize="256m" debug="on" destdir="${classes}"
srcdir="${src}">
            <classpath>
                <pathelement path="../dist/core.jar"/>
                <path refid="CLASSPATH.WL"/>
                <path refid="CLASSPATH.PROJECT" />
            </classpath>
        </javac>
       
        <!--
            Now that the compile has finished, a little post processing
is necessary
            on the generated services.xml to configure the web service
with the necessary
            life cylce listeners as well as setting the services TCCL
            (thread context class loader).
        -->
        <xmltask source="${gen}/resources/services.xml" 
dest="${gen}/resources/services.xml">
            <!-- replace the service impl -->
            <replace
path="/serviceGroup/service/[EMAIL PROTECTED]'ServiceClass']/text()">
                <![CDATA[ com.foo.bar.MyServiceImpl ]]>
            </replace>

            <!-- set the service thread context class loader param -->
            <insert path="/serviceGroup/service">
                <![CDATA[
                    <parameter name="ServiceTCCL">composite</parameter>
                ]]>
            </insert>
           
            <!-- set the service lifecycle impl -->
            <attr path="/serviceGroup/service" attr="class" 
value="com.foo.bar.MyServiceLifeCycleListener"/>
            <attr path="/serivceGroup/service" attr="scope" 
value="application"/>
        </xmltask>       
    </target>

Thanks,

Alejandro
.
Desmond Whewell (CV/ETL) wrote:
> Jeff,
>  
> The only files that I store are:
>  
> 1. The ant files that control the generation from the WSDL
>  
> 2. The receiver and skeleton files that replace the boiler plate 
> versions generated by Axis2.
>  
> All others are derived at build time.
>  
> Cheers, Des
>
> ----------------------------------------------------------------------
> --
> *From:* Jeff Gardner [mailto:[EMAIL PROTECTED]
> *Sent:* 20 July 2007 00:12
> *To:* axis-user@ws.apache.org
> *Subject:* code generated by wsdl2java
>
> In general, should code that has been generated by wsdl2java be 
> committed to your version/source control repository?
>  
> Why or why not?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to