Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Assemblying webservice using servicegen ant script

797118Sep 10 2010
Iam using weblogic ant task sevicegen to generate a webservice for weblogic version 7.0 . I need to add a Jar file under WEB-INF/lib that contains classes that my service uses. I tried to do this by calling new target after servicegen command as follows:

<target name="utiljar">
<wspackage output="${build}/${ear_file}" warName="${war_file}" overwrite="False" utilJars="/lib/mbo.jar"/>
</target>

But this still didn't work. Here is the complete code. Any help will be appreciated.

<project name="M2Dservice" default="all" basedir=".">

<!-- set global properties for this build -->
<property name="source" value="."/>
<property name="build" value="${source}/build"/>
<property name="config" value="${source}/config"/>
<property name="client" value="${source}/client"/>
<property name="war_file" value="M2DService.war" />
<property name="ear_file" value="M2DService.ear" />
<property name="port" value="7001"/>
<property name="namespace"
value="http://service.m2d.saic.com/"
/>
<property name="wls.home.dir"
value="/app/maximo5/weblogic/weblogic700"
/>


<target name="all" depends="ear"/>

<path id="webservice.classpath">
<pathelement location="${wls.home.dir}/server/lib/weblogic.jar"/>
<pathelement location="${wls.home.dir}/server/lib/webservices.jar"/>
<pathelement location="${wls.home.dir}/server/lib/webserviceclient.jar"/>
</path>

<taskdef name="servicegen"
classpathref="webservice.classpath"
classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask"/>




<!-- <target name="clean">
<delete dir="${build}"/>
<delete dir="${client}"/>
</target> -->

<!-- compile the M2DService class to the ${build} directory where the service
generator will look for it when it builds the webservice -->
<!-- <target name="compile">
<mkdir dir="${build}"/>
<javac srcdir="${source}" destdir="${build}" includes="M2DServiceImpl.java"/>
</target> -->

<!-- call the servicegen element within the ear task to generate and build
the ear into the ${apps.dir} directory. It will be automatically
deployed from there -->
<target name="ear">
<servicegen
classpathref="webservice.classpath"
destEar="${build}/${ear_file}"
warName="${war_file}">
<service
javaClassComponents="com.saic.m2d.service.M2DServiceImpl"
targetNamespace="${namespace}"
serviceName="M2DService"
serviceURI="/M2DService"
generateTypes="True"
expandMethods="True">
</service>
<classpath>
<pathelement path="${source}"/>
<pathelement path="${build}"/>
<pathelement path="${java.class.path}"/>
</classpath>
</servicegen>
</target>

<target name="utiljar">
<wspackage output="${build}/${ear_file}" warName="${war_file}" overwrite="False" utilJars="/lib/mbo.jar"/>
</target>

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2010
Added on Sep 10 2010
0 comments
485 views