jmeter3.0 webservice接口测试 每个线程发送不同的数据
2016-11-24 15:33
330 查看
和http请求参数类似,webservice直接将Soap/XML-RPC Data报文中需要变化的值替换为函数即可。
${__CSVRead(G:\tmp\sendMsg.txt,0)},第一个线程读第一行第一列,第二个线程读第二行第一列。
先将完整报文写入Soap/XML-RPC Data中,红色部分是要变化的部分
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{"time":"20161124113553","duration":"2","serialId":"ycwp201611241135533526","length":4704,"format":"amr","type":2,"deviceId":"123456789"}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope>
更改后
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{"time":"20161124113553","duration":"2","serialId":"ycwp201611241135533526","length":4704,"format":"amr","type":2,"deviceId":"${__CSVRead(G:\tmp\sendMsg.txt,0)}"}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope>
完整界面:
在指定路径配置好请求中需要的数据,就能看到每个线程发送的数据不一样了。
${__CSVRead(G:\tmp\sendMsg.txt,0)},第一个线程读第一行第一列,第二个线程读第二行第一列。
先将完整报文写入Soap/XML-RPC Data中,红色部分是要变化的部分
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{"time":"20161124113553","duration":"2","serialId":"ycwp201611241135533526","length":4704,"format":"amr","type":2,"deviceId":"123456789"}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope>
更改后
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{"time":"20161124113553","duration":"2","serialId":"ycwp201611241135533526","length":4704,"format":"amr","type":2,"deviceId":"${__CSVRead(G:\tmp\sendMsg.txt,0)}"}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope>
完整界面:
在指定路径配置好请求中需要的数据,就能看到每个线程发送的数据不一样了。
相关文章推荐
- jmeter3.0 http接口测试 每个线程且每次请求发送不同的数据
- Jmeter发送SOAP请求对WebService接口测试
- Jmeter 接口测试发送数据乱码的问题
- Jmeter发送SOAP请求对WebService接口测试
- VC/MFC 不同进程间的消息通信与数据(字符串)发送
- 主线程和子线程的通讯之主线程用bundle发送数据到子线程
- VC/MFC 不同进程间的消息通信与数据(字符串)发送
- VC/MFC 不同进程间的消息通信与数据(字符串)发送
- 关于windows 超级终端与其他一些串口工具的发送数据时的显著不同特性
- Android学习笔记---29_构建soap协议内容,发送xml数据和调用webservice,手机号码归属地查询器
- delphi下不同线程发送字符串示例
- 如何优化WebService进行大批量数据传送(WSE3.0应用技巧)
- Android 向服务器发送XML数据及调用webservice
- WM_COPYDATA消息机制 不同进程间发送结构体数据
- 在Delphi下,使用线程向窗体发送动态数组数据的解决方法~
- Android--通过Http协议向web服务器发送XML数据和调用webService
- [ACE程序员教程笔记]ACE_Connector使用一个连接多个线程发送数据
- 关于VS2005 调用WebService返回发送请求数据失败问题
- 用一个工作线程来发送询问命令,等待接收到下位机应答数据后退出。如果两秒下位机未应答,则重发询问命令。重发10次下位机不应答,则认为通信故障,
- Android发送SOAP数据给服务器调用webservice,实现手机号归属地查询