Book Image

Web Services Testing with soapUI

By : Charitha Kankanamge
Book Image

Web Services Testing with soapUI

By: Charitha Kankanamge

Overview of this book

Quality is a key to success of service-oriented projects. Utilization of proper tools is important to the outcome of web service testing methodology. Being the leading open source web services testing tool, soapUI helps to build robust and flexible automated tests in a productive manner. "Web Services Testing with soapUI" guides you on adopting best web service testing mechanisms with the industry leading open source testing tool, soapUI. You will learn to use soapUI effectively in testing service-oriented solutions focusing on testing functional as well as non-functional characteristics of web services. SoapUI is capable of testing JDBC data sources, web applications, RESTful services and web services exposed over transports such as JMS. The book discusses all these features and much more, in detail, through practical and clear examples. This book is focused on learning soapUI in order to test web services in an effective manner. It starts with a general introduction to service-oriented architecture (SOA) followed by testing aspects of service-oriented solutions. This book aims to give readers a comprehensive overview of usage of soapUI in SOA and web services testing projects. Starting with an overview of SOA and web services testing, you will quickly get your hands dirty with a sample project which makes use of open source web service engine, Apache Axis2. All demonstrations and hands-on exercises are based on this sample project. The tests in a soapUI project are organized into TestSuites, TestCases and TestSteps. You will also learn how soapUI can be used for both functional and non-functional testing. The book then teaches how by using groovy scripting and integrating with Junit and maven, soapUI can easily be used in automated web services testing. By the end, you'llhave learned to test functional and non-functional aspects of web services and automate by integrating into continuous build systems using soapUI.
Table of Contents (21 chapters)
Web Services Testing with soapUI
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

This book is all about using soapUI for functional and performance testing of service-oriented solutions. soapUI can be used to test various aspects of a service-oriented solution without merely playing the role of a web service invocation tool. We will follow a simple tutorial-style approach throughout the book in which we will explore all key features provided by soapUI based on a sample web services project. This book is ideally designed to guide readers to get more detailed insight on soapUI by doing a lot of hands-on exercises.

What this book covers

Chapter 1, Web Services Testing and soapUI, introduces soapUI by giving an overview of its history, features, and installation of soapUI in your computer. We will begin our journey towards learning soapUI by discussing some key characteristics of SOA, Web services and Web services testing in general.

Chapter 2, The Sample Project, introduces the sample web services project which will be used as the target application for functional and performance testing in the remaining chapters of the book. In this chapter, we will build a simple web services based application using Apache Axis2 open source web services framework. The primary objective of building this sample application is to use it in all demonstrations of soapUI features. As we will not discuss any topics related to soapUI or web services testing in general in this chapter, you may skip the details and download the sample web services project from http://www.PacktPub.com/support.

Chapter 3, First Steps with soapUI and Projects, serves as a guide for getting started with soapUI projects. Based on one of the web services that we built as part of the sample web services project in Chapter 2, The Sample Project, we will discuss the schema and WSDL of the web service in detail. We will use soapUI to invoke the operations of sample web service and discuss the SOAP requests, responses, and faults.

Chapter 4 , Working with Your First TestSuite, demonstrates the basic constructs of a soapUI project—TestSuites, TestCases, and TestSteps—which prepares you for the next chapters of the book. We will also look into the validation of responses using assertions and soapUI properties.

Chapter 5, Load and Performance Testing with soapUI, covers the steps that you would have to follow when using soapUI as a load and performance testing tool. We will demonstrate the load test strategies provided by soapUI and the load test specific assertions.

Chapter 6 ,Web Services Simulation with soapUI, briefly describes how web services can be simulated using soapUI. We will demonstrate the usage of soapUI mock services model and static as well as dynamic mock responses.

Chapter 7 , Advanced Functional Testing with soapUI, introduces the testing aspects of web services extensions such as WS-Security and WS-Addressing. We will use an improved version of the sample web services project which we built in Chapter 2, The Sample Project for the demonstrations in this chapter.

Chapter 8, Getting Started with REST Testing, introduces the concepts related to RESTful web services and how soapUI can be utilized in RESTful services testing. We will demonstrate the use of soapUI in RESTful services testing by using a publicly hosted sample web application.

Chapter 9, Testing Databases with soapUI, briefly describes the direct database query invocations of soapUI. In this chapter, we will discuss the database testing features provided by soapUI such as JDBC requests and assertions.

Chapter 10 , JMS Testing with soapUI, demonstrates the use of JMS in soapUI. By exposing one of the sample web services over JMS transport, we will explore the JMS testing capabilities provided by soapUI.

Chapter 11, Extending soapUI with Scripting, introduces the scripting facilities given by soapUI in order to extend the default behavior of soapUI tests. We will look into the use of soapUI API methods through Groovy scripts inside our tests.

Chapter 12, Automated Testing with soapUI, demonstrates various automated testing approaches with soapUI. In this chapter, we will discuss the integration of soapUI tests with build tools such as Apache Maven.

Chapter 13, Miscellaneous Topics, introduces some useful tools integrated with soapUI such as WS-I validation tool and the utilities provided by external web services framework such as Apache Axis2. This chapter also demonstrates the use of soapUI when testing services by sending attachments.

What you need for this book

We will make use of quite a lot of open source software to run the code samples in this book. Firstly, you should install soapUI 4.0.1 or later version as explained in Chapter 1, Web Services Testing and soapUI. You would require MySQL and Apache Axis2-1.6.1 or later version to run the sample web services. You will also need Apache Ant to build the sample web services project. Apache Rampart, Apache Maven, Apache ActiveMQ, and Apache Wink open source libraries are required for some demonstrations as explained in the respective chapters.

Who this book is for

If you are a part of a team that builds service-oriented solutions or makes use of web services in your project, and your primary involvement is testing such a solution, then this book is the ideal reference for you. This book will help you to understand the common challenges of SOA testing and how soapUI can be utilized effective manner in testing your applications.

This book would also be a good reference for developers and QA engineers who do researches and evaluations on various commercial and open source web services testing tools. If you are an experienced software professional or a novice tester, you will quickly be able to learn the most important features of soapUI by following the simple step-by-step instructions given in this book.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The <s:Body> element carries the actual message payload."

A block of code is set as follows:

CREATE TABLE IF NOT EXISTS ROOM_T(
      room_number INT NOT NULL, 
      room_type VARCHAR(100) NOT NULL, 
      room_size varchar(100) NOT NULL, 
      PRIMARY KEY(room_number));

Any command-line input or output is written as follows:

create database HOTEL_RESERVATION_DB;

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "You can check the Create a desktop icon checkbox to create an icon on the desktop so can you can easily launch soapUI".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.