Jmeter测试WebService接口

来源:互联网 发布:淘宝联盟分享赚钱 编辑:程序博客网 时间:2024/04/28 09:57

1.创建测试计划WebServiceTestPlan



2.创建线程组WebService_ThreadGroup,并做如下的配置:



3.创建Http Request Sampler,并做如下配置:



BodyData部分代码如下:

<soapenv:Envelope  
  xmlns:q0="http://www.creditease.cn"  
  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>  
<q0:bondStateReceipt>
 <paramStr>
     {'transferId':'283378','fsodealNo':'1429495656555771','transferStatus':'77','serlNum':'1420391438414621','moveflag':'0',       'submitTime':'2015-01-06           00:00:00','systemId':'L'}
  </paramStr>

</q0:bondStateReceipt>
  </soapenv:Body>  
</soapenv:Envelope>  


Body Data部分:封装一个soap消息。

q0:命名空间变量,后边的值为被测的webservice接口的wsdl文件的targetnamespace.

q0:bondStateReceipt:这里的q0跟上面保持一致,bondStateReceipt为被测的webservice接口的具体的方法名。

paramStr:方法定义的参数名。

{...}为参数值。


4.添加View Results Tree



5.点击启动按钮,


6.如下能查看返回值


0 0