Using JMeter to Performance Test Web Services
Pages: 1, 2, 3, 4, 5

Creating a load test

The JMeter load test feature allows you to generate a high load on a server and determine its capacity and limitations. Note: To use the Web services samples you also need the mail.jar and activation.jar available from Sun Microsystems (see the links below). Due to licensing restriction Apache does not distribute these libraries. After downloading these two jars, place them into the Java classpath or into the JMeter installation lib directory.

Figure 2
Figure 2. Creating thread groups and a basic Web service test plan.

Now, right-click Test Plan and add a Thread Group and a Loop Controller. We use these two elements to set the number of simulated concurrent users and duration of the test. In a tree structure, under Loop Controller, add a "WebService (SOAP) Request" and a Graph, as shown in Figure 2. If you cannot add a WebService request to the test plan, you probably don't have either mail.jar or activation.jar in your path.

Type in the number of threads, ramp-up periods, and loop count. For this tutorial we used 5, 10, and 100 respectively. Set the loop controller count to 1. If the WebLogic Server with the deployed Web service is not running yet, start it manually or from within WebLogic Workshop.

Configuring a load test

As shown in Figure 3, we need to set the parameters of the SOAP request sent to the server. If the link (URL) to the WSDL file is available, paste this link into the WSDL URL field and click Load WSDL. The available methods will be displayed in the Web Methods combo box. Next, you need to click Configure, so that Server Name or IP, Port Number, Path, and SOAPAction get populated.

Figure 3
Figure 3. WebService(SOAP) request dialog (click the image for a full-size screen shot)

When no WSDL link is available, you can also manually type in values for server name, port number, path, and SOAP action. As a last step, fill in the SOAP request in the SOAP/XML-RPC Data area. You can also load it from a file using the File with SOAP XML Data option.

After all the fields in the Web service request dialog have been entered, save the JMeter project clicking Ctrl+S. To visualize the data, we added chart elements "Graph results" and "Spline Visualizer." In addition we can also send the responses to a file by adding a "Save responses to a file" element; this is helpful when examining errors in SOAP responses. To simulate a more realistic sequence of client requests we inserted a timer element in the tree—a "Gaussian Random timer." By doing this the client requests have a more chaotic distribution and will hit the server at random rather than at equal intervals. We set the Gaussian random times to deviation of 100ms and constant delay offset - 300ms.

Pages: 1, 2, 3, 4, 5

Next Page »