學習 WebService 第四步:利用WSDL(URL)生成WebService客戶端<初級>


我用的是最簡單的方法,利用jdk的命令wsimport -keep -p 包路徑 -d 代碼存放位置 WSDL網址

藍色是命令粉色是存放位置,橘色是URL

C:\Program Files\IBM\SQLLIB\java\jdk\bin>wsimport -keep -p com.demo.client -d C:\Users\IBM_ADMIN\Documents\MyWorking\WebService\WSDL2JAVA http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL
parsing WSDL...

[WARNING] Ignoring SOAP port "MobileCodeWSSoap12": it uses non-standard SOAP 1.2 binding.
You must specify the "-extension" option to use this binding.
  line 199 of http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL

[WARNING] ignoring port "MobileCodeWSHttpGet": no SOAP address specified. try running wsimport with -extension switch.
  line 202 of http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL

[WARNING] ignoring port "MobileCodeWSHttpPost": no SOAP address specified. try running wsimport with -extension switch.
  line 205 of http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL

Generating code...

Compiling code...

C:\Program Files\IBM\SQLLIB\java\jdk\bin>

我用的這個URL:http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL(這是個免費服務,大家可以用,每天30次)

生成如下文件,其中Java文件是我后續要用的,Class文件據說可以直接打包用(沒試過)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM