Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Testing Soap/Rest Web Services with JMeter


Published on

How to guide on running a test for SOAP/ REST web services using JMeter.

Published in: Technology
  • Be the first to comment

Testing Soap/Rest Web Services with JMeter

  1. 1. Testing SOAP/REST Web Services Using JMeter July 2014
  2. 2. Representational Site Transfer (REST) • The most popular RESTs include: 1. GET 2. POST 3. PUT 4. DELETE • 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. * 02
  3. 3. 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 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] * 03
  4. 4. How to Write a JMeter Script with GET (2) 04
  5. 5. 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) 05
  6. 6. • 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) 06
  7. 7. • To specify headers, you’ll need the HTTP Header Manager with the most common headers. These include Content-Type and Accept: – 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) 07
  8. 8. For instance, when using the server name: Path: /periodictable.asmx Body: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi=" instance" xmlns:xsd="" xmlns:soap=""> <soap:Body> <GetAtoms xmlns="http://www.webserviceX.NET" /> </soap:Body> </soap:Envelope> And header: Content-Type: text/xml * How to Write a JMeter Script with POST (3) 08
  9. 9. * • 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) 09
  10. 10. * How to Write a JMeter Script with POST (5) 10
  11. 11. Results of the HTTP Request Test * 11
  12. 12. For more information about Performance Testing and JMeter: @BlazeMeter Get Your Free JMeter Training Course! Learn Apache JMeter with a step-by-step video course: 12