SOCKET
WSDL2Java
Some brief notes from Atif on using the WSDL2Java program.
You'll find the Axis WSDL-to-Java tool in "org.apache.axis.wsdl.WSDL2Java". The basic invocation form looks like this:
$> java -cp %AXISCLASSPATH% org.apache.axis.wsdl.WSDL2Java (WSDL-file-URL)
For example lets say we have a web service running at the following address:
http://localhost:8080/samples/services/Version
THEN we would invoke Axis WSDL-to-Java tool like THIS:
$> java -cp %AXISCLASSPATH% org.apache.axis.wsdl.WSDL2Java http://localhost:8080/samples/services/Version?wsdl
This will create java classes in the current directory.
LETS say we want the ouput of Axis WSDL-to-Java tool to go into certain directory THEN you need to use the -o option.
e.g. $> java -cp %AXISCLASSPATH% org.apache.axis.wsdl.WSDL2Java http://localhost:8080/samples/services/Version?wsdl -oC:\test
By default WSDL-to-Java tool will put the ouput classess into packages WHICH mirror the targetNamespace in the web service WSDL.
To change this default YOU need to use the following option: -p
e.g. $> java -cp %AXISCLASSPATH% org.apache.axis.wsdl.WSDL2Java http://localhost:8080/samples/services/Version?wsdl -pws.version
Posted at 04:26PM Apr 06, 2006 by Brian Peter Clark in Misc technical |