cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <gma...@talend.com>
Subject Re: wsdl2java duplicate generated classes
Date Mon, 27 Feb 2012 00:28:45 GMT
No information provided, so dunno.  CXF bundles an Antbuild sample 
(http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/antbuild/) 
whose build.xml you can leverage.  Alternatively, part of an Ant script 
I used for an old blog entry (no longer published) is below.

Note web services are a relatively easy way to learn about Maven if you 
haven't used it yet 
(http://www.jroller.com/gmazza/entry/blog_article_index, links #1 and #2).

HTH,
Glen

<?xml version="1.0"?>
<project name="wsdl-first web service" default="compile" basedir=".">
<property environment="env"/>
<property name="target.classes.dir" location ="service-war/target/classes"/>
<property name="target.gen.dir" location 
="service-war/target/generated-sources"/>
<property name="service.src.dir" location="service-war/src/main"/>
<property name="client.src.dir" location="client/src/main"/>
<property name="wsdl.file" value="DoubleIt.wsdl"/>
<property name="war.name" value="doubleit.war"/>
<property name="wsdl.location" 
value="${service.src.dir}/webapp/WEB-INF/wsdl/${wsdl.file}"/>

<path id="mywebstack.classpath">
<path refid="cxf.classpath"/>
</path>

<path id="cxf.classpath">
<pathelement location="${target.classes.dir}"/>
<fileset dir="${env.CXF_HOME}/lib">
<include name="*.jar"/>
</fileset>
</path>

<target name="clean">
<delete includeEmptyDirs="true">
<fileset dir="${target.classes.dir}" includes="**/*"/>
<fileset dir="${target.gen.dir}" includes="**/*"/>
</delete>
</target>

<target name="generate-CXF-jaxws">
<java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
<arg value="-compile"/>
<arg value="-d"/>
<arg value="${target.gen.dir}"/>
<arg value="-classdir"/>
<arg value="${target.classes.dir}"/>
<arg value="${wsdl.location}"/>
<classpath>
<path refid="cxf.classpath"/>
</classpath>
</java>
</target>

<target name="compile">
<javac destdir="${target.classes.dir}" debug="true">
<src path="${service.src.dir}"/>
<src path="${client.src.dir}"/>
<src path="${target.gen.dir}"/>
<classpath refid="mywebstack.classpath"/>
<classpath>
<fileset dir="${service.src.dir}/webapp/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>

<target name="run-client">
<java classname="com.mycompany.webservice.client.WSClient" fork="true">
<classpath>
<pathelement location="${target.classes.dir}"/>
<path refid="mywebstack.classpath"/>
</classpath>
<!-- Line below activates debug output.
<jvmarg
             
value="-Djava.util.logging.config.file=${env.CXF_HOME}/etc/logging.properties"/>
          -->
</java>
</target>
</project>

HTH,
Glen

On 02/26/2012 04:54 PM, dugfresh wrote:
> I'm using wsdl2java with an ANT task and I'm getting duplicate generated
> classes.  For example Foo, Foo2, Bar, Bar2, etc.  Why does this happen?
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/wsdl2java-duplicate-generated-classes-tp5517565p5517565.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza


Mime
View raw message