You are previewing Web Services Testing with soapUI.
O'Reilly logo
Web Services Testing with soapUI

Book Description

Starting with an overview of SOA and web services testing, this guide take you through a number of hands-on exercises and projects to get you familiar with soapUI. A sure way to raise the quality of your web services.

  • Become more proficient in testing web services included in your service-oriented solutions

  • Find, analyze, reproduce bugs effectively by adhering to best web service testing approaches

  • Learn with clear step-by-step instructions and hands-on examples on various topics related to web services testing using soapUI

  • In Detail

    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

    1. Web Services Testing with soapUI
      1. Web Services Testing with soapUI
      2. Credits
      3. About the Author
      4. Acknowledgement
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Web Services Testing and soapUI
        1. SOA and web services
          1. Service-oriented solutions
            1. Case study
            2. Building blocks of SOA
              1. Web services
              2. Mediation
              3. Composition
        2. Simple Object Access Protocol
        3. Alternatives to SOAP
          1. REST
          2. Java Script Object Notation
        4. Web Services Description Language
        5. Message exchanging patterns
        6. SOAP Faults
        7. Approaches of testing web services
          1. Unit testing of web services
          2. Functional testing
            1. Tool assisted testing
            2. Using client APIs provided by service container middleware
          3. Integration testing of web services
          4. Performance testing of web services
          5. The common challenges of Web services testing
            1. Use of external web services
            2. Implications of using complex standards and protocols
            3. Headless nature of web services
        8. What is soapUI?
        9. Capabilities of soapUI
        10. Installing soapUI
          1. System requirements
          2. Installing soapUI on Linux
          3. soapUI installation on Windows
          4. Installing soapUI on MacOS
        11. A glance at soapUI user interface
        12. Summary
      9. 2. The Sample Project
        1. The problem domain
        2. Project pre-requisites
          1. Java
          2. Apache Ant
          3. MySQL
          4. Setting up Apache Axis2
          5. Setting up project source directories
        3. Designing the web services
          1. Creating the database
        4. Implementing the web services
          1. Web services fault handling
          2. Managing database operations
          3. Completing the web service implementation classes
        5. Deploying web services
        6. Summary
      10. 3. First Steps with soapUI and Projects
        1. Understanding the web services definition
          1. Schema
          2. portType
          3. binding
          4. Service
        2. Creating a soapUI project
        3. Invoking the guest management web service
        4. A detailed look at SOAP requests and responses
        5. Generating SOAP Faults
        6. Summary
      11. 4. Working with Your First TestSuite
        1. A sample test scenario
        2. Creating a TestSuite
          1. Adding TestCases
            1. addRoom TestCase
            2. getRoomDetails TestCase
            3. deleteRoom TestCase
        3. Running the first TestSuite
          1. Adding test assertions
            1. Not SOAP Fault assertion
            2. XPath Match assertion
            3. The Contains assertion
        4. Adding properties to soapUI tests
          1. Reading property values from a file
          2. Transferring property values between TestSteps
        5. Summary
      12. 5. Load and Performance Testing with soapUI
        1. Non-functional testing of web services
          1. Performance testing
        2. Planning for web service performance testing
        3. Using soapUI for performance testing
        4. Working with load tests in soapUI
          1. Limit of a load test
          2. Threads in a soapUI load test
          3. Load test strategies of soapUI
            1. Simple load strategy
            2. Burst load strategy
            3. Thread load strategy
            4. Variance strategy
          4. A closer look at the load test report and statistics of soapUI
          5. Using load test assertions in soapUI
            1. The Max Errors assertion
            2. The Step Average assertion
            3. Step TPS assertion
            4. The Step Maximum assertion
            5. The Step Status assertion
            6. LoadTest options
        5. Summary
      13. 6. Web Service Simulation with soapUI
        1. Mocking in software testing
        2. Mocking in web services testing
          1. Mock services and contract-first web service development
          2. Simulating services that are not accessible
          3. Dealing with test environmental restrictions
        3. Mock services with soapUI
          1. The structure of soapUI MockService
            1. MockService details
            2. MockOperation details
            3. Dispatching styles of MockOperation
            4. MockResponse details
        4. soapUI mock services in action
          1. Static responses – the basic scenario
            1. Service chaining
            2. Content-based routing
            3. Message transformation
          2. Using dynamic responses
        5. Summary
      14. 7. Advanced Functional Testing with soapUI
        1. Introduction to web services extensions
          1. What is WS-Addressing
            1. Endpoint references
            2. Message addressing properties
          2. What is WS-Security
            1. WS-Policy
            2. WS-SecurityPolicy
            3. WS-Trust
            4. WS-SecureConversation
        2. Configuring Apache Axis2 for WS-Addressing and WS-Security
          1. WS-Addressing in Apache Axis2
          2. WS-Security in Apache Axis2
          3. Testing the WS-Addressing with soapUI
            1. Validating the WS-Addressing responses
          4. Testing WS-Security with soapUI
          5. Web service authentication
            1. Securing GuestManagementService
            2. Testing the secured GuestManagementService with soapUI
          6. Project level WS-Security configurations in soapUI
        3. Testing asymmetric binding policy with soapUI
          1. Asymmetric binding
            1. Signing SOAP messages
            2. Securing RoomManagementService
            3. Testing secured RoomManagementService with soapUI
              1. Outgoing WS-Security configurations
              2. Incoming WS-Security configurations
              3. Applying WS-Security configurations to the SOAP request
        4. Validating WS-Security responses
        5. Summary
      15. 8. Getting Started with REST Testing
        1. Introduction to REST
          1. Represent everything with URIs
          2. Using standard HTTP methods
          3. Linking resources together
          4. Multiple representations of resources
          5. Stateless communication
        2. Testing RESTful APIs using soapUI
        3. REST Services in soapUI
          1. Request and response representation
          2. Using POST or PUT requests in soapUI REST services
          3. Reading POST message content from a file
          4. Inserting the HTTP Basic Authentication header to requests
        4. REST parameters
          1. Query parameters
          2. Template parameters
          3. Matrix parameters
          4. Header parameters
        5. Functional testing of REST services
        6. WADL
        7. Summary
      16. 9. Testing Databases with soapUI
        1. Testing data in isolation
        2. Setting up soapUI to connect to the database
        3. JDBC Request TestStep
          1. JDBC Request properties
        4. JDBC test assertions
          1. Stored procedures with JDBC Request TestStep
          2. Accessing soapUI properties from SQL query
        5. Summary
      17. 10. JMS Testing with soapUI
        1. Introduction to JMS
          1. Setting up Apache ActiveMQ
        2. JMS integration in soapUI
          1. Working with JMS messaging in soapUI
          2. Validating JMS responses
          3. Verifying end-to-end JMS message delivery using the sample project
            1. Configuring JMS in Apache Axis2
          4. Configuring a session in HermesJMS
          5. Adding a JMS endpoint in soapUI
        3. Summary
      18. 11. Extending soapUI with Scripting
        1. Introduction to Groovy scripting language
          1. What is Groovy?
          2. HelloWorld with Groovy
          3. Variable and object declaration in Groovy
          4. Control structures in Groovy
          5. Class and method declarations in Groovy
        2. Groovy scripting in soapUI
          1. The context object
          2. The testRunner variable
        3. soapUI ModelItems
          1. Setup and TearDown scripts in soapUI
          2. Load Script at soapUI project level
        4. Request and response handling using Scripts
          1. Script assertion
        5. Summary
      19. 12. Automated Testing with soapUI
        1. Test automation
          1. Why is test automation essential in SOA?
          2. Continuous Integration (CI)
        2. soapUI JUnit integration
        3. soapUI command line executions
          1. Invoking a soapUI command line functional test runner
          2. Invoking test runners from the soapUI graphical user interface
        4. Maven soapUI plugin
        5. Summary
      20. 13. Miscellaneous Topics
        1. soapUI IDE plugins
          1. soapUI Eclipse plugin
          2. soapUI IntelliJ IDEA plug-in
        2. WS-I validation using soapUI
        3. soapUI integration with external web services' frameworks
        4. Sending attachments with SOAP messages using soapUI
          1. Deploying an MTOM-enabled web service
          2. Using soapUI to send an attachment to the web service
        5. Summary