WSDL to Java using Axis2

I just used Axis2 to generate code from the WSDL I generated earlier with Microsoft Visual Studio. I’m posting the batch file in the hope that it will save someone else a few minutes.

rem change this to the uri or path to your wsdl
set WSDL=”schema\book.wsdl”

rem check JAVA_HOME, ANT_HOME, and AXIS2_HOME settings
echo JAVA_HOME=%JAVA_HOME%
echo ANT_HOME=%ANT_HOME%
echo AXIS2_HOME=%AXIS2_HOME%

rem make sure that the java bin directory is in your path
echo PATH=%PATH%

REM setup the classpath painfully
set CP=%CLASS_PATH%
set AXIS2_LIB=%AXIS2_HOME%\lib\
set CP=%CP%;%AXIS2_LIB%activation-1.1.jar
set CP=%CP%;%AXIS2_LIB%annogen-0.1.0.jar
set CP=%CP%;%AXIS2_LIB%axiom-api-1.2.7.jar
set CP=%CP%;%AXIS2_LIB%axiom-dom-1.2.7.jar
set CP=%CP%;%AXIS2_LIB%axiom-impl-1.2.7.jar
set CP=%CP%;%AXIS2_LIB%axis2-adb-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-adb-codegen-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-ant-plugin-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-clustering-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-codegen-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-corba-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-fastinfoset-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-java2wsdl-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-jaxbri-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-jaxws-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-jaxws-api-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-jibx-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-json-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-jws-api-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-kernel-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-metadata-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-mtompolicy-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-saaj-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-saaj-api-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-spring-1.4.jar
set CP=%CP%;%AXIS2_LIB%axis2-xmlbeans-1.4.jar
set CP=%CP%;%AXIS2_LIB%backport-util-concurrent-3.1.jar
set CP=%CP%;%AXIS2_LIB%commons-codec-1.3.jar
set CP=%CP%;%AXIS2_LIB%commons-fileupload-1.2.jar
set CP=%CP%;%AXIS2_LIB%commons-httpclient-3.1.jar
set CP=%CP%;%AXIS2_LIB%commons-io-1.4.jar
set CP=%CP%;%AXIS2_LIB%commons-logging-1.1.1.jar
set CP=%CP%;%AXIS2_LIB%geronimo-annotation_1.0_spec-1.1.jar
set CP=%CP%;%AXIS2_LIB%geronimo-stax-api_1.0_spec-1.0.1.jar
set CP=%CP%;%AXIS2_LIB%httpcore-4.0-beta1.jar
set CP=%CP%;%AXIS2_LIB%httpcore-nio-4.0-beta1.jar
set CP=%CP%;%AXIS2_LIB%jalopy-1.5rc3.jar
set CP=%CP%;%AXIS2_LIB%jaxb-api-2.1.jar
set CP=%CP%;%AXIS2_LIB%jaxb-impl-2.1.6.jar
set CP=%CP%;%AXIS2_LIB%jaxb-xjc-2.1.6.jar
set CP=%CP%;%AXIS2_LIB%jaxen-1.1.1.jar
set CP=%CP%;%AXIS2_LIB%jettison-1.0-RC2.jar
set CP=%CP%;%AXIS2_LIB%jibx-bind-1.1.5.jar
set CP=%CP%;%AXIS2_LIB%jibx-run-1.1.5.jar
set CP=%CP%;%AXIS2_LIB%log4j-1.2.15.jar
set CP=%CP%;%AXIS2_LIB%mail-1.4.jar
set CP=%CP%;%AXIS2_LIB%mex-1.4.jar
set CP=%CP%;%AXIS2_LIB%neethi-2.0.4.jar
set CP=%CP%;%AXIS2_LIB%soapmonitor-1.4.jar
set CP=%CP%;%AXIS2_LIB%woden-api-1.0M8.jar
set CP=%CP%;%AXIS2_LIB%woden-impl-dom-1.0M8.jar
set CP=%CP%;%AXIS2_LIB%wsdl4j-1.6.2.jar
set CP=%CP%;%AXIS2_LIB%wstx-asl-3.2.4.jar
set CP=%CP%;%AXIS2_LIB%xalan-2.7.0.jar
set CP=%CP%;%AXIS2_LIB%xercesImpl-2.8.1.jar
set CP=%CP%;%AXIS2_LIB%xml-apis-1.3.04.jar
set CP=%CP%;%AXIS2_LIB%xml-resolver-1.2.jar
set CP=%CP%;%AXIS2_LIB%xmlbeans-2.3.0.jar
set CP=%CP%;%AXIS2_LIB%XmlSchema-1.4.2.jar

REM -s synchronous style code only
REM -uri
REM -o output directory
REM -ss generate server side code
REM -sd generate service descriptor
REM -g generate all the classes (use with ss)
REM -ssi generate an interface

REM defining W2J so the command will not wordwrap in the blog
set W2J=org.apache.axis2.wsdl.WSDL2Java

java -cp %CP% %W2J% -uri %WSDL% -ss -sd -s -o gensrc -g -ssi

Advertisements

~ by mlbiss on June 15, 2008.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: