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 聚合报告

在这里插入图片描述

Guess you like

Origin blog.csdn.net/qq_39680564/article/details/108883835