In order to create a test plan for webservice, we need to create a webservice project and deploy it locally on the Tomcat server.

Step1: Creating Webservice Project

Using Eclipse IDE, write SEI (Service Endpoint Interface) HiUser under which will look like as below


import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;

//Service Endpoint Interface
@SOAPBinding(style = Style.RPC)
public interface HiUser{

  @WebMethod String getHiUserMessage(String string);



The service getHiUserMessage has a string parameter

Next step is to create, the implementation class under the package


import javax.jws.WebService;

public class HiUserImpl  implements HiUser  {
   public String getHiUserMessage(String myName){
      return("Hi "+myName+" to JAX WS User");

This web service will now need to be published through an Endpoint publisher and place this service on the server. will look like

package com.jmeterwstestplan.endpoint;



public class HiUserPublisher {

   public static void main(String[] args){
      Endpoint.publish("http://localhost:9000/ws/hello", new HiUserImpl());

In the next step, web.xml file needs to be modified as

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "">



The configuration file sun-jaxws.xml is also needed to deploy this application as web service which will look like

<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns="" version="2.0">

   <endpoint name="HelloWorld" implementation="" url-pattern="/hello"/>


Next step is to create and export the WAR file. Save it as hi.war under webapps directory and start the Tomcat server which will give you access to URL http://localhost:8080/hi/hi

Step 2: Creating Jmeter Test Plan

Step 3:Rename Test Plan node

Open the Jmeter window and you will need to rename the Test Plan node as WebserviceTest.

Adding Thread Group

Add one thread group by right clicking on WebserviceTest (The renamed one) and then click on Add then Threads and Thread Groups. You can change the default parameters such as Name, Number of threads, Ramp up Period and Loop count as shown below.

Step 4: Adding Sampler

After adding the users, it is now time to add the tasks these users will be performing which can be done by adding a SOAP/XML-RPC request element.

This can be done by selecting Add menu by right clicking the mouse, then select sampler and then SOAP/XML-RPC request.  Edit the Name as SOAP/XML-RPC Request, URL as http://localhost:8080/Hi/Hi?wsdl and SOAP/XML-RPC data as follows

<soapenv:Envelope xmlns:soapenv="" xmlns:web="">


Step 5: Adding Listener

Listener is responsible for storing the results of the test plan and you can add a listener by selecting Listener in the Add menu and choose Listener and then View results Tree

Step 6: Run and View the Results

Save the test plan as test_webservice.jmx and run the test plan from the Run menu and choosing the option Start.

The listener will show the following output after the execution