利用SoapUI 测试web service的方法介绍
http://boyun.sh.cn/blog/?p=1076
?
1. 簡介
SoapUI是用java開發的測試web service的工具。
2. 安裝
2.1. 下載地址
http://www.soapui.org/
2.2. 安裝
By downloading and installing soapUI using the windows installer from SourceForge soapUI Web Site, which includes the required 1.6 JRE (Java Runtime Environment). Use the installer if you are unsure about your systems Java installation or if you want startup menu icons and an uninstaller.
1.6 JRE 環境
雙擊安裝就可以使用了。
2.3. 使用說明
http://www.soapui.org/userguide/index.html
3. 開始測試
3.1. 準備
soapUI已經安裝成功
知道要測試的服務的地址,這里以EBI的WSDbfetch為例wsdl地址為:
http://www.ebi.ac.uk/Tools/webservices/wsdl/WSDbfetch.wsdl
3.2. 啟動程序
soapui-25-beta2
3.3. 新建計劃
File->New soapUI Project
新建計劃
Ok后,查看提供的web service的服務。
web service的服務列表
3.4 示例1 getSupportedDBs(不需要編輯請求)
雙擊Request1,顯示Request界面,點擊綠色的提交按鈕,就會遞交請求,同時會在右側返回結果,請求與結果都為XML格式。
3.5 示例2 fetchBatch(編輯請求)
請求的頁面有問號的地方,都是需要你編輯,如同查詢時你選擇數據庫輸入查詢結果一樣。
fetchBatch
<soapenv:Body>
????? <wsd:fetchBatch soapenv:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/“>
???????? <db xsi:type=”xsd:string”>uniprotkb</db>
???????? <ids xsi:type=”xsd:string”>WAP_MOUSE,WAP_RAT</ids>
???????? <format xsi:type=”xsd:string”>default</format>
???????? <style xsi:type=”xsd:string”>default</style>
????? </wsd:fetchBatch>
?? </soapenv:Body>
提交返回結果
返回結果
4 說明
本文只是對SoapUI 做了簡單的介紹,主要用其來查看web service提供的接口,以及返回的結果,以便進一步的利用,但是SoapUI的功能遠不止這些,其可以對web service進行功能上和性能上的測試。
總結
以上是生活随笔為你收集整理的利用SoapUI 测试web service的方法介绍的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java连接ibm mq
- 下一篇: Oracle INTERVAL