微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

webService测试工具及使用方法

转载:http://boyun.sh.cn/blog/?p=1076

利用SoapUI 测试web service的方法介绍

boyun发表于 2009-06-16 12:28 | 阅读 20,699 views

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

soapui-25-beta2

3.3. 新建计划
File->New soapUI Project

新建计划

新建计划

Ok后,查看提供的web service的服务。

web service的服务列表

web service的服务列表

3.4 示例1 getSupportedDBs(不需要编辑请求)

双击Request1,显示Request界面,点击绿色的提交按钮,就会递交请求,同时会在右侧返回结果,请求与结果都为XML格式。

soapui-25-beta25

3.5 示例2 fetchBatch(编辑请求)

请求的页面有问号的地方,都是需要你编辑,如同查询时你选择数据库输入查询结果一样。

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进行功能上和性能上的测试。

@H_502_153@

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐