2012-11-13

Testing Web Service(SOAP/XML-RPC) using JMete

 
In this article, we are going to see a very simple web service testing procedure using JMeter.
Scenario : We are going to test a web service where the service provide us data . To be specific, the service link is http://www.webservicex.net/periodictable.asmx, the Data action link http://www.webservicex.net/periodictable.asmx?op=GetAtoms. The functionality of the service is to provide atom names in tabular format. As we are testing the data service, we can not see the HTML table, but if we can get the data, that will solve the purpose of Testing data service. 
So, if we follow those steps, we can see a very simple test for web services.

Step 1. Run JMeter(jmeter.bat) from stored location “apache-jmeter-2.8\bin”

Step 2. Create a Thread Group( right click test plan –>Add –> Thread Group) and rename as SOAPThread(I am using this name).

Step 3 : Put Number of Threads(User) as 20( I am using ) and Ramp-Up Period as 2( I am using)

Step 4. Save the Thread Group. 

Step 5 . Add a Sampler “SOAP/XML-RPC Request” under your thread group
 

Step 6. Add "http://www.webservicex.net/periodictable.asmx" as the URL and "http://www.webserviceX.NET/GetAtoms" as the Send SoapAction
 

Step 7 . Add This following request as “SOAP/XML-RPC Data”(link or Drive)
 

So, there might be a question , where I get the this XML code. It’s simple, from the service link (http://www.webservicex.net/periodictable.asmx) , you will get the GetAtoms function. 
 
If you click GetAtoms , then you will get the function definition of different  XML format(http://www.webservicex.net/periodictable.asmx?op=GetAtoms). I use SOAP 1.1 format
 

Step 8. Add Listener to your thread group(I have added view result tree, view result in table)
 

Step 9 . Now, Run the Thread Group from Menu. 
Its done. We have make and run the service test using jmeter, lets observe the results.
Here is the Request of a sample under tree listener.
 

This is the response data( the tabular format atom names) [Note : we don’t need to check the format as we are not checking the font end. If the data is present, that is ok.
 
Here is table results.
 
I am inspired by this post.….. Thanks …. :)

We can do the same test using WebService(SOAP) Request which is another type of sampler. I am adding the screenshot in Google drive. This is more smarter than SOAP/XML-RPC Request. But, a little bit slower.

13 comments:

  1. XML code link is also here for those who have esnips blocked. https://docs.google.com/document/d/1by2Lda2-EmZehEztRbeELpMzioJLVP3HskDHUC2z2Ls/edit

    ReplyDelete
  2. Thank you for sharing. Test as a service will improve the quality, reliability and performance of your systems while reducing your testing costs.

    ReplyDelete
  3. Hey I know this is off topic but I was wondering if you
    knew of any widgets I could add to my blog that automatically
    tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

    Also visit my weblog Fusevision SEO Company

    ReplyDelete
    Replies
    1. Log in to your twitter account and get widget from here https://twitter.com/settings/widgets.

      Delete
  4. Thanks for great guide. In addition I would suggest looking into Testing SOAP/REST Web Services Using JMeter post which highlights peculiarities of RESTful web services testing with Apache JMeter.

    ReplyDelete
    Replies
    1. I personally like blazemeter for their cloud services..:)

      Delete
  5. Hi Shantonu.. M getting error response message forbidden and response code 403 instead of 200..i follow exactly the same step as mention by u for web services...plss help me

    ReplyDelete
  6. Hi Shantonu My getting error for web services error is like response message is forbidden and response code is 403..Plss help wat could be the reason for this..as i have followed exactly the same step as it is mention in your blog...Webservices Using J meter 2.11...

    ReplyDelete
    Replies
    1. Hi anand, sorry for late reply, they changed the URL in implementation, use this URL to see the XML (http://www.webservicex.net/periodictable.asmx?op=GetAtoms)

      and try again ..
      let me know if you find any issue
      Thanks , for pointing that, I have changed the URL in post.

      Delete
  7. Codoid is a QA company with the best QA testing services. Our quality assurance testers provide reports & optimisation strategies for apps, automation & software.

    ReplyDelete