International Journal of Scientific & Engineering Research, Volume 3, Issue 5, May-2012 1

ISSN 2229-5518

Web Services Performance Testing Using Open

Source Apache Jmeter

Khushali Tirghoda

AbstractWeb Services are self-contained applications that can run universally across the Internet. They are built using Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP). They serve as building blocks enabling the rapid development and deployment of new applications. They are primarily used as a means for businesses to communicate with each other and with cli ent; Web Services allow organizations to communicate data without having intimate knowledge of each other's IT systems behind the firewall. Performance Testing of Web Services is different from other application testing. Any changes done in the Web Services might c hange the object property that the service exposes. So, the Performance Test scripts need to be modified each time a change is made at the Web Service level which defeats the whole purpose of automation. In this paper, I am presenting an easier and cost effective solu tion to Performance Test Web Services using the Open source Tool Apache JMeter.

Index Terms Web Service Performance, SOAP, UDDI

1 INTRODUCTION

—————————— ——————————
Performance Testing of Service Oriented Architecture based applications has multiple challenges, starting from gaining an in depth understanding of the domain to changing the mind- set of the testers, as Performance testing of such applications is different from other kinds of testing.
While most of the problems can be tackled by one way or the other, there remains a single most important problem that needs a solution – Web Services. There is no User Interface for a Web Service.
Any changes done in the Web Services might change the ob- ject property that the service exposes. So, the Performance Test scripts need to be modified each time a change is made at the Web Service level which defeats the whole purpose of automa- tion.
In this paper, I am presenting an easier and cost effective solu- tion to Performance Test Web Services using the Open source Tool Apache JMeter. Before going into the explanation, let us first understand the Web Services and SOA.

1.1 Web-Services

Web Services are self-contained applications that can run un- iversally across the Internet. They are built using Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP). They serve as building blocks enabling the rapid de- velopment and deployment of new applications. They are primarily used as a means for businesses to communicate with each other and with client; Web Services allow organizations to communicate data without having intimate knowledge of each other's IT systems behind the firewall.
Unlike traditional client/server models, such as a Web serv- er/Web page system, Web Services do not provide the user with a user interface. Instead, Web Services share business logic, data and processes through a programmatic interface across a network. Developers can then add the Web Service to a user interface (such as a Web page or an executable pro- gram) to offer specific functionality to users.
Web Services allow different applications from different sources to communicate with each other without time-
consuming custom coding. In addition, because all communi- cation is in XML, Web Services are not tied to any one operat- ing system or programming language.

Example: Google search is a Web Service which offers search service to the Google.

1.2 SOA

The following are three definitions of SOA from the web. As Wikipedia notes, ―There is no widely agreed upon definition of SOA other than its literal translation.‖ So any of the follow- ing definition that helps you understand what really SOA is has met our goal.
A service-oriented architecture is a collection of services that communicate with each other. The services are self-contained and do not depend on the context or state of the other service. They work within ―distributed systems architecture‖.
A Service Oriented Architecture provides patterns for design, development, deployment and management of a loosely coupled business application infrastructure. In this frame- work, business functionality is published, discovered, and consumed as part of a business ecosystem of network-aware and reusable technical and business services.
Service Oriented Architecture (SOA) is an evolution of distri- buted computing. SOA provides a modularity of business log- ic, which can be presented as services for clients (client as in client-server architecture). These services are loosely coupled, in the sense that the 'User Interface' can remain completely independent of the service layer.
There is no widely agreed upon definition of SOA other than its literal translation. It is an architecture that relies on service- orientation as its fundamental design principle. In an SOA environment independent services can be accessed without knowledge of their underlying platform implementation. These concepts can be applied to business, software and other types of producer/consumer systems. SOA allows the enter- prises to plug in new services or upgrading the existing ser- vices in a granular fashion to address the new business re-

IJSER © 2012

http://www.ijser.org

The research paper published by IJSER journal is about Web Services Performance Testing Using Open Source Apache Jmeter 2

ISSN 2229-5518

quirements, provides the option to make the services consum- able across different channels or exposes the existing enter- prise and legacy applications as services, there by safeguard- ing existing IT infrastructure investments.

Example: Integrating the Google search (Web Service) in Google html page is a SOA. The fundamental pieces of the SOA infrastructure are WSDL, UDDI and SOAP.

(1) WSDL
It is an XML-based language for describing Web Services and
how to access them.
WSDL stands for Web Services Description Language
• WSDL is written in XML
• WSDL is an XML document
• WSDL is used to describe Web Services
• WSDL is also used to locate Web Services
• WSDL is not yet a W3C standard
(2) UDDI
UDDI is a platform-independent framework for describing
services, discovering businesses, and integrating business ser-
vices by using the Internet.
• UDDI stands for Universal Description, Discovery
and Integration
• UDDI is a directory for storing information about
Web Services
• UDDI is a directory of Web Service interfaces de- scribed by WSDL
• UDDI communicates via SOAP
• UDDI is built into the Microsoft .NET platform
(3) SOAP
It is the default mechanism for Web Services alternative tech-
nologies accomplishes other types of bindings for a service.
• SOAP stands for Simple Object Access Protocol
• SOAP is a communication protocol
• SOAP is for communication between applications
• SOAP is a format for sending messages
• SOAP is designed to communicate via Internet
• SOAP is platform independent
• SOAP is language independent
• SOAP is based on XML
• SOAP is simple and extensible
• SOAP allows you to get around firewalls
• SOAP will be developed as a W3C standard

2 DIFFERENCES BETWEEN WEB SERVICES AND SOA

Web Services are about technology specification whereas SOA is a software design principle. Fundamentally, SOA is an arc- hitectural pattern while Web Services are services imple- mented using a set of standards. Benefit of implementing SOA with Web Services By implementing SOA with Web Services we achieve a platform-neutral approach to accessing services and better interoperability as more and more vendors support

————————————————

Khushali is currently working as Assistant Professor in MCA Department at IITE,Ahmedabad,India

E-mail: Tirghoda_khushali@yahoo.co.in
more and more Web Services specifications.

3 USING APACHE JMETER

Web Services can be recorded in JMeter in 2 ways i.e.
1. SOAP/XML-RPC Request
2. Web Service (SOAP) Request
Most of the Web services do not display a user interface that
can be used for scripting (the client might be an application or
server instead of a Web browser or thin client application). In this case, recording a business process is a challenge. So we need to depend on the Application Development team to create a script. The Application Development team should
provide us with the SOAP data that the web service takes as input and their corresponding success and failure codes.

3.1 Using SOAP/XML-RPC Request


If we are having the soap request of particular Web Service we can proceed with this sampler. The sampler is as shown be- low:

Fig:1 SOAP/XML Sampler

3.2 Using Web Service (SOAP) request

Any changes done in the Web Services code might change the object property that the service exposes. Let us see how to solve this problem.
Web Services are defined through Web Service Description Language (WSDL). It is this WSDL that is exposed by the Web Services for invoking the operations they provide. Any change in the structure of Web Services will be a change in WSDL. So if we were able to handle the WSDL files than there is a solu- tion for it. JMeter is capable of handling the WSDL files using the Web Service Request sampler. Steps to be load the WSDL URL:

(1) Place the URL in the WSDL URL and click on the Load

WSDL button.

(2) All the methods available in the WSDL URL will be viewed in the dropdown list of web methods.

(3) Select the method to be tested and click on configure button.

It loads the protocol, server name, port, path and soap action. (4) If need we can specify the time out for the soap request as

shown in the fig.

(5) The Soap/XML message for the particular method is to be placed in the space provided as shown below or path of the

IJSER © 2012

http://www.ijser.org

The research paper published by IJSER journal is about Web Services Performance Testing Using Open Source Apache Jmeter 3

ISSN 2229-5518

file can be specified. Soap Message can be generated using soap-UI or SOA Test Harness

(6) To read the soap responses in the view result tree check the

Read Soap response check box.

(7) Check the Use Proxy and give the corresponding details if the soap request needs proxy even when u invoke the JMeter with proxy.

(8) The response of a soap request can be viewed in three forms

i.e. in text form, html form and XML form.

Web Service (SOAP) request handles the WSDL URL along with SOAP/XML message where as SOAP/XML-RPC request handles only XML message. It is better to use Web Service (SOAP) request whenever there is raw data of xml request and when you have the formatted xml data you can test the data by SOAP/XML –RPC Request. Here the format is related to structure of XML.

4 ENHANCING THE SCRIPT

Enhancement of the script involves parameter zing the user specific input values, correlation of the dynamic values gener- ated from the server and verifying the response.

4.1 Parameterization

The parameters which are to be passed in the XML data can be passed in the following manner as we send it through the http request.

Fig:2 SOAP/XML Parameter

4.2 Correlation

Correlation for soap request can be done in the same manner as http requests.

The Post –Processors which can be used for the correlation are: Regular Expression Extractor.
XPath Extractor.

4.3 Verify the Response

The response data can be verified by using Assertions. Differ- ent Assertions that are available in JMeter are:

(1) XML Assertion (2) HTML Assertion (3) XPath Assertion

(4) XML Schema Assertion

4.3.1 XML Assertion

The XML Assertion tests that the response data consists of a formally correct XML document. It does not validate the XML based on a DTD or schema or do any further validation.

4.3.2 HTML Assertion

The HTML Assertion allows the user to check the HTML, XHTML or XML syntax of the response data using JTidy. So by checking the format option as XML the syntax of response data can be verified. It does not validate the XML based on a DTD or schema or do any further validation.

4.3.3 XPath Assertion

XPath addresses the parts of an XML document. XPath asser- tion validates the response against the nodes or name spaces of an XML.

4.3.4 XML Schema Assertion

It validates the response against a XML Schema.

5 BENEFITS OF APACHE JMETER FOR PERFORMANCE

TESTING WEB SERVICES


JMeter saves the License cost for the client.
Load test can be done for any number of users by using
more number of machines.

Apache JMeter is having different types of assertions to validate the XML response.

Scripts can be generated using XML/SOAP request or WSDL URL

REFERENCES

[1] http://www.apache.org.in [2] http://msdn.microsoft.com/ [3] http://www.webservices.org

[4] http://www.w3.org/TR/ws-arch/ [5] www.uddi.org/pubs/uddi_v3.htm [6] http://www.w3.org/TR/soap/

IJSER © 2012

http://www.ijser.org