• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic