Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WSDL2Java without WAS or RAD installed?

101 views
Skip to first unread message

je...@squeebie.com

unread,
Feb 18, 2008, 8:52:36 AM2/18/08
to
I work in a development environment where most people use IntelliJ and don't have WAS or RAD installed locally, but we would like to use the IBM WSDL2Java for generating out client side soap classes. Is this possible? <br />
<br />
I've seen tips saying to look in the .bat file in the WAS install to see what to run from outside of WAS, but the .bat uses the classpath of the the currently installed WAS for this to work. I'm looking to have it run from an Ant script without WAS or RAD installed at all.<br />
<br />
Is there a list somewhere of the jars that would be needed (short of copying all of them) for this to work?<br />
<br />
Thanks in advance.

Doug Breaux

unread,
Feb 18, 2008, 9:22:23 AM2/18/08
to

Unfortunately, I don't believe so. I started with the obvious ones and kept
needing more and more. Here's the Ant classpath that I ended up using:

<path id="websphere.lib.path">
<fileset dir="${websphere.runtime.home}">
<include name="**/*.jar"/>
<exclude name="optionalLibraries/**/*.jar"/>
<exclude name="systemApps/**/*.jar"/>
</fileset>
</path>

Where websphere.runtime.home is something like:

websphere.runtime.home=C:/Program Files/IBM/SDP70/runtimes/base_v61


--
Doug

je...@squeebie.com

unread,
Feb 18, 2008, 10:25:17 AM2/18/08
to
Thanks Doug, that's what I was afraid of. I'll leave the question out there as unanswered a little longer, in the hopes that someone else has done it.<br />
<br />
Thanks.

je...@squeebie.com

unread,
Feb 18, 2008, 12:01:44 PM2/18/08
to
<div class="jive-quote"><span class="jive-quote-header">Guest wrote:</span><br />
je...@squeebie.com wrote:<br />
<div class="jive-quote">I work in a development environment where most people use IntelliJ and don't have WAS or RAD installed locally, but we would like to use the IBM WSDL2Java for generating out client side soap classes. Is this possible? <br/>

<br/>
I've seen tips saying to look in the .bat file in the WAS install to see what to run from outside of WAS, but the .bat uses the classpath of the the currently installed WAS for this to work. I'm looking to have it run from an Ant script without WAS or RAD installed at all.<br/>
<br/>
Is there a list somewhere of the jars that would be needed (short of copying all of them) for this to work?<br/>
<br/>
Thanks in advance.</div>
<br />
Unfortunately, I don't believe so. I started with the obvious ones and kept <br />
needing more and more. Here's the Ant classpath that I ended up using:<br />
<br />
&lt;path id="websphere.lib.path"&gt;<br />
&lt;fileset dir="${websphere.runtime.home}"&gt;<br />
&lt;include name="<b>*/</b>.jar"/&gt;<br />
&lt;exclude name="optionalLibraries/**/*.jar"/&gt;<br />
&lt;exclude name="systemApps/**/*.jar"/&gt;<br />
&lt;/fileset&gt;<br />
&lt;/path&gt;<br />
<br />
Where websphere.runtime.home is something like:<br />
<br />
websphere.runtime.home=C:/Program Files/IBM/SDP70/runtimes/base_v61<br />
<p />
<ul class="jive-dash">
<li>
<ul class="jive-dash">
<li></li>
</ul>
</li>
</ul>
Doug</div>
<br />
Even if I need all the WAS / RAD jars, I'm still going to try to make it in a separate ant file that can be run outside of WAS / RAD.<br />
<br />
What does your and task look like that actually calls WSDL2Java? I have this, but get errors:<br />
<br />
...<br />
<br />
<property name="websphere.base_61.home" value="C:/Program Files/IBM/SDP70/runtimes/base_v61"/>
<property name="websphere.wsdk.home" value="C:/Program Files/IBM/SDP70/runtimes/wsdk"/>
<br />
<path id="websphere.base_v61.lib.path">
<fileset dir="${websphere.base_61.home}">
<include name="*/.jar"/>
<include name="runtimes/**/*.jar"/>

<exclude name="optionalLibraries/**/*.jar"/>
<exclude name="systemApps/**/*.jar"/>
</fileset>
</path>
<br />
<path id="websphere.wsdk.lib.path">
<fileset dir="${websphere.wsdk.home}">
<include name="j2ee14/*.jar"/>
</fileset>
</path>
<p />
<br />
<target name="wsdl2java" depends="clean,prepare">
<java classname="com.ibm.ws.webservices.tools.wsad.WSDL2Java" fork="true" jvmargs="-Xms128m -Xmx512m">
<classpath refid="websphere.base_v61.lib.path"/>
<classpath refid="websphere.wsdk.lib.path"/>
<arg value="-role"/>
<arg value="client"/>
<arg value="-output"/>
<arg value="${work.dir}"/>
<arg value="-verbose"/>
<arg value="${wsdl.path}"/>
</java>
</target>
<br />
I get this error when I try to run:<br />
<br />
"java.lang.NoSuchMethodError: main".<br />
<br />
WSDL2Java has a main though, so I'm not sure what it's complaining doesn't have one.<br />
<br />
Thanks.

Doug Breaux

unread,
Feb 18, 2008, 2:10:15 PM2/18/08
to

There is actually an Ant task for wsdl2java so you don't have to fork an
external process.

See

<http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/ant/tasks/package-summary.html>

Here are the relevant excerpts from my build.xml:

<path id="websphere.lib.path">
<fileset dir="${websphere.runtime.home}">

<include name="**/*.jar"/>


<exclude name="optionalLibraries/**/*.jar"/>
<exclude name="systemApps/**/*.jar"/>
</fileset>
</path>

<taskdef name="wsdl2java"
classname="com.ibm.websphere.ant.tasks.WSDL2Java">
<classpath refid="websphere.lib.path"/>
</taskdef>

<target name="ws-clean">
<delete quiet="true">
<fileset dir="${src.home}/<my-package-hierarchy>"/>
</delete>
</target>

<target name="ws-proxy" depends="ws-clean">
<wsdl2java url="${wsdlURL}"
noDataBinding="false"
noWrappedOperations="false"
output="${src.home}"
role="client"
container="none"
deployScope="Application"
genjava="IfNotExists">
<mapping namespace="<my-WSDLsnamespace>"
package="<my-package-hierarchy>"/>
</wsdl2java>
</target>

Hope that helps.

--
Doug

je...@squeebie.com

unread,
Feb 19, 2008, 12:50:55 AM2/19/08
to
Great, thanks for the info Doug, I'll read the docs you listed and take a look at the build you posted.<br />
<br />
Thanks again - Jesse

jagapat...@yahoo.com

unread,
Mar 19, 2008, 6:23:37 PM3/19/08
to
Hi Doug,<br />
<br />
Excellent. Thanks for this information. I have one quick question that in your ant script code<br />
<br />
question 1)<br />
<br />
&lt;fileset dir="${websphere.runtime.home}"&gt; what is the websphere.runtime.home location to set?<br />
<br />
Q 2)<br />
So this ant script and jars used here is really independent of RAD and WAS installed in machine.? I mean if u have these jars, can you generate proxy client classes?<br />
<br />
Please let me know your responses soon. Thank you very much.

Doug Breaux

unread,
Mar 20, 2008, 9:57:30 AM3/20/08
to

If you have all those jars from the RAD WAS runtime environment, you don't
need to have RAD itself, or WAS, installed. I posted my
websphere.runtime.home variable earlier, but in case it's been archived off
the web forums or something, here it is again:

websphere.runtime.home=C:/Program Files/IBM/SDP70/runtimes/base_v61

You should be able to copy this whole directory from a working RAD install and
build on a different machine. (I have no idea whether or not the license
allows that, however.)

I do wish there was an easier packaging of the necessary jars.

--
Doug

jagapat...@yahoo.com

unread,
Mar 20, 2008, 4:22:35 PM3/20/08
to
Hi,<br />
Thank you very much for your quick response. I still have some problems in running the ant script.<br />
I am getting the error "taskdef : com.ibm.websphere.ant.tasks.wsdl2java" class can not found. (FYI: RSA 7.0.0.5v installed in my machine) and I even set websphere.runtime.home property to baseV61 as you said. in RSA where is this class location?<br />
<br />
below is the Ant script I am trying to run as given, getting pronlem at classname="com.ibm.websphere.ant.tasks.WSDL2Java"&gt; line as taskdef class not found, How to resolve it ? I have RSA installed in my local machine.<br />
<br />
could you pls suggest some solution to fix this. its urgent for me.<br />
<br />
script:-<br />
<hr />
<br />
&lt;property name="websphere.runtime.home" value="C:/Program Files/IBM/SDP70/runtimes/base_v61"/&gt;<br />
&lt;property name="websphere.wsdk.home" value="C:/Program Files/IBM/SDP70/runtimes/wsdk"/&gt;<br />
&lt;property name="wsdlURL" value="C:/test/mywsdl.wsdl"/&gt;<br />
<br />

&lt;path id="websphere.lib.path"&gt;<br />
&lt;fileset dir="${websphere.runtime.home}"&gt;<br />
&lt;include name="*/.jar"/&gt;<br />

&lt;exclude name="optionalLibraries/**/*.jar"/&gt;<br />
&lt;exclude name="systemApps/**/*.jar"/&gt;<br />
&lt;/fileset&gt;<br />
&lt;/path&gt;<br />
<br />
&lt;taskdef name="wsdl2java"<br />
classname="com.ibm.websphere.ant.tasks.WSDL2Java"&gt;<br />
&lt;classpath refid="websphere.lib.path"/&gt;<br />
&lt;/taskdef&gt;<br />
<br />
&lt;target name="ws-proxy"&gt;<br />
&lt;wsdl2java url="${wsdlURL}"<br />
noDataBinding="false"<br />
noWrappedOperations="false"<br />
output="src"<br />
role="client"<br />
container="none"<br />
deployScope="Application"<br />
genjava="IfNotExists"&gt;<br />
&lt;/wsdl2java&gt;<br />
&lt;/target&gt;<br />
&lt;/project&gt;

Doug Breaux

unread,
Mar 21, 2008, 1:39:11 PM3/21/08
to

Hmmm... it appears something has been lost between my NNTP posting and the Web
forum feed.

The first include under websphere.lib.path should have two asterisks before
the slash. Two asterisks means to traverse all the subdirectories (except the
ones explicitly excluded in the next two lines). One asterisk means to only
use the top level subdirectory. So the value should be like this, but without
any spaces:

* * / *.jar

(Makes me wonder if the OP, Jesse, pulled his hair out trying to get it to
work. Wonder how to get this kind of a forum bug resolved.)
--
Doug

bre...@us.ibm.com

unread,
Mar 21, 2008, 3:26:11 PM3/21/08
to
Sigh, I'm having difficulty getting the web forum to not take my ** as bold or bullet indicators. Guess I'll use entity references so we can resolve this. But for that first include line, this is what you need:<br />
<br />
&#42;&#42;/&#42;.jar

jagapat...@yahoo.com

unread,
Mar 21, 2008, 4:07:10 PM3/21/08
to
Hi, Thank you for your time. I really feel bad saying that still I am getting build failure. Sorry for troubling you again :)<br />
<br />
This is the error I am getting<br />
<hr />
<br />
ws-proxy:<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> java.lang.VerifyError: org/eclipse/jst/j2ee/webservice/internal/wsdd/WsddResourceFactory.registerWith(Lorg/eclipse/wst/common/internal/emf/resource/RendererFactory;)V<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.etools.webservice.init.WebServiceInit.init(WebServiceInit.java:77)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.websphere.models.config.init.ConfigInit.init(ConfigInit.java:407)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.ws.webservices.wsdl.mapping.MappingMetaDOM.registerXML(MappingMetaDOM.java:129)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.ws.webservices.wsdl.mapping.MappingMetaDOM.&lt;init&gt;(MappingMetaDOM.java:183)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.ws.webservices.wsdl.mapping.MappingMetaData.&lt;init&gt;(MappingMetaData.java:139)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.ws.webservices.wsdl.toJava.Emitter.&lt;init&gt;(Emitter.java:257)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.ws.webservices.tools.ant.WSDL2JavaJ2EE._execute(WSDL2JavaJ2EE.java:60)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at com.ibm.ws.webservices.tools.ant.WSDL2JavaBase.execute(WSDL2JavaBase.java:92)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.Task.perform(Task.java:364)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.Target.execute(Target.java:341)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.Target.performTasks(Target.java:369)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.Project.executeTarget(Project.java:1185)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.apache.tools.ant.Project.executeTargets(Project.java:1068)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:706)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:457)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at java.lang.reflect.Method.invoke(Method.java:615)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:230)<br />
<a href="http://www-128.ibm.com/developerworks/forums/">wsdl2java</a> at java.lang.Thread.run(Thread.java:803)<br />
<br />
BUILD FAILED<br />
C:\Documents and Settings\Q02046\IBM\rationalsdp7.0\workspace\test\src\build.xml:104: Error while running com.ibm.websphere.ant.tasks.WSDL2Java

Doug Breaux

unread,
Mar 21, 2008, 4:49:34 PM3/21/08
to

That I haven't seen and may no longer be related to the Ant configuration.
Are you certain that the WSDL is valid? e.g. have you tried generating a
client for it using RSA's wizard? It may be Google time to resolve that one.

--
Doug

jagapat...@yahoo.com

unread,
Mar 24, 2008, 12:00:00 PM3/24/08
to
Hi, Yes, I am able to generate it if I use RSA wizard. no problem. I will try to search in google again. Since its very urgent for me to meet the deadline, getting problem :) Thanks for all your time.
0 new messages