java -cp C:/axis2-1.5/lib/activation-1.1.jar;C:/axis2-1.5/lib/axiom-api-1.2.8.jar;C:/axis2-1.5/lib/axiom-dom-1.2.8.jar;C:/axis2-1.5/lib/axiom-impl-1.2.8.jar;C:/axis2-1.5/lib/axis2-adb-1.5.jar;C:/axis2-1.5/lib/axis2-adb-codegen-1.5.jar;C:/axis2-1.5/lib/axis2-ant-plugin-1.5.jar;C:/axis2-1.5/lib/axis2-clustering-1.5.jar;C:/axis2-1.5/lib/axis2-codegen-1.5.jar;C:/axis2-1.5/lib/axis2-corba-1.5.jar;C:/axis2-1.5/lib/axis2-fastinfoset-1.5.jar;C:/axis2-1.5/lib/axis2-java2wsdl-1.5.jar;C:/axis2-1.5/lib/axis2-jaxbri-1.5.jar;C:/axis2-1.5/lib/axis2-jaxws-1.5.jar;C:/axis2-1.5/lib/axis2-jibx-1.5.jar;C:/axis2-1.5/lib/axis2-json-1.5.jar;C:/axis2-1.5/lib/axis2-kernel-1.5.jar;C:/axis2-1.5/lib/axis2-metadata-1.5.jar;C:/axis2-1.5/lib/axis2-mtompolicy-1.5.jar;C:/axis2-1.5/lib/axis2-saaj-1.5.jar;C:/axis2-1.5/lib/axis2-spring-1.5.jar;C:/axis2-1.5/lib/axis2-transport-http-1.5.jar;C:/axis2-1.5/lib/axis2-transport-local-1.5.jar;C:/axis2-1.5/lib/axis2-xmlbeans-1.5.jar;C:/axis2-1.5/lib/bcel-5.1.jar;C:/axis2-1.5/lib/commons-codec-1.3.jar;C:/axis2-1.5/lib/commons-fileupload-1.2.jar;C:/axis2-1.5/lib/commons-httpclient-3.1.jar;C:/axis2-1.5/lib/commons-io-1.4.jar;C:/axis2-1.5/lib/commons-lang-2.3.jar;C:/axis2-1.5/lib/commons-logging-1.1.1.jar;C:/axis2-1.5/lib/geronimo-annotation_1.0_spec-1.1.jar;C:/axis2-1.5/lib/geronimo-jaxws_2.1_spec-1.0.jar;C:/axis2-1.5/lib/geronimo-saaj_1.3_spec-1.0.1.jar;C:/axis2-1.5/lib/geronimo-stax-api_1.0_spec-1.0.1.jar;C:/axis2-1.5/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar;C:/axis2-1.5/lib/httpcore-4.0.jar;C:/axis2-1.5/lib/jalopy-1.5rc3.jar;C:/axis2-1.5/lib/jaxb-api-2.1.jar;C:/axis2-1.5/lib/jaxb-impl-2.1.7.jar;C:/axis2-1.5/lib/jaxb-xjc-2.1.7.jar;C:/axis2-1.5/lib/jaxen-1.1.1.jar;C:/axis2-1.5/lib/jettison-1.0-RC2.jar;C:/axis2-1.5/lib/jibx-bind-1.2.1.jar;C:/axis2-1.5/lib/jibx-run-1.2.1.jar;C:/axis2-1.5/lib/log4j-1.2.15.jar;C:/axis2-1.5/lib/mail-1.4.jar;C:/axis2-1.5/lib/mex-1.5.jar;C:/axis2-1.5/lib/neethi-2.0.4.jar;C:/axis2-1.5/lib/smack-3.0.4.jar;C:/axis2-1.5/lib/smackx-3.0.4.jar;C:/axis2-1.5/lib/soapmonitor-1.5.jar;C:/axis2-1.5/lib/woden-api-1.0M8.jar;C:/axis2-1.5/lib/woden-impl-dom-1.0M8.jar;C:/axis2-1.5/lib/wsdl4j-1.6.2.jar;C:/axis2-1.5/lib/wstx-asl-3.2.4.jar;C:/axis2-1.5/lib/xalan-2.7.0.jar;C:/axis2-1.5/lib/xercesImpl-2.6.2.jar;C:/axis2-1.5/lib/xml-apis-1.3.02.jar;C:/axis2-1.5/lib/xmlbeans-2.3.0.jar;C:/axis2-1.5/lib/xml-resolver-1.2.jar;C:/axis2-1.5/lib/XmlSchema-1.4.3.jar; org.apache.axis2.wsdl.WSDL2Java -uri http://192.168.100.176:8080/axis2/services/SimpleService?wsdl
http://localhost:8080/axis2/services/Hello?wsdl
從最簡單的開始 ,-uri 指定wsdl檔案> WSDL2Java -uri currencyConvert.wsdl-d 使用不同的data binding方法> WSDL2Java -uri currencyConvert.wsdl -d xmlbeans-a 產生非同步方法> WSDL2Java -uri currencyConvert.wsdl -a-t 產生測試case> WSDL2Java -uri currencyConvert.wsdl -t ...稍微複雜一些的,-p可以指定產生的package,-o指定產生的路徑,-ss產生服務端代碼wsdl2java -uri ../wsdl/currencyConvert.wsdl -o ../gen_src -ss -sd -g -p foo.bat再複雜一些,-ns2p 將namespace進行替換,多個中間用逗號隔開wsdl2java -uri ../wsdl/currencyConvert.wsdl -o ../wsdl/gen_src -ss -sd -g -p com.foo.bar -ns2p "http://www.xxx.yyy.com/zzz/v1.0"=com.foo.bar,"
命令參數說明:
? -d 產生用戶端執行類的class檔案的存放目錄?
? -s 產生用戶端執行類的源檔案的存放目錄?
? -p 定義產生類的包名?