LoadRunner测试WebService接口(Soap接口)——内附公共Web Services API

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/duzilonglove/article/details/80327882

1、什么是Web Service接口

讲不好,请参考文章
https://www.cnblogs.com/thiaoqueen/p/7143797.html
https://www.cnblogs.com/phoebes/p/8029464.html

2、公共资源

天气预报Web服务,数据来源于中国气象局
Endpoint :http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl

IP地址来源搜索 WEB 服务(是目前最完整的IP地址数据)
Endpoint:http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl

随机英文、数字和中文简体字 WEB 服务
Endpoint:http://www.webxml.com.cn/WebServices/RandomFontsWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/RandomFontsWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/RandomFontsWebService.asmx?wsdl

中国邮政编码 <-> 地址信息双向查询/搜索 WEB 服务
Endpoint:http://www.webxml.com.cn/WebServices/ChinaZipSearchWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/ChinaZipSearchWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/ChinaZipSearchWebService.asmx?wsdl

验证码图片 WEB 服务 支持中文、字母、数字 图像和多媒体
Endpoint:http://www.webxml.com.cn/WebServices/ValidateCodeWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/ValidateCodeWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/ValidateCodeWebService.asmx?wsdl

Email 电子邮件地址验证 WEB 服务
Endpoint:http://www.webxml.com.cn/WebServices/ValidateEmailWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/ValidateEmailWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/ValidateEmailWebService.asmx?wsdl

中文简体字 <->繁体字转换WEB 服务
Endpoint:http://www.webxml.com.cn/WebServices/TraditionalSimplifiedWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/TraditionalSimplifiedWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/TraditionalSimplifiedWebService.asmx?wsdl

中文 <-> 英文双向翻译WEB 服务
Endpoint :http://www.webxml.com.cn/WebServices/TranslatorWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/TranslatorWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/TranslatorWebService.asmx?wsdl

火车时刻表 WEB 服务 (第六次提速最新列车时刻表)
Endpoint :http://www.webxml.com.cn/WebServices/TrainTimeWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/TrainTimeWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/TrainTimeWebService.asmx?wsdl

中国股票行情数据 WEB 服务(支持深圳和上海股市的基金、债券和股票)
Endpoint :http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx?wsdl

即时外汇汇率数据 WEB 服务
Endpoint :http://www.webxml.com.cn/WebServices/ExchangeRateWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/ExchangeRateWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/ExchangeRateWebService.asmx?wsdl

腾讯QQ在线状态 WEB 服务
Endpoint :http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx
Disco :http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?disco
WSDL :http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl

中国电视节目预告(电视节目表) WEB 服务
Endpoint :http://www.webxml.com.cn/webservices/ChinaTVprogramWebService.asmx
Disco :http://www.webxml.com.cn/webservices/ChinaTVprogramWebService.asmx?disco
WSDL :http://www.webxml.com.cn/webservices/ChinaTVprogramWebService.asmx?wsdl

外汇-人民币即时报价 WEB 服务
Endpoint:http://www.webxml.com.cn/WebServices/ForexRmbRateWebService.asmx
Disco :http://www.webxml.com.cn/WebServices/ForexRmbRateWebService.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/ForexRmbRateWebService.asmx?wsdl

中国股票行情分时走势预览缩略图 WEB 服务
Endpoint : http://www.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx
Disco :http://www.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx?disco
WSDL : http://www.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx?wsdl

国内飞机航班时刻表 WEB 服务
Endpoint :http://www.webxml.com.cn/webservices/DomesticAirline.asmx
Disco : http://www.webxml.com.cn/webservices/DomesticAirline.asmx?disco
WSDL : http://www.webxml.com.cn/webservices/DomesticAirline.asmx?wsdl

中国开放式基金数据 WEB 服务
Endpoint :http://www.webxml.com.cn/WebServices/ChinaOpenFundWS.asmx
Disco : http://www.webxml.com.cn/WebServices/ChinaOpenFundWS.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/ChinaOpenFundWS.asmx?wsdl

股票行情数据 WEB 服务(支持香港、深圳、上海基金、债券和股票;支持多股票同时查询)
Endpoint :http://www.webxml.com.cn/WebServices/StockInfoWS.asmx
Disco :http://www.webxml.com.cn/WebServices/StockInfoWS.asmx?disco
WSDL :http://www.webxml.com.cn/WebServices/StockInfoWS.asmx?wsdl

查询手机:http://www.yodao.com/smartresult-xml/search.s?type=mobile&q=手机号码

查询IP:http://www.yodao.com/smartresult-xml/search.s?type=ip&q=IP地址

查询身份证:http://www.yodao.com/smartresult-xml/search.s?type=id&q=身份证号码

快递查询接口http://webservice.36wu.com/ExpressService.asmx

ip查询接口http://webservice.36wu.com/ipService.asmx

天气预报接口http://webservice.36wu.com/weatherService.asmx

身份证查询接口http://webservice.36wu.com/IdCardService.asmx

手机归属地接口http://webservice.36wu.com/MobilePhoneService.asmx

翻译接口http://webservice.36wu.com/TranslationService.asmx

火车时刻接口:http://webservice.36wu.com/TrainService.asmx

股票查询接口:http://webservice.36wu.com/StockService.asmx

邮编接口:http://webservice.36wu.com/ZipcodeService.asmx

二维码Web服务
http://webservice.36wu.com/DimensionalCodeService.asmx

公交查询Web服务
http://webservice.36wu.com/mapService.asmx

ISBN查询Web服务
http://webservice.36wu.com/ISBNService.asmx

ICP备案查询Web服务

http://webservice.36wu.com/ICPServic.asmx

权威周公解梦:
http://www.gpsso.com/WebService/Dream/Dream.asmx

身份证信息免费查询WEB服务
http://www.gpsso.com/webservice/idcard/idcard.asmx

IP地址来源查询
http://www.gpsso.com/WebService/IP/GetIP.asmx

手机号码归属地查询
http://www.gpsso.com/WebService/Phone/Phone.asmx

实时彩票开奖数据免费webservice
http://www.gpsso.com/webservice/caipiao/award.asmx

快递单号免费查询WEB服务(支持上百家快递和物流)
http://www.gpsso.com/webservice/kuaidi/kuaidi.asmx

火车时刻表 WEB 服务 (第六次提速最新列车时刻表)
http://webservice.webxml.com.cn/WebServices/TrainTimeWebService.asmx

国内飞机航班时刻表 WEB 服务
http://webservice.webxml.com.cn/webservices/DomesticAirline.asmx

2500多个城市天气预报 WEB服务
http://www.webxml.com.cn/WebServices/WeatherWebService.asmx

http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx
http://www.gpsso.com/webservice/weather/weatherinfo.asmx(六天 + 实时)

CIP核字号验证查询
http://www.gpsso.com/WebService/Book/BookInfo.asmx

标准图书编号ISBN查询
http://www.gpsso.com/WebService/Book/BookInfo.asmx

商品条形码查询服务
http://www.gpsso.com/WebService/GoodsCode/Gds.asmx

手机IMEI查询
http://www.gpsso.com/WebService/Phone/Phone.asmx

3、LR测试Web Services接口

大家常用LR来测试HTTP请求,今天来讲讲如何使用LR测试Web Services接口。其实特别简单。
我们拿到的Web Services接口应该是一个URL或者一个wsdl文件
(1)点击manage services,点击import,输入url,点击import按钮;如下图所示
这里写图片描述
(2)点击“OK”按钮,如下图所示:
这里写图片描述
(3)到上面为止已经导入了该webservice文件,注意这包含多个接口
这里写图片描述
注意,我上面的图片中option中,可以看到包含3个接口

(4)我们选择getCountryCityByIP这个接口
左侧可以看到input Arguments和Output Arguments

(5)结果
这里写图片描述

4、遇到问题总结

上一步已经准备好了Web Services接口,让我们来运行一下试试。
这里写图片描述
很遗憾,没有运行成功。
报错信息提示:
Error:To continue, WSE2 and WSE3 must be installed on your machine. The setup programs for WSE2.0 SP3 and WSE3.0 are included in the [LoadRunner installation DVD\lrunner\Common folder or can be downloaded from the internet]
简单翻译:
错误,要想继续的话,需要将 WSE2和 WSE3 安装到你的电脑。安装程序呢在LR安装文件的某个目录可以找到或者从网上下载。

我的LR安装文件是从网上下载的exe文件,所以只能从网上下载,所幸在Microsoft官网找到了
WSE2下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=23689
WSE3 下载地址:https://www.microsoft.com/en-us/download/confirmation.aspx?id=14089

如果你下载有问题,可以到QQ群:460430320下载
下载文件为 “.msi”文件,直接双击,安装即可

再次运行LR脚本,成功
这里写图片描述

猜你喜欢

转载自blog.csdn.net/duzilonglove/article/details/80327882