ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

想提升测试效率?这个jmeter开发webserice协议的脚本必备!

2026/9/12 12:06:21 拓冰建站 浏览量
想提升测试效率?这个jmeter开发webserice协议的脚本必备!

webserivice协议脚本开发

webserivice协议脚本开发的两种方式:

    1. HTTP请求
    2. 通过soap模板
    3. SOAP/XML-RPC Request(jmeter3.2之后已经不支持)
SOAP/XML-RPC Request请求

步骤:

1、测试计划

2、添加线程组

3、添加取样器,SOAP/XML

-RPC Request请求

地址:http://www.webxml.

com.cn/WebServices/WeatherWebService.asmx?

op=getWeatherbyCityNam

URL:WeatherWebService Web 服务

soap/XML-RPC Data

http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

soap12:Body

http://WebXml.com.cn/">

深圳

HTTP请求方式开发webservice接口

网址:

Host: www.webxml.com.cn

get请求:

URL:/WebServices/ChinaZipSearchWebService.asmx/getZipCodeByAddress?theProvinceName=广东&theCityName=深圳&theAddress=&userID=

post方式:

Host: www.webxml.com.cn

Content-Type: application/x-www-form-urlencoded

URL:/WebServices/ChinaZipSearchWebService.asmx/getZipCodeByAddress

data:

theProvinceName=广东&theCityName=深圳&theAddress=&userID=

soap模板开发webservice协议脚本

分别介绍

用户自定义变量(user defined variables)

HTTP请求默认值(HTTP Request Defaults)

HTTP消息头管理器(HTTP Header Manager)

HTTP请求

URL:/WebServices/ChinaZipSearchWebService.asmx

data:

<?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <getZipCodeByAddress xmlns="http://WebXml.com.cn/"> <theProvinceName>广东</theProvinceName> <theCityName>深圳</theCityName> <theAddress></theAddress> <userID></userID> </getZipCodeByAddress> </soap12:Body> </soap12:Envelope>

没有接口文档怎么获取报文信息

1、安装soapui工具,下载地址:SoapUI Latest Releases | SoapUI

2、新建soap 项目