利用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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值