**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 redesign and rewrite of the widely used Apache Axis SOAP stack that builds on the lessons learned from the Apache Axis implementation of the SOAP submission to W3C. Apache Axis2 not only supports SOAP 1.1 and SOAP 1.2, but also has integrated support for the widely popular REST-style of web services. The same business logic implementation can offer both a WS-\* style interface and a REST/POX style interface simultaneously. Apache Axis2 is more efficient, more modular, more scalable, and more XML-oriented than the older version. It is carefully designed to support the easy addition of plug-in modules that extend its functionality for features such as security and reliability. Apache Axis2 is built on Apache AXIOM, a new high performance, pull-based XML object model. This book will take you through the basics of web services and Axis2 to the details of Axis2's architecture. **What you will learn from this book?** * Standards and components of your web services * Installing Axis2 core components * Understand AXIOM (the Axis2 Object Model), use it to handle SOAP, and learn AXIOM best practices * Understanding pipes and interceptors for handling incoming and outgoing messages * Creating a flexible framework using runtime module engagement * Deploying Axis2 and types of deployments along with examples * Creating a complex service like a session-aware service and writing handlers * The module concept and writing a sample module * Need for quality services and the techniques available in Axis2 to extend the functionality * Working with the client API with example use case * Session management in a web service framework **Approach** This is a step by step practical guide for developing web services using Apache Axis2. There are lot of real-life examples, which makes this book a good learning material. **Who this book is written for?** This book is for Java developers who are interested in building web services using Apache Axis2. The book presumes that you are familiar with web standards like SOAP, WSDL and XML parsing. Cover......Page 1 Table of Contents......Page 8 Preface......Page 14 Web Service History......Page 20 Web Services Overview......Page 21 How Do Organizations Move into Web Services?......Page 22 Web Services Standards......Page 23 XML-RPC......Page 24 Web Services Addressing (WS-Addressing)......Page 25 Web Services Description Language (WSDL)......Page 26 Apache Web Service Stack......Page 27 Why Axis2?......Page 28 Binary Distribution......Page 29 WAR Distribution......Page 30 Summary......Page 31 Axis2 Architecture......Page 32 Core Modules......Page 33 SOAP Processing Model......Page 34 Information Model......Page 36 Deployment Model......Page 37 Client API......Page 38 Transports......Page 39 Data Binding......Page 40 Service Extension of the Module......Page 41 Summary......Page 42 Overview and Features......Page 44 AXIOM—Architecture......Page 45 Creating an AXIOM......Page 46 Creating an AXIOM from an Input Stream......Page 47 Creating an AXIOM Programmatically......Page 48 Adding a Child Node and Attributes......Page 49 Working with Attributes......Page 50 Serialization......Page 51 Using OMNavigator for Traversing......Page 53 Accessing the Pull-Parser......Page 54 AXIOM and SOAP......Page 55 Summary......Page 56 Handler......Page 58 Writing a Simple Handler......Page 59 Phase......Page 61 Global Phase......Page 62 Phase Rules......Page 64 before......Page 65 Invalid Phase Rules......Page 66 Flow......Page 67 Module Engagement and Dynamic Execution Chain......Page 68 Dispatchers......Page 69 MessageReceiver......Page 70 Summary......Page 71 What's New in Axis2 Deployment?......Page 72 J2EE-like Deployment Mechanism......Page 73 Hot Deployment and Hot Update......Page 74 Change in the Way of Deploying Handlers (Modules)......Page 75 New Deployment Descriptors......Page 76 Service Descriptor (services.xml)......Page 77 Available Deployment Options......Page 78 Deploying a Service Programmatically......Page 79 POJO Deployment......Page 80 Summary......Page 82 Axis2 Static Data......Page 84 AxisConfiguration......Page 86 Parameters......Page 88 Flows and PhaseOrder......Page 89 Service Description Hierarchy......Page 90 AxisOperation......Page 91 Axis2 Contexts......Page 92 ConfigurationContext......Page 93 OperationContext......Page 94 Summary......Page 95 Introduction......Page 96 Single-Class POJO Approach......Page 97 POJO with Class Having Package Name......Page 99 Deploying a Service Using a Service Archive File......Page 100 Writing the services.xml File......Page 101 Different Ways of Specifying Message Receivers......Page 102 Specify Message Receivers at the Service Level for the Whole Service......Page 103 Specify Service-Level Message Receivers and Override Them with Operations......Page 104 Adding Third-Party Resources......Page 105 Service WSDL and Schemas......Page 106 Filling the Service Skeleton......Page 107 Summary......Page 108 Introduction......Page 110 Module Structure......Page 111 Module Configuration File (module.xml)......Page 112 Handlers and Phase Rules......Page 113 Module Implementation Class......Page 115 Endpoints......Page 118 Writing the module.xml File......Page 119 Deploying and Engaging the Module......Page 120 Advanced module.xml......Page 122 Summary......Page 123 Blocking and Non-Blocking Invocation......Page 124 Inside Axis2 Client API......Page 125 Available Ways of Creating a ServiceClient......Page 126 ServiceClient with a Working Sample......Page 128 Working with OperationClient......Page 135 Summary......Page 137 Introduction......Page 138 Types of Sessions in Axis2......Page 139 Using the Optional Interface......Page 141 Request Session Scope......Page 142 SOAP Session Scope......Page 144 Transport Session Scope......Page 146 Application Scope......Page 147 Summary......Page 148 Code-First Approach......Page 150 Why Not the Code-First Approach?......Page 152 Code-Generation Support in Axis2......Page 153 Sample 1: Use Default Code-Generation Options to Generate Server-Side Code......Page 154 Sample 3: Generate an Interface Instead of a Concrete Class......Page 156 Sample 4: Generating Client-Side Code......Page 157 Summary......Page 159 Features of REST......Page 160 REST Services in Axis2......Page 161 MTOM—Message Transmission Optimization Mechanism......Page 162 MTOM on the Service Side......Page 165 Axis2 ClassLoader Hierarchy......Page 166 Sharing Libraries Using the Class Loader Hierarchy......Page 167 Axis2 Configurator......Page 168 Deploying Axis2 in Various Application Servers......Page 169 Summary......Page 170 Index......Page 172
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 redesign and rewrite of the widely used Apache Axis SOAP stack that builds on the lessons learned from the Apache Axis implementation of the SOAP submission to W3C. Apache Axis2 not only supports SOAP 1.1 and SOAP 1.2, but also has integrated support for the widely popular REST-style of web services. The same business logic implementation can offer both a WS-* style interface and a REST/POX style interface simultaneously.
Apache Axis2 is more efficient, more modular, more scalable, and more XML-oriented than the older version. It is carefully designed to support the easy addition of plug-in modules that extend its functionality for features such as security and reliability. Apache Axis2 is built on Apache AXIOM, a new high performance, pull-based XML object model.
This book will take you through the basics of web services and Axis2 to the details of Axis2's architecture.
Everything you need to create secure, reliable and easy-to-use web services using Apache Axis2. Packed with real-life examples, you will learn how to work with Axis2 in a fast and practical way. You will learn to build SOAP and REST web services and APIs for your web applications.
Approach
This is a step by step practical guide for developing web services using Apache Axis2. There are lot of real-life examples, which makes this book a good learning material.
Who this book is for
This book is for Java developers who are interested in building web services using Apache Axis2. The book presumes that you are familiar with web standards like SOAP, WSDL and XML parsing.