我有一个宁静的请求,我需要使用Jmeter将其发送到Web服务。 这是我的回应:
{"type":"CustomerProfileReqModel","messageCode":"GetCustRq","messageVersion":"V1.0","language":"en-gb","recieverCode":"newone","customerModel":{"userName":"load24","password":"P@ssw0rd","categoryCode":"NORM"},"uiCacheVersion":"3e096b72-ed40-4f8a-aad3-9ed52a4aa8ba"}
以下是我在JMeter中创建的内容:
线程组 SOAP / XML-RPC请求 网址:http://localhost:9000/MyFawryWeb/rest/MFServlet/service
当我跑步时,我收到以下错误:
org.apache.commons.httpclient.NoHttpResponseException:服务器11.92.0.91无法响应 在org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1976) 在org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) 在org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) 在org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) 在org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) 在org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) 在org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) 在org.apache.jmeter.protocol.http.sampler.SoapSampler.sample(SoapSampler.java:271) 在org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077) 在org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428) 在org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) 在java.lang.Thread.run(未知来源)
答案 0 :(得分:0)
您需要使用HTTP Request Sampler发送REST请求,JSON有效负载需要进入“正文数据”标签,如:
application/json
有关详细信息和详细说明,请参阅REST API Testing - How to Do it Right。