当前位置:网站首页>JMeter之WebService(soap)请求
JMeter之WebService(soap)请求
2022-07-21 05:20:00 【测试超有范】
目录
WebService 的概念
Web 是使应用程序可以与平台和编程语言无关的方式进行相互通信的一项技术。Web 服务是一个软件接口,它描述了一组可以在网络上通过标准化的 XML 消息传递访问的操作。它使用基于 XML 语言的协议来描述要执行的操作或者要与另一个 Web 服务交换的数据。一组以这种方式交互的 Web 服务在面向服务的体系结构(Service-Oriented Architecture,SOA)中定义了特殊的 Web 服务应用程序。
简单的说WebService是一个SOA(面向服务的编程)的架构,它是不依赖于语言,不依赖于平台,可以实现不同的语言(通过 xml 描述)间的相互调用,通过Internet进行基于Http协议的网络应用间的交互。通过SOAP在Web上提供的软件服务,使用WSDL文件进行说明,并通过UDDI进行注册。
XML:(Extensible Markup Language)扩展型可标记语言。面向短期的临时数据处理、面向万维网络,是Soap的基础。
Soap:(Simple Object Access Protocol)简单对象存取协议。是XML Web Service 的通信协议。当用户通过UDDI找到你的WSDL描述文档后,他通过可以SOAP调用你建立的Web服务中的一个或多个操作。SOAP是XML文档形式的调用方法的规范,它可以支持不同的底层接口,像HTTP(S)或者SMTP。
WSDL:(Web Services Description Language) WSDL 文件是一个 XML 文档,用于说明一组 SOAP 消息以及如何交换这些消息。大多数情况下由软件自动生成和使用。
UDDI :(Universal Description, Discovery, and Integration) 是一个主要针对Web服务供应商和使用者的新项目。在用户能够调用Web服务之前,必须确定这个服务内包含哪些商务方法,找到被调用的接口定义,还要在服务端来编制软件,UDDI是一种根据描述文档来引导系统查找相应服务的机制。UDDI利用SOAP消息机制(标准的XML/HTTP)来发布,编辑,浏览以及查找注册信息。它采用XML格式来封装各种不同类型的数据,并且发送到注册中心或者由注册中心来返回需要的数据。
WebService在JMeter中请求
JMeter较老的版本中提供一个SOAP Sampler,在后续版本更新中已删除,原因为WebService本质也是个HTTP请求,完全可以使用HTTP请求进行WebService请求,下面也有举例如何使用JMeter进行WebService请求。
接口练习地址:http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?op=getMobileCodeInfo
请求参数:
POST /WebServices/MobileCodeWS.asmx HTTP/1.1
Host: ws.webxml.com.cn
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://WebXml.com.cn/getMobileCodeInfo"
<?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>
<getMobileCodeInfo xmlns="http://WebXml.com.cn/">
<mobileCode>string</mobileCode>
<userID>string</userID>
</getMobileCodeInfo>
</soap:Body>
</soap:Envelope>
响应:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?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>
<getMobileCodeInfoResponse xmlns="http://WebXml.com.cn/">
<getMobileCodeInfoResult>string</getMobileCodeInfoResult>
</getMobileCodeInfoResponse>
</soap:Body>
</soap:Envelope>
JMeter中实现WebService请求:
可以看出来请求方式和正常HTTP请求是一致的。
响应结果展示:
边栏推荐
- postman“在Tests中通过data.token获取token失败”的解决方法
- jmeter脚本生成基于rap2
- 公司只有 1个测试,领导却让我测试 10个项目
- postman newman jenkins
- After modifying the IP address, use ifconfig on the terminal to check that the IP address is not updated
- 10061 unknown error error is reported when connecting to the previously available MySQL database
- 用例练习1
- MySQL经典面试题 14 道
- Notes on generation model (I): basic knowledge of probability
- 拼夕夕面试题之优惠券超发怎么去测试?
猜你喜欢
ms17_ 010 invading win7
What to do if the research and development quality is poor
研发质量差,怎么办
MCU demand of smart meters and ranking of meter chip manufacturers
“cannot get hvm parameter CONSOLE_EVTCHN (18): -22!” Solution of
[advanced semiconductor process technology series] strained silicon process technology
charles常用功能
Test case exercise 2 - vendor account information
文件下载,用例怎么写?
【软件测试模型进化】
随机推荐
Write the creation and query modification of simple and orderly linked list
设置表单
How to do regression test
遵守指南,快速提升自己:功能测试如何快速转向自动化测试
对于依赖第三方的接口如何进行测试?
“jmeter使用xpath提取器获取请求响应中的value值作为下一个请求的输入”案例
. WHL and Py installation method
自学软件测试要学哪些?
Test case exercise 2 - vendor account information
Writing transpose of third-order matrix in C language
Calculation of Jacobian matrix (3D reconstruction task2-4)
Use of main function with command line parameters
测试用例管理工具推荐
类的继承性实验报告
基础的md5加密
004_ SSSS_ Image-to-Image Translation with Conditional Adversarial Networks
如何从业务测试过渡到测试开发呢?
MySQL经典面试题 14 道
如何做 APP 升级测试 ?
测试点练习