1. 程式人生 > >性能測試十:jmeter進階之webService與socket

性能測試十:jmeter進階之webService與socket

soc 連接 執行 web mls 服務 nal con 選擇

一、webService

1、添加http post請求
2、添加header:Conent-type:text/xml

Post請求的body中填寫
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://webservice.lee.com/">
<soapenv:Header/>
<soapenv:Body>
<web:getOrderInfo>
<!--Optional:-->
<arg0>aaa</arg0>

<!--Optional:-->
<arg1>123</arg1>
</web:getOrderInfo>
</soapenv:Body>
</soapenv:Envelope>

其中,紅色字體是需要根據不同的webservice接口進行修改,其他保持固定
xmlns:web=“http://webservice.lee.com/”是包名
web:getOrderInfoById是方法名
arg為參數

4.x以下添加

4.x以上添加技術分享圖片

技術分享圖片

webService都是post請求

技術分享圖片

header:Conent-type:text/xml

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

二、socket

服務器名稱或IP:填寫socket接口的ip

端口號:寫socket接口的端口號

Re-use connection:是否重用鏈接,如果選擇,同一個線程執行的所有請求都會使用一個tcp連接

Re-use connection+close connection:每個請求結束後關閉連接

End of line byte value:socket接口返回的數據結尾標識符的ascii碼 要發送的文本:發送的數據

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

性能測試十:jmeter進階之webService與socket