File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes JAX-WS create server and client jar in one build pass (ant) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-WS create server and client jar in one build pass (ant)" Watch "JAX-WS create server and client jar in one build pass (ant)" New topic
Author

JAX-WS create server and client jar in one build pass (ant)

Dave Meyers
Greenhorn

Joined: Mar 28, 2003
Posts: 5
I'm using JAX-WS with WebLogic 10.3, Java 1.6. I'm attempting to build both my service war and client jar in one pass through an ant script. Since the clientgen ant task depends on a deployed wsdl I am forced to deploy before compiling the client. Does anyone have any strategies for building a server war and client jar in one pass? A sample any file would be great. I have not had success using apt or wsgen.

<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask"/>

<target name="build-service" depends="compile">
<jwsc srcdir="${src}"
destdir="${dist}"
debug="on"
keepGenerated="yes">
<classpath>
<pathelement path="${wl_home}/server/lib/weblogic.jar"/>
<pathelement path="${wl_home}/server/lib/webservices.jar"/>
<pathelement path="${bea_home}/modules/features/weblogic.server.modules_10.3.0.0.jar"/>
</classpath>

<module contextPath="JAXWS" name="JAXWSTutorial">
<jws file="com/artisan/sample/service/PricingServiceImpl.java" type="JAXWS"/>
<fileset dir="${war}">
<include name="**/*.xml"/>
</fileset>
<descriptor file="${war}/WEB-INF/web.xml"/>
<descriptor file="${war}/WEB-INF/weblogic.xml"/>
</module>
</jwsc>

<clientgen type="JAXWS"
wsdl="http://tstwap01:7400/JAXWS/services/PricingServiceImpl?wsdl"
destDir="${classes}"
packageName="com.sample.wsclient"
serviceName="PricingService"/>

<javac srcdir="${classes}" destdir="${classes}" debug="true" includes="com/sample/wsclient/*.java">
<classpath refid="project.class.path"/>
</javac>

<jar destfile="${dist}/pricingService.jar" basedir="${classes}" includes="com/sample/wsclient/*.class"/>
</target>
Dave Meyers
Greenhorn

Joined: Mar 28, 2003
Posts: 5
I got wsgen to work, so I am good to go.

<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask"/>
<taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen"/>

<target name="build-service" depends="compile">
<jwsc srcdir="${src}"
destdir="${dist}"
debug="on"
keepGenerated="yes">
<classpath>
<pathelement path="${wl_home}/server/lib/weblogic.jar"/>
<pathelement path="${wl_home}/server/lib/webservices.jar"/>
<pathelement path="${bea_home}/modules/features/weblogic.server.modules_10.3.0.0.jar"/>
</classpath>

<module contextPath="JAXWS" name="APLP-JAXWSTutorial">
<jws file="com/sample/service/PricingServiceImpl.java" type="JAXWS"/>
<descriptor file="${war}/WEB-INF/weblogic.xml"/>
</module>
</jwsc>

<wsgen sei="com.artisan.sample.service.PricingServiceImpl"
resourcedestdir="${build}"
sourcedestdir="${classes}"
destdir="${classes}"
genwsdl="true" verbose="true" keep="true">
<classpath>
<pathelement location="${classes}"/>
</classpath>
</wsgen>

<clientgen type="JAXWS" wsdl="${build}/PricingServiceImplService.wsdl"
destDir="${classes}"
packageName="com.sample.wsclient"
serviceName="PricingService"/>

<jar destfile="${dist}/pricingService.jar" basedir="${classes}" includes="com/sample/wsclient/*.class"/>
</target>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAX-WS create server and client jar in one build pass (ant)
 
Similar Threads
Builded file using clientgen does not have my jar files
Problem in adding jar files to the building war file using ant
Compile build.xml with Ant for web service on Weblogic
Problem in adding jar files to the building war file using ant
Builded file using clientgen does not have my jar files