ebook img

Quickstart Apache Axis2: A practical guide to creating quality web services PDF

180 Pages·2008·2.38 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Quickstart Apache Axis2: A practical guide to creating quality web services

Quickstart Apache Axis2 A practical guide to creating quality web services Deepal Jayasinghe BIRMINGHAM - MUMBAI Quickstart Apache Axis2 Copyright © 2008 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, Packt Publishing, nor its dealers or 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 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 Production Reference: 1160508 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847192-86-8 www.packtpub.com Cover Image by Vinayak Chittar ([email protected]) Credits Author Project Coordinator Deepal Jayasinghe Patricia Weir Reviewers Indexer Ramanujam A. Rao Monica Ajmera Senior Acquisition Editor Proofreader Rashmi Phadnis Chris Smith Technical Editor Production Coordinator Shilpa Dube Aparna Bhagat Editorial Team Leader Cover Work Mithil Kulkarni Aparna Bhagat Project Manager Abhijeet Deobhakta About the Author Deepal Jayasinghe is a Technical Lead at WSO2 Inc., an open-source software development company that creates middleware platforms for Web Services. He joined WSO2, Inc. in August, 2005. He has more than 3 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 a 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, research papers, and has delivered speeches in various SOA and Web Services conferences. He is an Apache Web Services PMC member, an Apache committer, and an Apache Member. His expertise lies mainly in distributed computing, fault-tolerant systems, and Web Services-related technologies. He has a B.Sc. in Engineering from the University of Moratuwa, Sri Lanka and and will be starting graduate studies at Georgia Institute of Technology in fall, 2008. Contact: [email protected]. First of all, I want to thank the Apache Axis2 developers and Axis2 community who have contributed towards making this Web Services framework a world-renowned success in a relatively short period of time. Thank you! I would like to thank Dr Sanjiva Weerawarana, Founder, Chairman and CEO of WSO2, Inc., without whose support, vision, guidance, and belief in my work this effort would never have been realized. I owe countless thanks to my parents and dear wife 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 my colleagues Suran Jayathilaka, Devaka Randeniya, and Charitha Kankanamage for reviewing my writings, validating the samples, providing insight, and contributing to this effort in many other ways. Special thanks to Srinath Hemapani, Ajith Ranabahu, Eran Chinthaka, Davanam Sirinivas, Glen Daniels, Paul Fremantle, Chathura Herath, Jaliya Ekanayake, and all 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, superior editorial and production professionals from Packt Publishing. My sincere thanks to all of you for your tireless efforts. About the Reviewer Ramanujam A. Rao is a software architect and an engineer with over 12 years of experience in designing and developing large-scale enterprise applications. He is currently involved in consulting in the area of enterprise-application architecture and helps to build scalable and distributed applications. He also has expertise in building enterprise-technology standards and cultivating architecture capabilities. He lives in Columbus, OH, USA with his wife and two-year old daughter. Contact: [email protected]. Table of Contents Preface 1 Chapter 1: Introduction 7 Web Service History 7 Web Services Overview 8 How Do Organizations Move into Web Services? 9 Web Services Model 10 Web Services Standards 10 XML-RPC 11 SOAP 12 Web Services Addressing (WS-Addressing) 12 Service Description 13 Web Services Description Language (WSDL) 13 Web Services Life Cycle 14 Apache Web Service Stack 14 Why Axis2? 15 Download and Install Axis2 16 Binary Distribution 16 WAR Distribution 17 Source Distribution 18 JAR Distribution 18 Summary 18 Chapter 2: Looking into Axis2 19 Axis2 Architecture 19 Core Modules 20 XML Processing Model 21 SOAP Processing Model 21 Information Model 23 Deployment Model 24 Client API 25 Transports 26 Other Modules 27 Code Generation 27 Data Binding 27 Extensible Nature of Axis2 28 Service Extension of the Module 28 Table of Contents Custom Deployers 29 Message Receivers 29 Summary 29 Chapter 3: AXIOM 31 Overview and Features 31 What is Pull Parsing? 32 AXIOM—Architecture 32 Working with AXIOM 33 Creating an AXIOM 33 Creating an AXIOM from an Input Stream 34 Creating an AXIOM Using a String 35 Creating an AXIOM Programmatically 35 Adding a Child Node and Attributes 36 Working with OM Namespaces 37 Working with Attributes 37 Traversing the AXIOM Tree 38 Serialization 38 Advanced Operations with AXIOM 40 Using OMNavigator for Traversing 40 Xpath Navigation 41 Accessing the Pull-Parser 41 AXIOM and SOAP 42 Summary 43 Chapter 4: Execution Chain 45 Handler 45 Writing a Simple Handler 46 Phase 48 Types of Phases 49 Global Phase 49 Operation Phase 51 Phase Rules 51 Phase Name 52 phaseFirst 52 phaseLast 52 before 52 after 53 after and before 53 Invalid Phase Rules 53 Flow 54 Module Engagement and Dynamic Execution Chain 55 [ ii ] Table of Contents Special Handlers in the Chain 56 TransportReceiver 56 Dispatchers 56 MessageReceiver 57 TransportSender 58 Summary 58 Chapter 5: Hacking Deployment 59 What's New in Axis2 Deployment? 59 J2EE-like Deployment Mechanism 60 Hot Deployment and Hot Update 61 Repository 62 Change in the Way of Deploying Handlers (Modules) 62 New Deployment Descriptors 63 Global Descriptor (axis2.xml) 64 Service Descriptor (services.xml) 64 Module Descriptor (module.xml) 65 Available Deployment Options 65 Archive-Based Deployment 66 Directory-Based Deployment 66 Deploying a Service Programmatically 66 POJO Deployment 67 Deploying and Running a Service in One Line 69 Summary 69 Chapter 6: Information Model 71 Introduction 71 Axis2 Static Data 71 AxisConfiguration 73 Parameters 75 MessageFormatters and MessageBuilders 76 TransportReceiver and TransportSender 76 Flows and PhaseOrder 76 AxisModule 77 Service Description Hierarchy 77 AxisServiceGroup 78 AxisService 78 AxisOperation 78 AxisMessage 79 Axis2 Contexts 79 ConfigurationContext 80 ServiceGroupContext 81 ServiceContext 81 [ iii ]

Description:
In Detail Axis2 is an enterprise-ready web service engine that is very user friendly and provides web service interactions with a dynamic and flexible execution framework. Apache Axis2 is a core engine for web services with two implementations: Apache Axis2/Java and Apache Axis2/C. It is a complete
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.