jmeter 5 测试 soap 接口案例

Soap地址:http://www.webxml.com.cn/webservices/DomesticAirline.asmx?op=getDomesticAirlinesTime

Soap 请求示例

POST /webservices/DomesticAirline.asmx HTTP/1.1
Host: www.webxml.com.cn
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://WebXml.com.cn/getDomesticAirlinesTime"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getDomesticAirlinesTime xmlns="http://WebXml.com.cn/">
      <startCity>string</startCity>
      <lastCity>string</lastCity>
      <theDate>string</theDate>
      <userID>string</userID>
    </getDomesticAirlinesTime>
  </soap:Body>
</soap:Envelope>

一、建立线程组

1.1 添加线程组

测试计划 →添加 → 线程(用户) → 线程组

在这里插入图片描述

1.2 添加HTTP信息头管理器

线程组 →添加 → 配置元件 → HTTP信息头管理器

在这里插入图片描述

1.3 添加HTTP请求

线程组 →添加 → 取样器 → HTTP请求

http

1.4 添加查看结果树

线程组 →添加 → 监听器 → 查看结果树

在这里插入图片描述

1.5 添加聚合报告

线程组 →添加 → 监听器 → 聚合报告

在这里插入图片描述

二、配置线程组

2.1 线程组

名称:Soap测试
线程数:100
Ramp-UP时间:10
循环次数:1

参数具体含义:https://www.lfhacks.com/tech/jmeter-thread-properties#model

在这里插入图片描述

2.2 HTTP信息头管理器

Content-Type: text/xml; charset=utf-8

在这里插入图片描述

2.3 HTTP请求

根据请求示例填入对应参数

在这里插入图片描述

消息体数据

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getDomesticAirlinesTime xmlns="http://WebXml.com.cn/">
      <startCity>北京</startCity>
      <lastCity>上海</lastCity>
      <theDate>2020-9-30</theDate>
      <userID></userID>
    </getDomesticAirlinesTime>
  </soap:Body>
</soap:Envelope>

三、运行查看

3.1 返回值

在这里插入图片描述

3.2 聚合报告

在这里插入图片描述

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值