Table Of ContentApache Axis2 Web Services
2nd Edition
Create secure, reliable, and easy-to-use web services
using Apache Axis2
Deepal Jayasinghe
Afkham Azeez
BIRMINGHAM - MUMBAI
Apache Axis2 Web Services
2nd Edition
Copyright © 2011 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 authors, 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: May 2008
Second Edition: February 2011
Production Reference: 1110211
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-849511-56-8
www.packtpub.com
Cover Image by Ed Maclean (edmaclean@gmail.com)
Credits
Authors Editorial Team Leader
Deepal Jayasinghe Aanchal Kumar
Afkham Azeez
Project Team Leader
Ashwin Shetty
Reviewer
Deepak Vohra
Project Coordinator
Development Editors Joel Goveya
Ved Prakash Jha
Maitreya Bhakal Proofreader
Aaron Nash
Technical Editor
Pooja Pande
Graphics
Nilesh R. Mohite
Copy Editors
Leonard D'Silva Production Coordinator
Adline Swetha Jesuthas
Lakshmi Menon
Cover Work
Indexers
Adline Swetha Jesuthas
Hemangini Bari
Tejal Daruwale
About the Authors
Deepal Jayasinghe is a Computer Science PhD student at Georgia Institute of
Technology and he is affiliated with Center for Experimental Research in Computer
Systems. Prior to joining Georgia Tech, he was a Technical Lead at WSO2 Inc., an
open source software development company that creates middleware platforms for
web services. Deepal has over six years of experience with SOA and web services
in addition to being a contributing member of the Apache Axis2 project since its
inception. He is a key architect and developer of the Apache Axis2 Web service
project and has led a number of releases. In addition to Axis2, he has made major
contributions to Apache Synapse, Apache Axiom, and Apache XMLSchema projects.
Deepal has written more than 30 technical magazine articles, written research papers,
and has delivered speeches at various SOA and web services conferences. He is an
Apache Member and PMC members at several Apache projects. His expertise lies
mainly in distributed computing, SOA and web services, Cloud computing, and
performance analysis. Deepal holds a B.Sc. Engineering degree from the University
of Moratuwa, Sri Lanka. He can be reached at deepalk@gmail.com.
First of all, I want to thank Apache Axis2 developers and the Axis2
community who has contributed towards making this web services
framework a world renowned success in a relatively short period of
time. Thank you!
I owe countless thanks to my dear wife and parents for always
being there and supporting me in so many ways. This book would
not have been possible without everything that they have done
for me. Special thanks to Srinath Hemapani, Ajith Ranabahu,
Eran Chinthaka, Sanjiva Weerawarana, Davanam Sirinivas, Glen
Daniels, Paul Fremantle, Chathura Herath, Jaliya Ekanayake,
and all the other key members of the Axis2 team without whose
tremendous contributions and wisdom, Axis2 would not have been
possible. For the creation of this work, I am blessed with a strong
team of technical reviewers and superior editorial and production
professionals from Packt Publishing. My sincere thanks to all of you
for your tireless efforts.
Afkham Azeez is a Member, Project Management Committee (PMC) member,
and a committer of the Apache Software Foundation. He works as a Senior
Software Architect and Senior Manager, Platform as a Service, at WSO2 Inc. His
specializations include distributed computing, Cloud computing, SOA and J2EE
technologies. He is a long time open source contributor and is the author of the
clustering implementation for Apache Axis2.
Azeez holds a Masters degree in Computer Science, specializing in Software
Architecture and B.Sc. first class honors degree in Computer Science and
Engineering, from the University of Moratuwa, Sri Lanka. He is a regular
presenter at many open source conferences including the Apache Conferences.
Azeez is a petrolhead and an active member of the AutoLanka forum. He enjoys
a game of basketball and also loves spending time with his three kids.
I would like to express profound gratitude to the open source
communities backing the Apache Axis, Apache Web Services, and
Apache Synapse projects. Their contributions were the foundation
upon which work was built.
I would like to thank Asanka Abeysinghe, Director of Solutions
Architecture at WSO2, and SOA solutions and patterns expert, for
providing, guidance and some content for the Enterprise Integration
Patterns chapter.
I am as ever indebted to my parents specially, for their love and
support throughout my life. I also wish to thank my wife, who
supported me throughout my work.
About the Reviewers
Deepak Vohra is a consultant and a principal member of the NuBean.com
software company. Deepak is a Sun Certified Java Programmer and Web Component
Developer, and has worked in the fields of XML and Java programming and J2EE for
over five years. Deepak is the co-author of the Apress book Pro XML Development
with Java Technology and was the technical reviewer for the O'Reilly book WebLogic:
The Definitive Guide. Deepak was also the technical reviewer for the Course Technology
PTR book Ruby Programming for the Absolute Beginner, and the technical editor for
the Manning Publications book Prototype and Scriptaculous in Action. Deepak is also
the author of the Packt Publishing books JDBC 4.0 and Oracle JDeveloper for J2EE
Development, and Processing XML Documents with Oracle JDeveloper 11g.
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 service@packtpub.com 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 & 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.
Table of Contents
Preface 1
Chapter 1: Apache Web Services and Axis2 7
Service Oriented Architecture (SOA) 8
Web service overview 10
How do organizations move into web services? 11
Web services model 12
Web services standards 13
XML-RPC 14
SOAP 14
Web Services Addressing (WS-Addressing) 15
Service description 15
Web Services Description Language (WSDL) 16
Web services lifecycle 16
Apache Web Service stack 18
Why Axis2? 19
Downloading and installing Apache Axis2 21
Binary distribution 22
WAR distribution 23
Source distribution 25
Document distribution 25
JAR distribution 25
Summary 26
Chapter 2: Looking inside Axis2 27
Axis2 architecture 27
Core modules 28
XML processing model 30
SOAP processing model 30
Information model 32
Description:This is a step by step practical guide for developing web services using Apache Axis2. There are a lot of real-life examples, which makes this book an excellent practical guide. This book is for Java developers who are interested in building web services using Apache Axis2. Familiarity with web stan