Web Service Performance Testing using Apache JMeter

In this blog post, we will see about Web Service Performance Testing using Apache Jmeter. It is very simple to test SOA web services using Jmeter. In your project, you get all the assets such as WSDL, Sample Request XML and Response XML, endpoint URLs etc.

But if you want to practice some sample web services at home, you need public web services. After lot of googling, I have found this website called http://www.webservicex.net/ which has numerous sample web services such as Stock, Currency, and Weather etc.

Now we will see how to performance test the web services using Apache Jmeter.

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – Sample Web services – SOAP Action – QAInsights” alt=”Performance Testing Web Services using JMeter – Sample Web services – SOAP Action – QAInsights” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-Sample-Web-services-SOAP-Action-QAInsights.png[/auto_thumb]

Follow below steps to create web service test plan in Jmeter:

[sociallocker][/sociallocker]

  • Launch Jmeter
  • Add a Thread Group
  • Add a Loop Controller. I always prefer to add Loop controller, I pretend that as a default actions like in LoadRunner
  • Right Click on Loop Controller > Add > Sampler > WebService(SOAP) Request (DEPRECATED). You get web service sampler as shown below.

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – Web Service Sampler – QAInsights” alt=”Performance Testing Web Services using JMeter – Web Service Sampler – QAInsights” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-Web-Service-Sampler-QAInsights.png[/auto_thumb]

  • Enter the WSDL URL and click on Load WSDL. Now you can see Web Methods is showing the methods as below.

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – Web Methods” alt=”Performance Testing Web Services using JMeter – Web Methods” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-Web-Methods.png[/auto_thumb]

  •  Click on Configure. You could see the some of the fields will be automatically filled up as shown below.

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – Web Methods Configure” alt=”Performance Testing Web Services using JMeter – Web Methods Configure” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-Web-Methods-Configure.png[/auto_thumb]

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetQuote xmlns="http://www.webserviceX.NET/">
      <symbol>IBM</symbol>
    </GetQuote>
  </soap:Body>
</soap:Envelope>

Edit the string to company code e.g. INFY, IBM, APPL etc. You can parameterize if you wish.

  • Here is the complete test sampler.

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – Complete Sampler” alt=”Performance Testing Web Services using JMeter – Complete Sampler” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-Complete-Sampler.png[/auto_thumb]

  •  Add View Results Tree and click on Run. Response will be received as below.

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – Response XML” alt=”Performance Testing Web Services using JMeter – Response XML” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-Response-XML.png[/auto_thumb]

  • Here is the SOAP/XML RPC Request Sampler:

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – SOAP XML” alt=”Performance Testing Web Services using JMeter – SOAP XML” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-SOAP-XML.png[/auto_thumb]

TIP:

  • Always check Read SOAP Response in WebService(SOAP) Request (DEPRECATED) sampler, else you will not be able to see the response.

[auto_thumb width=”150″ height=”150″ link=”” lightbox=”true” align=”center” title=”Performance Testing Web Services using JMeter – Check Read SOAP Message” alt=”Performance Testing Web Services using JMeter – Check Read SOAP Message” iframe=”false” frame=”true” crop=”true”]http://qainsights.com/wp-content/uploads/2013/08/Performance-Testing-Web-Services-using-JMeter-Check-Read-SOAP-Message.png[/auto_thumb]

Video Demonstration:

Thanks for visiting QAInsights! Check out our new portal Testifications.com to get updates on Software Testing related certifications. We’re always posting interesting articles on QAInsights. I request you to subscribe so you don’t miss out anything. Searching for QA Jobs Openings, check it at www.QAJobOpenings.com

Want to start a blog like this, please visit SpidyDomain to buy cheap web hosting and register domain.

Subscribe to our QAInsights YouTube Channel | Subscribe our free weekly newsletter.

About the Author

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Hamster - Launch JMeter Recent Test Plans SwiftlyDownload for free
+
Share via
Copy link