I have a restful request and I need to send it to a webservice using Jmeter. here is my reuest:
{"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"}
And here is what I created in JMeter:
Thread Group SOAP/XML-RPC Request URL:http://localhost:9000/MyFawryWeb/rest/MFServlet/service
When I run I got the below error:
org.apache.commons.httpclient.NoHttpResponseException: The server 11.92.0.91 failed to respond at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1976) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at org.apache.jmeter.protocol.http.sampler.SoapSampler.sample(SoapSampler.java:271) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077) at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) at java.lang.Thread.run(Unknown Source)
You need to use HTTP Request Sampler for sending REST requests, the JSON payload needs to go into "Body Data" tab like:
application/json
See REST API Testing - How to Do it Right for more information and detailed instructions.