RoboJ1M
RoboJ1M

Reputation: 1640

How do I run WSDL2Java with Axis 1.0?

Our clients are using Axis 1.0 to build a client to our WCF based SOAP services.

It's not working for them and I want to run the WSDL2Java client locally on my machine so I can experiment.

I already have the JDK installed on my machine, java works from the command line.

Reading the installation guide for Axis 1.0, and using the -cp switch, I get the following:

java -cp E:\Temp\Axis\xml-axis-10\lib org.apache.axis.wsdl.WSDL2Java

(that path contains all the jar files)

And get the following:

Error: Could not find or load main class org.apache.axis.wsdl.WSDL2Java

Anybody know what I'm doing wrong?

UPDATE1:

I've tried setting the user CLASSPATH to:

C:\Program Files\Java\jdk1.7.0_09\lib;E:\Temp\Axis\xml-axis-10\lib

No dice, same error.

UPDATE2:

If I try this command line, I get something different, it now appear to be loading the class:

E:\Temp>java -cp E:\Temp\Axis\xml-axis-10\lib\axis.jar org.apache.axis.wsdl.WSDL2Java
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
        at org.apache.axis.components.logger.LogFactory$1.class$(LogFactory.java:68)
        at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:84)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:80)
        at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:72)
        at org.apache.axis.i18n.ProjectResourceBundle.<clinit>(ProjectResourceBundle.java:92)
        at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.java:71)
        at org.apache.axis.utils.Messages.<clinit>(Messages.java:81)
        at org.apache.axis.wsdl.WSDL2Java.<clinit>(WSDL2Java.java:106)

E:\Temp>

Upvotes: 4

Views: 13088

Answers (3)

Sudhir Reddy
Sudhir Reddy

Reputation: 1

Works for me with java -cp %CD%\* org.apache.axis.wsdl.WSDL2Java after surrounding the classpath with double-quotes. You should be in the directory where the axis and jar dependencies are.

Upvotes: 0

Harry
Harry

Reputation: 21

Try this: java -cp %CD%\* org.apache.axis.wsdl.WSDL2Java

The jar for logging is already in the lib directory. The above command should work if you are in the lib directory.

Upvotes: 2

Adam K.
Adam K.

Reputation: 56

If you only provide folders in your classpath, the jar files will not be loaded. You should use jar name (as in your UPDATE2) or wildcards (have a look here and here).

As for your problem with missing LogFactory - you should add to your classpath a proper jar (eg. commons-logging.jar, try http://www.findjar.com).

Upvotes: 3

Related Questions