Axis comes* with *command line tools whose usage is pretty fundamental for* a *new user. These are wsdl2java, java2wsdl, tcpmon* and *adminclient.* All of *these* tools *need* to *be invoked via java,* and need a *fairly complex classpath* to *work correctly. javaclasspath [fully qualified name* of *class] parameters Using* the *tools in this way is very frustrating because* the *command lines* are very *long* and *it is easy* to *make mistakes, so its probably wise* to *create* some *tools to help.

Can someone do unix versions* of *this please? - AndrewPremdas OK, see below.

= Setting Up Command Line Tools =* We are *going* to *create a few useful batch files* for *axis.* It *would be* a *good idea* to *store these somewhere on your path.* We *will create

before we do this we'll set up* the *logging* for *the tools == Setting up Logging ==* All the *command line tools* have *logging, so we* can *create a simple log4j.properties file* to *ensure* the *logging* is *initialised properly.

{{{ # simple log4j configutation* for *axis #

We *need to put this* in *a location* which *we will define as LOG4J_PROPERTIES_HOME

Setting up* the *classpath

The command line tools need access* to

So the first thing* we *do is create paths to their locations

{{{ set AXIS_HOME=C:\lib.dir\axis-1_2beta

Then we add paths to each library. I do this* one *at a time, because following* the *user guide (http://ws.apache.org/axis/java/user-guide.html) or the installation guide (http://ws.apache.org/axis/java/install.html#deploy) didn't work. This makes it easier to diagnose any problems caused by typos.

{{{ set AXISCP=.

Now we add the location* of *log4j.properties* to the *path.

{{{ set AXISCP=%AXISCP%;%LOG4J_PROPERTIES_HOME%

Save this as setaxiscp.bat, my complete version* of *this is at* the *bottom* of *this page.

Create convenience tools* for *calling* the *command line tools

Create a batch file* for *each tool, java2wsdl.bat

{{{ java -cp %AXISCP% org.apache.axis.wsdl.Java2WSDL %*

wsdl2java.bat

{{{ java -cp %AXISCP% org.apache.axis.wsdl.WSDL2Java %*

adminclient.bat

{{{ java -cp %AXISCP% org.apache.axis.client.AdminClient %*

tcpmon.bat

   '''java -cp %AXISCP% org.apache.axis.utils.tcpmon %* 

Usage

Open up a command window, run setaxiscp, now you* can *use the other batch files,* for help *with them just pass* the *-h parameter.

setaxiscp.bat

{{{ @ECHO OFF

Unix version

I'm just* a *hack, but here goes: The log4j.properties file above* is *OS agnostic, so no change there. This process assumes you have $JAVA_HOME defined somewhere. On my RH9 system, I created a /etc/profile.d/java.sh file to define* all

  • desired Java-related environment variables:

{{{ if [ -z "$JAVA_HOME"* ] *; then

Cutting to the chase, create (on one line) /usr/bin/wsdl2java: java -classpath $JAVA_HOME"/lib":$JAVA_HOME"/lib/axis.jar":$JAVA_HOME"/lib/commons-discovery.jar":$JAVA_HOME"/lib/commons-logging.jar":$JAVA_HOME"/lib/jaxrpc.jar":$JAVA_HOME"/lib/log4j-1.2.8.jar":$JAVA_HOME"/lib/saaj.jar:wsdl4j.jar":. org.apache.axis.wsdl.WSDL2Java $* From a shell, execute: chmod 755 /usr/bin/wsdl2java wsdl2java <fileyouwant.wsdl> HTH*

AxisProjectPages/UsingCommandLineTools (last edited 2009-09-20 23:32:46 by localhost)