Load Testing SOAs which Utilize Web Services



Similar documents
Integration of Hotel Property Management Systems (HPMS) with Global Internet Reservation Systems

Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture

XML Processing and Web Services. Chapter 17

Middleware and the Internet

Introduction to Testing Webservices

Getting started with OWASP WebGoat 4.0 and SOAPUI.

Installing and Running the Google App Engine On Windows

Emerging Technologies Shaping the Future of Data Warehouses & Business Intelligence

Building and Using Web Services With JDeveloper 11g

Creating XML Report Web Services

The Process Guidelines should be used in conjunction with the standard OUM process guidelines when using Testing and Quality Management Tools.

The presentation explains how to create and access the web services using the user interface. WebServices.ppt. Page 1 of 14

Service Oriented Architecture

Introduction into Web Services (WS)

Service Computing: Basics Monica Scannapieco

OpenLDAP Oracle Enterprise Gateway Integration Guide

Oracle Service Bus Examples and Tutorials

Improving Agility at PHMSA through Service-Oriented Architecture (SOA)

Introduction to Web Services

Author: Gennaro Frazzingaro Universidad Rey Juan Carlos campus de Mostòles (Madrid) GIA Grupo de Inteligencia Artificial

My IC Customizer: Descriptors of Skins and Webapps for third party User Guide

CONTRACT MODEL IPONZ DESIGN SERVICE VERSION 2. Author: Foster Moore Date: 20 September 2011 Document Version: 1.7

Cloud Computing & Service Oriented Architecture An Overview

Application Testing Suite: A fully Java-based software testing platform for testing Oracle E-Business Suite and other web applications

2667A - Introduction to Programming

Using Web Services to exchange information via XML

Internationalization and Web Services

David Pilling Director of Applications and Development

A Web services solution for Work Management Operations. Venu Kanaparthy Dr. Charles O Hara, Ph. D. Abstract

JAVA WEB START OVERVIEW

Deploying Microsoft Operations Manager with the BIG-IP system and icontrol

Introduction to Service Oriented Architectures (SOA)

WEB SERVICES. Revised 9/29/2015

Digital Signature Web Service Interface

Ambientes de Desenvolvimento Avançados

Test Case 3 Active Directory Integration

A Tool for Evaluation and Optimization of Web Application Performance

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

e-filing Secure Web Service User Manual

SOA Myth or Reality??

Creating Web Services in NetBeans

Developing Java Web Services

Enhancing A Software Testing Tool to Validate the Web Services

Grandstream Networks, Inc.

Distributed Systems and Recent Innovations: Challenges and Benefits

WCF WINDOWS COMMUNICATION FOUNDATION OVERVIEW OF WCF, MICROSOFTS UNIFIED COMMUNICATION FRAMEWORK FOR.NET APPLICATIONS

How To Build A Connector On A Website (For A Nonprogrammer)

SharePoint Integration Framework Developers Cookbook

ICE Trade Vault. Public User & Technology Guide June 6, 2014

Real SQL Programming 1

Microsoft Visual Basic Scripting Edition and Microsoft Windows Script Host Essentials

SOA, case Google. Faculty of technology management Information Technology Service Oriented Communications CT30A8901.

HP Unified Functional Testing

JVA-561. Developing SOAP Web Services in Java

T320 E-business technologies: foundations and practice

Working with the ERP Integration Service of EMC Documentum Process Services for SAP

A Quick Introduction to SOA

Base One's Rich Client Architecture

Integrating with BarTender Integration Builder

DiskPulse DISK CHANGE MONITOR

A standards-based approach to application integration

Advanced Service Design

WebSphere Business Monitor

Service-oriented architecture in e-commerce applications

Contents About the Contract Management Post Installation Administrator's Guide... 5 Viewing and Modifying Contract Management Settings...

Connect Getting Started Guide. Connect Getting Started Guide

IBM WebSphere Adapter for Quick Start Tutorials

Using Foundstone CookieDigger to Analyze Web Session Management

Research on the Model of Enterprise Application Integration with Web Services

DEPLOYMENT GUIDE Version 1.1. Deploying the BIG-IP LTM v10 with Citrix Presentation Server 4.5

Ce document a été téléchargé depuis le site de Precilog. - Services de test SOA, - Intégration de solutions de test.

What's New in ActiveVOS 9.1

BPM Scheduling with Job Scheduler

Client-Server Applications

Concept, implementation and performance testing of a mobile Web Service provider for Smart Phones

NetBeans IDE Field Guide

OpenScape Voice V8 Application Developers Manual. Programming Guide A31003-H8080-R

Last Updated: July STATISTICA Enterprise Server Security

SOAP and WSDL. At the heart of Web services today are SOAP and WSDL, so it s important that. Part II

StreamServe Persuasion SP4 Service Broker

Copyright. Restricted Rights Legend. Trademarks or Service Marks. Copyright 2003 BEA Systems, Inc. All Rights Reserved.

How To Build An Intranet In Sensesnet.Com

Web services can convert your existing applications into web applications.

Invocación remota (based on M. L. Liu Distributed Computing -- Concepts and Application

AquaLogic Service Bus

An Oracle White Paper June RESTful Web Services for the Oracle Database Cloud - Multitenant Edition

StreamServe Persuasion SP4 StreamServe Connect for SAP - Business Processes

WEB DATABASE PUBLISHING

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Policy Guide Access Manager 3.1 SP5 January 2013

How To Create A C++ Web Service

Deploying Oracle Business Intelligence Publisher in J2EE Application Servers Release

Developing a Web Service Based Application for Mobile Client

How To Test A Factorial Service On A Soa Project

Iowa Immunization Registry Information System (IRIS) Web Services Data Exchange Setup. Version 1.1 Last Updated: April 14, 2014

Efficiency of Web Based SAX XML Distributed Processing

DEPLOYMENT GUIDE DEPLOYING THE BIG-IP LTM SYSTEM WITH CITRIX PRESENTATION SERVER 3.0 AND 4.5

What Is the Java TM 2 Platform, Enterprise Edition?

IBM. Implementing SMTP and POP3 Scenarios with WebSphere Business Integration Connect. Author: Ronan Dalton

WEB SERVICES TEST AUTOMATION

Transcription:

White Paper Load Testing SOAs which Utilize Web Services How to Leverage Existing Tools when Testing Service-Oriented Architectures Based on Web Services Last Updated: 7th May, 2007

Introduction Service-Oriented Architectures (SOA), despite being a hot topic, are far from new. In the recent past, Microsoft s Distributed Component Object Model (DCOM) and the Object Management Group s Common Object Request Broker Architecture (CORBA) represented the state-of-theart in SOA for intranet implementations, but their inherent complexities have hampered their adoption on the internet. What is new is the migration of SOA onto the web. Today s internet is dominated by the use of web browsers; therefore the logical path for SOA on the web is to adopt the technologies used by browsers. This is the fundamental basis of web services. The web services implementation that is almost ubiquitous is the Simple Object Access Protocol (SOAP). It is a combination of extensible Markup Language (XML) standards and the web s underlying network protocol, the HyperText Transport Protocol (HTTP). So, we ve peeled away some of the layers of the SOA onion and found HTTP sitting in the middle. This is good news for load testing. Most load testing tools use a capture/replay paradigm for recording specific protocols into a trace file. After completing the capture, the tool will generate an executable script that replays the captured protocol and produces network traffic to simulate the client/server interaction described in the trace file. Multiple copies of this script can be executed simultaneously to simulate multiple users, or connections, and thus generate a load on the system under test. In the case of web services delivered over the internet, we know that the network protocol used is HTTP. This is the same protocol used by browsers such as Internet Explorer to deliver content to end users, hence the web in web services. From a load testing perspective, what this also means is that if your tool currently has the capability to record and replay end -user, browser-based loads then it also has the capability to generate web services loads as well. Potentially, your load test tool of choice will have web services specific functionality as well, although this may require additional licensing (i.e. more money) to use. This white paper will describe the steps required to create scripts at the HTTP protocol level that can be used to load test SOAP Web Services. This will provide you with the information to determine if purchasing additional web services functionality for your load test tool can be justified over the additional effort required to create scripts using the HTTP capabilities available in the tool. It is not practical to show how all and any available load test tools could be used for web services load testing, but undoubtedly a worked example is the clearest way to illustrate the process. To do this requires a scripting environment freely available and a web service commonly accessible on the web. This white paper provides a practical, working example of constructing a SOAP testing script for the Google Web Services API (http://www.google.com/apis/) using the scripting language Python (http://www.python.org). It is hoped that everyone who uses the web will be familiar with search engines in general and can work their way around Google searches. If you are unfamiliar with Python, please do not let that put you off. Python is a very readable language and any language-specific elements have been kept to a minimum in order to aid understanding and increase portability. Obviously, the script presented will probably not work directly in your load test tool, but the construction of the Service-Oriented Architecture Delivering Web Services 2 Pre-requisites script should be sufficiently generic to enable you to recode the example using your load tool s scripting languages and Web/HTTP support libraries. Page 2

Pre-requisites As a learning exercise, we will be constructing a script to test the publicly available Google Web Services using the open-source scripting language Python. Despite being publicly available, the Google Search API requires that you supply a license key to operate correctly. The license key is free and allows you to make up to 1000 queries via the API per day, but you will need to have, or to open, a Google Account to receive your license key. Just follow the instructions on the Google Web Services API homepage (http://www.google.com/apis/) and you should be fine. At the end of the process you will have: Ñ Ñ Ñ The Google Web API developer s kit; A license key; A Google Account. If you do not need the Google Account, you do not have to use it again after you have obtained the license key. There are a couple of options for getting Python; it is available from the Python website at http://www.python. org, but a somewhat friendlier package for Windows users is available from ActiveState (http://www.activestate. com/python). Click on the Download Now link under the ActivePython heading. You will be asked for some personal details - but they are not required and you do not need to fill them in - click on the Next button and then download the appropriate package. The Windows packages use the standard Windows Installer, so installation of the package should be very familiar and quite simple. Please note; you will need administrator privileges to install Python on your computer. Once Python has been installed, you should invoke the Pythonwin IDE from the Start menu in the usual way (see Figure 1). Once the Pythonwin IDE appears, open a new file by pressing the first button on the toolbar and choosing the Python Script option. At this point, even though there is nothing in the new file, you should save the file in your preferred directory using a suitable name. You do not need to specify a suffix for the file, Python scripts are saved as.py files by default. I prefer to layout the file window and the interactive window so that I can see both the script and its output together (see Figure 2). Figure 2 also shows a script with a simple for loop. Three useful things can be seen in this example; the first line shows the declaration of a list object that contains three string objects within it. The next line of code shows that the for loop is ended with a :. Python uses the colon character to indicate the start of a code block. The block itself is identified by the indentation of the block rather than explicit block markers such as begin, end or {, } pairs. The final print statement has returned to the previous indentation level so is not considered to be part of the code block associated with the for loop, hence it is executed after the completion of the loop. Figure 1: Selecting the Pythonwin IDE Page

Calling the Web Service What happens when a client sends a Web Service request? In order to interact with the web service on the server, we must send it a correctly formatted HTTP request that contains appropriate HTTP headers and the required XML within the body of the request. In SOAP terminology, the HTTP request body contains the SOAP envelope that the web service opens after delivery to unpack the parameters of the SOAP web service request. Next, the web service request is actioned by the server and an HTTP response is returned to the client. If the request is OK, the response should contain some results for further processing at the client end. If the request was wrong in some way, an HTTP error code will be generated and the body of the response may provide some additional information as to the nature of the error in the SOAP request. What does a Web Service call look like? How do we find out what to send to the server? One way is to look as the Web Service Description Language (WSDL) file for the web service in question. The WSDL file is the formal XML definition of the web service. It can be used to generate language bindings for developers who have to implement the functionality of a new web service. In theory it can be used to construct the SOAP envelope for the HTTP body, but this is not usually a productive approach for testing. Figure 2: Selecting the Pythonwin IDE Another way to find out the required XML is to capture the traffic between an existing client and the server, using your current load test tool. Typically, developers can provide a test client that can be used to verify the functionality of the web service. Capturing a trace from this program will provide the basis of the HTTP request. Finally, it is not uncommon to be able to find the XML request/response pair provided to you directly. This is the case with the Google Web API developer s kit. In Figure 3 we see the contents of the file dogooglesearch.xml, which is supplied in the kit. Of most interest to us are the highlighted fields for using your license key ( key ) and the search terms ( q ). There are other parameters that can be changed and these are documented fully in the Google API developer s guide, although we will not be using them in this simple example. We need to paste the example into our script file and, using the facilities of our chosen tool, enable the script to modify our preferred parameters. In Python we can do this using a template string that allows parameters to be substituted at run-time. Python allows you to try code samples in the Interactive Window directly, as with the example shown in Figure 4. See how the %s placeholders are substituted with the actual strings provided at the time the print statements are executed. As stated earlier, you will find that your own load test tool provides support for the HTTP protocol via a module or library of functions that you can use. Python also provides an additional module for handling HTTP functionality called Page 4

httplib. The complete script for creating a Google search SOAP request is shown in Appendix A. If all goes well, when you run the script you should get something like the output shown in Appendix B. This output from the web service is XML data that corresponds to the results that would have been returned to a web browser if you were using the typical Google browser user interface. You can check this by taking the search terms from the script and inputting them directly, then comparing the results from a browser search with the results from the web services search. You should now be able to map the construction of the simple Python script presented here into the scripting Figure 3: dogooglesearch.xml Figure 4: Using a string template in Python >>> aboutme = My %s is %s >>> print aboutme%( name, Joe ) My name is Joe >>> print aboutme%( hair, black ) My hair is black >>> language of your load testing tool. You can validate its operation against the Google Web Service by comparing its output to the output of the Python script. Once you are confident that the load testing tool s script is working in the same manner as the Python script, then you can repeat this exercise against the web services you actually want to test. Finally, using the facilities of your load testing tool, run multiple copies of your own web services scripts concurrently to generate the required level of load. Conclusion SOAP based web services are directly implemented using the web s HTTP protocol. This open standard allows different implementation technologies to interoperate with SOAP Web Services seamlessly, irrespective of the underlying technologies at either end of the transaction. For example, J2EE systems can interact with.net systems and vice versa. In this example, we used Python to interact with the Google Web Services. We have no knowledge of the implementation details - and from an acceptance testing perspective we really do not care. We are only interested in web services functioning according to their specifications and/or Service Level Agreements (SLA). The SLA is then performance tested against the agreed Key Performance Indicators (KPI) which should be defined within the SLA. As web services operate across HTTP connections, any protocol-level load testing tool that you already have available should be capable of load testing web services as well as end-user web sites. AppLabs has a wealth of experience in all aspects of automated load testing and the knowledge transfer that could increase the success of your test programme. Page

Appendix A: Complete SOAP Example Script from httplib import * SOAPTemplate = <?xml version= 1.0 encoding= UTF-8?> <SOAP-ENV:Envelope xmlns: SOAP-ENV= http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi= http://www.w3.org/1999/xmlschema-instance xmlns:xsd= http://www.w3.org/1999/xmlschema > <SOAP-ENV:Body> <ns1:dogooglesearch xmlns:ns1= urn:googlesearch SOAP-ENV:encodingStyle= http://schemas.xmlsoap.org/soap/encoding/ > <key xsi:type= xsd:string >%s</key> <q xsi:type= xsd:string >%s</q> <start xsi:type= xsd:int >0</start> <maxresults xsi:type= xsd:int >10</maxResults> <filter xsi:type= xsd:boolean >true</filter> <restrict xsi:type= xsd:string ></restrict> <safesearch xsi:type= xsd:boolean >false</safesearch> <lr xsi:type= xsd:string ></lr> <ie xsi:type= xsd:string >latin1</ie> <oe xsi:type= xsd:string >latin1</oe> </ns1:dogooglesearch> </SOAP-ENV:Body> </SOAP-ENV:Envelope> # Google search options - for populating the SOAPTemplate key = PUT YOUR OWN LICENCE KEY HERE searchterms = Magical Trevor dugongs manatee envelope = SOAPTemplate%( key, searchterms ) # populate the outbound SOAP # create additional HTTP headers headers = { Content-Type : text/xml; charset= utf-8, SOAPAction : } search = HTTPConnection( api.google.com ) # prepare an HTTP connection search.request( POST, /search/beta2, envelope, headers) # POST the envelope # fetch the HTTP response codes, then the answer to the SOAP request response = search.getresponse() answer = response.read() # show the request and the response print ----Sending Envelope-------------------- print envelope print ----Getting Response-------------------- print response.status print response.reason print print ----Getting Results----------------------- print answer Appendix B: SOAP Script Output ----Getting Response-------------------- 200 OK ----Getting Results--------------------- <?xml version= 1.0 encoding= UTF-8?> <SOAP-ENV:Envelope xmlns:soap-env= http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi= http://www.w3.org/1999/xmlschema-instance xmlns:xsd= http://www.w3.org/1999/xmlschema > <SOAP-ENV:Body> <ns1:dogooglesearchresponse xmlns:ns1= urn:googlesearch SOAP-ENV: encodingstyle= http://schemas.xmlsoap.org/soap/encoding/ > <return xsi:type= ns1:googlesearchresult > <directorycategories xmlns:ns2= http://schemas.xmlsoap.org/soap/encoding/ xsi:type= ns2:array ns2:arraytype= ns1:directorycategory[0] > </directorycategories> <documentfiltering xsi:type= xsd:boolean >true</documentfiltering> <endindex xsi:type= xsd:int >10</endIndex> <estimateisexact xsi:type= xsd:boolean >false</estimateisexact> <estimatedtotalresultscount xsi:type= xsd:int >149</estimatedTotalResultsCount> <resultelements xmlns:ns3= http://schemas.xmlsoap.org/soap/encoding/ xsi:type= ns3:array ns3:arraytype= ns1:resultelement[10] > <item xsi:type= ns1:resultelement > <URL xsi:type= xsd:string >http://en.wikipedia.org/wiki/weebl&apos;s_cartoons</url> <cachedsize xsi:type= xsd:string >47k</cachedSize> <directorycategory xsi:type= ns1:directorycategory > <fullviewablename xsi:type= xsd:string ></fullviewablename> <specialencoding xsi:type= xsd:string ></specialencoding> </directorycategory> <directorytitle xsi:type= xsd:string ></directorytitle> <hostname xsi:type= xsd:string ></hostname> <relatedinformationpresent xsi:type= xsd:boolean >true</relatedinformationpresent> <snippet xsi:type= xsd:string >There is a banner that says &quot;<b>magical Trevor</b>&quot; above the stage. <b>...</b> it&#39;s quite<br> ugly&quot;;</snippet> <summary xsi:type= xsd:string ></summary> <title xsi:type= xsd:string >Weebl&#39;s cartoons - Wikipedia, the free encyclopedia</title> </item> </resultelements> <searchcomments xsi:type= xsd:string ></searchcomments> <searchquery xsi:type= xsd:string >Magical Trevor dugongs manatee</searchquery> <searchtime xsi:type= xsd:double >0.276183</searchTime> <searchtips xsi:type= xsd:string ></searchtips> <startindex xsi:type= xsd:int >1</startIndex> </return> </ns1:dogooglesearchresponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Page