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

SOA and web services


SOA is a distinct approach for separating concerns and building business solutions utilizing loosely coupled and reusable components. SOA is no longer a nice-to-have feature for most of the enterprises and it is widely used in organizations to achieve a lot of strategic advantages. By adopting SOA, organizations can enable their business applications to quickly and efficiently respond to business, process, and integration changes which usually occur in any enterprise environment.

Service-oriented solutions

If a software system is built by following the principles associated with SOA, it can be considered as a service-oriented solution. Organizations generally tend to build service-oriented solutions in order to leverage flexibility in their businesses, merge or acquire new businesses, and achieve competitive advantages. To understand the use and purpose of SOA and service-oriented solutions, let's have a look at a simplified case study.

Case study

Smith and Co. is a large motor insurance policy provider located in North America. The company uses a software system to perform all their operations which are associated with insurance claim processing. The system consists of various modules including the following:

  • Customer enrollment and registration

  • Insurance policy processing

  • Insurance claim processing

  • Customer management

  • Accounting

  • Service providers management

With the enormous success and client satisfaction of the insurance claims processed by the company during the recent past, Smith and Co. has acquired InsurePlus Inc., one of its competing insurance providers, a few months back.

InsurePlus has also provided some of the insurance motor claim policies which are similar to those that Smith and Co. provides to their clients. Therefore, the company management has decided to integrate the insurance claim processing systems used by both companies and deliver one solution to their clients.

Smith and Co. uses a lot of Microsoft(TM) technologies and all of their software applications, including the overall insurance policy management system, are built on .NET framework. On the other hand, InsurePlus uses J2EE heavily, and their insurance processing applications are all based on Java technologies. To worsen the problem of integration, InsurePlus consists of a legacy customer management application component as well, which runs on an AS-400 system.

The IT departments of both companies faced numerous difficulties when they tried to integrate the software applications in Smith and Co. and InsurePlus Inc. They had to write a lot of adapter modules so that both applications would communicate with each other and do the protocol conversions as needed.

In order to overcome these and future integration issues, the IT management of Smith and Co. decided to adopt SOA into their business application development methodology and convert the insurance processing system into a service-oriented solution.

As the first step, a lot of wrapper services (web services which encapsulate the logic of different insurance processing modules) were built, exposing them as web services. Therefore the individual modules were able to communicate with each other with minimum integration concerns. By adopting SOA, their applications used a common language, XML, in message transmission and hence a heterogeneous systems such as the .NET based insurance policy handling system in Smith and Co. was able to communicate with the Java based applications running on InsurePlus Inc.

By implementing a service-oriented solution, the system at Smith and Co. was able to merge with a lot of other legacy systems with minimum integration overhead.

Building blocks of SOA

When studying typical service-oriented solutions, we can identify three major building blocks as follows:

  • Web services

  • Mediation

  • Composition

Web services

Web services are the individual units of business logic in SOA. Web services communicate with each other and other programs or applications by sending messages. Web services consist of a public interface definition which is a central piece of information that assigns the service an identity and enables its invocation.

The service container is the SOA middleware component where the web service is hosted for the consuming applications to interact with it. It allows developers to build, deploy, and manage web services and it also represents the server-side processor role in web service frameworks. A list of commonly used web service frameworks can be found at http://en.wikipedia.org/wiki/List_of_web_service_frameworks; here you can find some popular web service middleware such as Windows Communication Foundation (WCF), Apache CXF, Apache Axis2, and so on. We will use Apache Axis2 as the service container for sample projects within the context of this book. Apache Axis2 can be found at http://axis.apache.org/.

The service container contains the business logic, which interacts with the service consumer via a service interface. This is shown in the following diagram:

Mediation

Usually, the message transmission between nodes in a service-oriented solution does not just occur via the typical point-to-point channels. Instead, once a message is received, it can be flowed through multiple intermediaries and subjected to various transformation and conversions as necessary. This behavior is commonly referred to as message mediation and is another important building block in service-oriented solutions. Similar to how the service container is used as the hosting platform for web services, a broker is the corresponding SOA middleware component for message mediation. Usually, enterprise service bus (ESB) acts as a broker in service-oriented solutions.

Composition

In service-oriented solutions, we cannot expect individual web services running alone to provide the desired business functionality. Instead, multiple web services work together and participate in various service compositions. Usually, the web services are pulled together dynamically at the runtime based on the rules specified in business process definitions. The management or coordination of these business processes are governed by the process coordinator, which is the SOA middleware component associated with web service compositions.

We looked into the primary building blocks of service-oriented solutions and the corresponding SOA middleware components. Next, we are going to discuss some of the distinguished elements associated specifically with web services. These are SOAP messaging, Web Services Description Language (WSDL), message exchanging patterns, and RESTful services.