Testing SOAP/REST Web Services
Representational Site Transfer (REST)
• The most popular RESTs include:
• The response return status codes indicate success or failure,
along with any applicable headers. JSON represents the
affected fields (or nothing) in the message-body.
How to Write a JMeter Script with GET (1)
GET is the easiest and most common request method.
To write a JMeter script with GET:
1.Add an HTTP Request to your Thread Group.
2.Fill in the Server Name or IP, path, and select the GET method.
– For example, we use validate.jsontest.com as Server Name and ‘/’ as path
3.If your API request contains query parameters, you may specify them in [a]
path (for example, ‘/?json=[1:1]’) or in [a] Parameters area:
1. Name: json
2. Value: [1:1]
4. Add the View Results Tree, and run the script.
– Here you’ll find the sampler result, request, and response data of your request.
How to Write a JMeter Script with GET (3)
• With POST requests, you can fill both the body and the
headers. You can also specify query parameters in path.
• The HTTP headers, which contain metadata, are tightly defined
by the HTTP spec. They can only contain plain text and must be
formatted in a certain manner.
How to Write a JMeter Script with POST (1)
• To specify headers, you’ll need the HTTP Header Manager with
the most common headers. These include Content-Type and
– Content-Type : This entity-header field indicates the media type of
the entity-body sent to the recipient.
– Accept: This can be used to specify certain media types which are
acceptable for the response. You can use a user agent to simulate
different behaviors of various browsers.
• Post Body can be useful for the following requests: GWT RPC
HTTP, JSON REST HTTP, XML REST HTTP and SOAP HTTP.
How to Write a JMeter Script with POST (2)
For instance, when using the server name: www.webservicex.net
<?xml version="1.0" encoding="utf-8"?>
<GetAtoms xmlns="http://www.webserviceX.NET" />
And header: Content-Type: text/xml
How to Write a JMeter Script with POST (3)
• You can configure other requests similar to GET and POST, using required methods,
path, parameters, or body and headers.
• Please note that the webservice (SOAP) request is depreciated and the SOAP/XML-RPC
request is active. Please use the HTTP_Request instead.
How to Write a JMeter Script with POST (4)
How to Write a JMeter Script with POST (5)
For more information about Performance Testing and JMeter:
BlazeMeter.com/blog/ email@example.com @BlazeMeter
Get Your Free JMeter
Learn Apache JMeter with a
step-by-step video course: