function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kminevkminev 

Can anyone generate the java code for me from wsdl schema

Guys,

I've been trying to properly generate java code from the wsdl schema for the past few days and no luck at all or partially functional. I am trying to use the axis 1.4, but I am not able to configure it properly so it generates the right java syntax.

If anyone has it set up and is willing to help would be appreciated I will send my wsdl over email.

Thanks in advance.

SuperfellSuperfell
are you running WSDL2Java from the command line? what command are you running? what's the output?
kminevkminev
Yes I am running WSDL2Java from the command line, but it only works with axis2 1.4 I could not set up axis 1.4 to even work at all. With axis2 after I generate the code I am missing a lot of classes plus binding doesn't work either.
SuperfellSuperfell
forget axis2, pretend it doesn't exist. What's the problem you have getting axis1 1.4 to work?
kminevkminev
It just does not run at all.
I've downloaded axis 1.4 and added to my tomcat 6.0.18  I am also running JDK 1.6 if that helps in any way.



my axis 1.4 contains WEB-INF folder where all the jars are housed as well as some html and jsp files. Well I tested and followed all the instructions from the apache axis web site and it appears that I can run all the tests.

Now what??? How do I convert my wsdl to java code?   :(

Thank you.
kminevkminev
No I have all of the environmental variables properly configured and everything should be all set. How do I execute the the wsdl via command line to generate the code?


kminevkminev

Error from the console:

C:\>java %AXISCLASSPATH%
Exception in thread "main" java.lang.NoClassDefFoundError: C:\axis-1_4\lib\axis/jar;C:\axis-1_4\lib\
commons-discovery/jar;
Caused by: java.lang.ClassNotFoundException: C:\axis-1_4\lib\axis.jar;C:\axis-1_4\lib\commons-discov
ery.jar;
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

C:\>

kminevkminev

Here all of my Environmental variables:


C:\>echo %AXISCLASSPATH%
C:\axis-1_4\lib\axis.jar;C:\axis-1_4\lib\commons-discovery.jar;

C:\>echo %AXIS_HOME%
C:\axis-1_4

C:\>echo %AXIS_LIB%
C:\axis-1_4\lib

C:\>
kminevkminev

This my command:

C:\>java -classpath %AXISCLASSPATH% org.apache.axis.wsdl.WSDL2Java -a c:\enterprise.wsdl


comes back with:

C:\>java -classpath %AXISCLASSPATH% org.apache.axis.wsdl.WSDL2Java -a c:\enterprise.wsdl
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
        at org.apache.axis.components.logger.LogFactory.class$(LogFactory.java:45)
        at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
        at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
        at org.apache.axis.i18n.ProjectResourceBundle.<clinit>(ProjectResourceBundle.java:53)
        at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.java:32)
        at org.apache.axis.utils.Messages.<clinit>(Messages.java:36)
        at org.apache.axis.wsdl.WSDL2Java.<clinit>(WSDL2Java.java:112)
SuperfellSuperfell
you're missing most of the axis dependencies by the looks of it (e.g. log4j, commons-logging etc.)

see the section on classpath in this doc, http://ws.apache.org/axis/java/install.html#Step2SettingUpTheLibraries there's a bunch more jars you need.
kminevkminev
Here is the list of all of the jars that I have under c:\axis1.4\lib\

log4j.properties
activation.jar
axis-ant.jar
commons-discovery-0.2.jar
commons-logging-1.0.4.jar
jaxrpc.jar
log4j-1.2.8.jar
saaj.jar
wsdl4j-1.5.1.jar
resolver.jar
serializer.jar
mail.jar
axis.jar
xmlsec.jar
xml-apis.jar
xercesImpl.jar


And I also have all of the above specified under my classpath as environmental variable.

???


kminevkminev
This is my AXISCLASSPATH variable:

%AXIS_LIB%\axis.jar;
%AXIS_LIB%\commons-discovery-0.2.jar;
%AXIS_LIB%\commons-logging-1.0.4.jar;
%AXIS_LIB%\axis-ant.jar;
%AXIS_LIB%\jaxrpc.jar;
%AXIS_LIB%\log4j-1.2.8.jar;
%AXIS_LIB%\saaj.jar;
%AXIS_LIB%\wsdl4j-1.5.1.jar;
%AXIS_LIB%\activation.jar;
%AXIS_LIB%\mail.jar;
%AXIS_LIB%\resolver.jar;
%AXIS_LIB%\serializer.jar;
%AXIS_LIB%\xercesImpl.jar;
%AXIS_LIB%\xml-apis.jar;
%AXIS_LIB%\xmlsec.jar;
Rick.BanisterRick.Banister
Here's my batch file to generate the java sources:

@echo off

REM Configure axis to use the vastly superior CommonsHTTPSender class rather than the default HTTPSender class
REM as its transport, this is done by changing the transport entry in the client-config.wsdd file
REM from java:org.apache.axis.transport.http.HTTPSender to java:org.apache.axis.transport.http.CommonsHTTPSender
REM and adding Commons HTTP to the class path.

set PATH=C:\java\jdk1.5.0_07\bin;%PATH%

set MYLIB=C:/Projects/Java/axis-1_4/lib

java -version
java -classpath "client-config.wsdd;%MYLIB%/commons-httpclient-3.0-rc4.jar;%MYLIB%/axis.jar;%MYLIB%/activation.jar;%MYLIB%/mailapi_1_3_1.jar;%MYLIB%/axis-ant.jar;%MYLIB%/commons-discovery-0.2.jar;%MYLIB%/commons-logging-1.0.4.jar;%MYLIB%/jaxrpc.jar;%MYLIB%/log4j-1.2.8.jar;%MYLIB%/saaj.jar;%MYLIB%/wsdl4j-1.5.1.jar" org.apache.axis.wsdl.WSDL2Java -a -T 1.2 partner.wsdl.xml

pause

kminevkminev
I got it thanks guys.
manzjrmanzjr

where do you get the mail.jar file?

thanks in advance

nguntherngunther

You can download here:

 

 

http://www.java2s.com/Code/Jar/glassfish/Downloadmailjar.htm