Web Services Testing with Soapui
Total Page:16
File Type:pdf, Size:1020Kb
Web Services Testing with soapUI Build high quality service-oriented solutions by learning easy and efficient web services testing with this practical, hands-on guide Charitha Kankanamge BIRMINGHAM - MUMBAI Web Services Testing with soapUI Copyright © 2012 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: October 2012 Production Reference: 1191012 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84951-566-5 www.packtpub.com Cover Image by Asher Wishkerman ([email protected]) Credits Author Project Coordinators Charitha Kankanamge Sai Gamare Shraddha Vora Reviewers Evanthika Amarasiri Proofreader Bindu Laxminarayan Maria Gould Ajay Pawar Indexer Acquisition Editor Monica Ajmera Mehta Kartikey Pandey Graphics Lead Technical Editors Valentina D'Silva Hithesh Uchil Aditi Gajjar Azharuddin Sheikh Production Coordinator Technical Editors Prachali Bhiwandkar Vrinda Amberkar Ankita Meshram Cover Work Prachali Bhiwandkar Prashant Salvi About the Author Charitha Kankanamge is Manager, Quality Assurance and Senior Technical Lead at WSO2 with more than 9 years of experience in Software Quality Assurance. Charitha is specialized in SOA and middleware testing. He lead the WSO2 QA team since 2007. He is also a committer of the Apache Software Foundation contributing to Apache web services project. Charitha is interested in researching new technologies in software-testing space as well as new trends in agile and exploratory testing processes. Prior to joining WSO2, Charitha has worked at Virtusa inc. for 3 years where he was involved in multiple on-site and off-shore project assignments. In his rare offline moments, he enjoys playing guitar and watching movies. Charitha has been involved in reviewing two books, Apache Jmeter, Emilly H. Halili and Quick Start Apache Axis2, Deepal Jayasinghe both being published by Packt Publishing. Charitha can be reached through his blog: http://charithaka.blogspot.com Acknowledgement Making a book reality takes many dedicated people, and it is my great pleasure to acknowledge their contributions. First, I'd like to thank Packt Publishers, in particular, Kartikey Pandey – Senior Acquisition Editor, who proposed me to write this book. I'm grateful for all the help I got from the editorial staff at Packt Publishers in reviewing this book, specially Hithesh Uchil – Lead Technical Editor and Sai Gamare who coordinated the progress of writing, by ensuring that I stayed on track. This book has benefited from a great set of technical reviewers. I'd like to thank each of them for volunteering their time reviewing drafts of this book and providing valuable feedback. Specially, my colleague at WSO2 QA team, Evanthika Amarasiri who carried out in-depth quality assurance process in all chapters by executing each sample. I sincerely thank my wife, Thushari for her patience, support, and understanding throughout the writing process. Many thanks to my beloved parents who raised me, made me the person who I am today by providing their insightful guidance in all aspects of my life. Though I'm unable to name individually, I would like to extend my heartfelt gratitude to many colleagues at WSO2, who never hesitated to give their support to the fullest extent, whenever I requested help on various subject matters. I must thank Dr. Sanjiva Weerawarana, Founder, Chairman and CEO of WSO2, Inc. whose vision inspires me and guides me to accomplish my career aspirations. Finally, a big thank goes to the developers and contributors of Smartbear software for making soapUI the world's best open source web services testing tool. About the Reviewers Evanthika Amarasiri joined 99X Techonology (former Eurocenter DDC Ltd.) in 2000 as a trainee QA Engineer. She has become competent in testing applications based on Java, C++, VB and .NET, Lotus Notes, and in mobile application testing (Symbian and J2ME). While she was working there, she studied for her B.Sc. in Information Systems at the Informatics Institute of Technology, Sri Lanka, which was affiliated to the Manchester Metropolitan University, UK. She left 99X Technology in 2006 and joined WSO2 Lanka (Pvt) Limited (in the same year) as a Software Engineer - Quality Assurance. From 2006 to date, she has worked with several leading middleware products of WSO2. During her stay at WSO2 she has gained experience and knowledge on different kinds of web technologies, operating systems, databases, application servers, and many QA testing tools. She has also gained extensive experience in functional, usability, performance testing, as well as QA test planning. By contributing to the Apache Synapse, which is a free and open source software project, she has become a committer for the same. Currently she is working as a Quality Assurance Technical Lead and is also a member of the Management Committee in the Integration Technology team of WSO2. I would like to thank my loving husband and my mother for all the support given while reviewing this book. Also, a special thank goes to my team mates for all the valuable inputs given, to make the review process a success. My sincere gratitude goes to Charitha, the author of the book, for selecting me as a reviewer for his book. He is a great teacher/leader who has inspired us with his work. Without his guidance and support, I would not have made this far in my career. I wish him all the best for his future endeavors. Bindu Laxminarayan is an expert in Software Testing and Quality Assurance with expertise in Test Automation Framework Design and Development. Over the last 7 years, she has worked on various testing tools including but not limited to SOAPUI, Jmeter and selenium on RESTful and SOAP Web Services. She is currently working on Test Automation of Cloud Web Services and design patterns in Automated Testing. Over the last two years she has presented at work on StarEast Conference. Ajay Pawar is an IBM middleware consultant having more than a decade of experience. He is Director at ePower Consultancy Services UK. Ltd. He started his career working on technologies such as Java, Java Swing, Java EE, and then extended his experience in SOA world. He is an expert in IBM middleware tools such as WebSphere Process Server (WPS), WebSphere Integration Developer (WID), WebSphere MQ (WMQ), and Websphere Service Registry and Repository (WSRR). He has also good flair for web services testing. He is proficient in soapUI tool and he used it extensively for manual as well as automation testing. I would like to thank my wife Hema, sweet daughter Aarohi, and a cute baby Vihaan for their constant support. www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. This book is dedicated to my parents, who have raised me to be the person I am today and my beloved wife Thushari and my loving kids, Risith and Nethul. Table of Contents Preface 1 Chapter 1: Web Services Testing and soapUI 7 SOA and web services 8 Service-oriented solutions 8 Case study 8 Building blocks of SOA 9 Simple Object Access Protocol 11 Alternatives to SOAP 13 REST 13 Java Script Object Notation 14 Web Services Description Language 14 Message exchanging patterns 16 SOAP Faults 17 Approaches of testing web services 18 Unit testing of web services 19 Functional testing 19 Tool assisted testing 19 Using client APIs provided by service container middleware 19 Integration testing of web services 20 Performance testing of web services 20 The common challenges of Web services testing 20 Use of external web services