You are previewing Apache Axis2 Web Services 2nd Edition.
O'Reilly logo
Apache Axis2 Web Services 2nd Edition

Book Description

Create secure, reliable, and easy-to-use web services using Apache Axis2.

  • Extensive and detailed coverage of the enterprise ready Apache Axis2 Web Services / SOAP / WSDL engine.

  • Attain a more flexible and extensible framework with the world class Axis2 architecture.

  • Learn all about AXIOM - the complete XML processing framework, which you also can use outside Axis2.

  • Covers advanced topics like security, messaging, REST and asynchronous web services.

  • Written by Deepal Jayasinghe, a key architect and developer of the Apache Axis2 Web Service project; and Afkham Azeez, an elected ASF and PMC member.

In Detail

Web services are gaining popularity and have become one of the major techniques for application integration. Due to the flexibility and advantages of using web services, you want to enable Web service support to your applications. This book is your gateway to learning all you need to know about the Apache Axis2 web service framework and its hands on implementation.

Apache Axis2 Web Services, 2nd Edition is your comprehensive guide to implementing this incredibly powerful framework in practice. It gives you precisely what you need to know to develop a detailed practical understanding of this popular, modular and reliable web service framework.

This book starts with a short and relevant introduction about the Axis2 1.5 framework and then plunges you straight into its architectural model.

Learn to use and develop your own modules. Write a services.xml file so efficiently that you'll be creating more complex applications (rather than just POJOs) in no time.

Learn how straightforward it really is to turn a Java class into a web service in Axis2. Experiment with different types of sessions in Axis2. Learn different patterns of Enterprise deployment. Ensure reliability in your web service - a major concern in most enterprise applications - with minimum impact on performance.

This book will journey you through all this and more, giving you exactly what you need to learn Axis2 1.5 in the easiest way possible and create secure, reliable, and easy-to-use web services efficiently and systematically.

Table of Contents

  1. Apache Axis2 Web Services 2nd Edition
    1. Apache Axis2 Web Services 2nd Edition
    2. Credits
    3. About the Authors
    4. About the Reviewers
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. 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. Errata
        2. Piracy
        3. Questions
    7. 1. Apache Web Services and Axis2
      1. Service Oriented Architecture (SOA)
      2. Web service overview
        1. How do organizations move into web services?
      3. Web services model
        1. Web services standards
        2. XML-RPC
        3. SOAP
        4. Web Services Addressing (WS-Addressing)
        5. Service description
        6. Web Services Description Language (WSDL)
      4. Web services lifecycle
      5. Apache Web Service stack
      6. Why Axis2?
      7. Downloading and installing Apache Axis2
        1. Binary distribution
        2. WAR distribution
        3. Source distribution
        4. Document distribution
        5. JAR distribution
      8. Summary
    8. 2. Looking inside Axis2
      1. Axis2 architecture
      2. Core modules
        1. XML processing model
        2. SOAP processing model
        3. Information model
        4. Deployment model
        5. Client API
        6. Transports
      3. Other modules
        1. Code generation
        2. Data binding
      4. Extensible nature of Axis2
        1. Service extension or the module
        2. Custom deployers
        3. Message receivers
      5. Summary
    9. 3. Axis 2 XML Model (AXIOM)
      1. Overview of AXIOM and its features
        1. What is pull parsing?
        2. Architecture
      2. Working with AXIOM
        1. Creating Axiom
        2. Creating Axiom from an input stream
        3. Creating Axiom using a string
        4. Creating Axiom programmatically
        5. Adding child nodes and attributes
        6. Working with OM namespaces
        7. Working with attribute
        8. Traversing the Axiom tree
        9. Serialization
        10. Advanced operations with Axiom
          1. Xpath navigation
          2. Accessing the pull parser
          3. Axiom and SOAP
            1. Creating a SOAP 1.1 document
            2. Creating a SOAP 1.2 document
      3. Summary
    10. 4. Execution Chain
      1. Handler
        1. Writing a simple handler
      2. Phase
        1. Types of phases
          1. Global phases
          2. Operation phases
      3. Phase rules
        1. Characterizing a phase rule
          1. Phase name
          2. phaseFirst
          3. phaseLast
          4. before
          5. after
          6. after and before
        2. Invalid phase rules
      4. Flow
      5. Module engagement and dynamic execution chain
        1. Special handlers in the chain
          1. Transport receiver
          2. Dispatchers
          3. Message receiver
          4. Transport sender
      6. Summary
    11. 5. Deployment Model
      1. What is new in Axis2 deployment?
      2. Hot deployment and hot update
        1. Hot deployment
        2. Hot update
      3. Repository
      4. Change in the way of deploying handlers (modules)
      5. Deployment descriptors
        1. Global descriptor or axis2.xml
        2. Service descriptor (services.xml)
        3. Module descriptor or module.xml
        4. Available deployment options
        5. Archive-based deployment
        6. Directory-based deployment
        7. Deploying a service programmatically
        8. POJO deployment
        9. Deploying and running a service in one line
      6. Summary
    12. 6. Information Model
      1. Axis2 static data
        1. AxisConfiguration
        2. Parameters
        3. MessageReceiver
        4. MessageFormatters and MessageBuilders
        5. TransportReceiver and TransportSender
        6. Flows and phaseOrder
        7. AxisModule
      2. Service description hierarchy
        1. AxisServiceGroup
        2. AxisService
        3. AxisOperation
        4. AxisMessage
      3. Axis2 contexts
        1. ConfigurationContext
        2. ServiceGroupContext
        3. ServiceContext
        4. OperationContext
        5. MessageContext
      4. Summary
    13. 7. Writing an Axis2 Service
      1. Creating a web service
      2. The code first approach
        1. Single class POJO approach
        2. POJOs with packages
        3. Deploying services using a service
          1. Writing the services.xml file
          2. Service implementation class
          3. Specifying the message receiver
        4. Creating a service archive file
        5. Different ways of specifying message receivers
            1. Specifying the message receiver at the operation level
            2. Specifying message receivers at the service level for the whole service
            3. Specifying the service level message receiver and overriding them through operations
        6. Service group and single service
        7. Adding third-party resources
        8. Service WSDL and schemas
      3. Contract first approach starting from the WSDL
        1. Generating code
        2. Filling in the service skeleton
        3. Running the ant build file
      4. Summary
    14. 8. Writing an Axis2 Module
      1. Brief history of the Axis2 module
        1. Module concept
          1. Module structure
          2. Module configuration file (module.xml)
          3. Handlers and phase rules
          4. Module implementation class
        2. Writing the module.xml file
          1. Deploying and engaging the module
          2. Advanced module.xml
          3. Parameters
          4. WS-Policy
          5. Endpoints
      2. Summary
    15. 9. The Client API
      1. Web service client
        1. Blocking and non-blocking invocation
        2. Looking into Axis2 client API
          1. ServiceClient API
            1. Available options to create a ServiceClient
              1. Type 1: Creating a ServiceClient using its default constructor
              2. Type 2: Creating a ServiceClient with your own ConfigurationContext
              3. Type 3: Creating a dynamic client (client on the fly)
          2. ServiceClient with working samples
            1. Scenario 1: Invoking a service in a blocking manner (sendReceive())
            2. Scenario 2: Utilizing a service in a non-blocking manner (sendReceiveNonBlocking())
            3. Scenario 3: Utilizing a service using two transports
            4. Scenario 4: Utilizing an in-only MEP (fireAndForget)
            5. Scenario 5: Utilizing an in-only MEP (sendRobust)
        3. Working with the OperationClient
      2. Summary
    16. 10. Session Management
      1. Stateless nature of Axis2
      2. The available type of sessions in Axis2
      3. Session initializing and session invalidating
        1. Java reflection
        2. Using the optional interface
        3. Accessing MessageContext
      4. Request session scope
      5. SOAP session scope
      6. Transport session scope
        1. Option 1: Using the browser
        2. Option 2: Using the service client
      7. Application scope
        1. Managing sessions using ServiceClient
      8. Summary
    17. 11. Developing JAX-WS Web Services
      1. Writing a simple JAX-WS web service
      2. JAX-WS annotations
        1. JSR 181 (Web Service Metadata) annotations
          1. javax.jws.WebService
            1. name
            2. targetNamespace
            3. serviceName
            4. endpointInterface
            5. portName
            6. wsdlLocation
          2. javax.jws.WebMethod
            1. operationName
            2. action
            3. exclude
          3. javax.jws.OneWay
          4. javax.jws.WebParam
          5. name
          6. targetNamespace
          7. mode
          8. header
          9. partName
          10. javax.jws.WebResult
            1. name
            2. targetNamespace
            3. header
            4. partName
          11. javax.jws.soap.SOAPBinding
            1. style
            2. use
            3. parameterStyle
      3. JSR 224 (JAX-WS) annotations
          1. javax.xml.ws.BindingType
          2. javax.xml.ws.RequestWrapper and javax.xml.ws.ResponseWrapper
            1. localName
            2. targetNamespace
            3. className
          3. javax.xml.ws.ServiceMode
          4. javax.xml.ws.WebEndpoint
          5. javax.xml.ws.WebFault
            1. name
            2. targetNamespace
            3. faultBean
          6. javax.xml.ws.WebServiceClient
            1. name
            2. targetNamespace
            3. wsdlLocation
          7. javax.xml.ws.WebServiceProvider
            1. targetNamespace
            2. serviceName
            3. portName
            4. wsdlLocation
          8. javax.xml.ws.WebServiceRef
            1. name
            2. type
            3. mappedName
            4. value
            5. wsdlLocation
      4. JSR 222 (JAXB) annotations
        1. javax.xml.bind.annotation.XmlRootElement
          1. namespace
          2. name
        2. javax.xml.bind.annotation.XmlAccessorType
        3. javax.xml.bind.annotation.XmlElement
          1. name
          2. namespace
      5. JSR 250 (Common Annotations)
        1. javax.annotation.Resource
        2. javax.annotation.PostConstruct
        3. javax.annotation.PreDestroy
      6. Code first service development with JAX-WS
      7. Contract first development with JAX-WS
        1. Client-side JAX-WS
          1. The Dispatch client
          2. The Dynamic Proxy client
        2. MTOM with JAX-WS Services
        3. Asynchronous invocation of JAX-WS services
          1. Polling model
          2. Callback model
      8. Summary
    18. 12. Axis2 Clustering
      1. Setting up a simple Axis2 cluster
      2. Writing a highly available clusterable web service
      3. Stateless Axis2 Web Services
      4. Setting up a failover cluster
      5. Increasing horizontal scalability
      6. Setting up and configuring Axis2 clusters in production
        1. Clustering agent
        2. Clustering agent parameters
          1. AvoidInitiation
          2. membershipScheme
          3. domain
          4. synchronizeAll
          5. maxRetries
          6. mcastAddress
          7. mcastPort
          8. mcastFrequency
          9. memberDropTime
          10. mcastBindAddress
          11. localMemberHost
          12. localMemberPort
          13. preserveMessageOrder
          14. atmostOnceMessageSemantics
          15. properties
        3. State management
        4. Node management
        5. Group management
        6. Static members
        7. Full configuration
      7. Membership schemes
        1. Static membership
        2. Dynamic membership
        3. Hybrid membership
      8. Cluster management
      9. Highly available load balancing
      10. The Axis2 clustering management API
        1. org.apache.axis2.clustering.ClusteringAgent
        2. org.apache.axis2.clustering.state.StateManager
        3. org.apache.axis2.clustering.management.NodeManager
        4. org.apache.axis2.clustering.management.GroupManagementAgent
      11. Summary
    19. 13. Enterprise Integration Patterns
      1. Apache Synapse
      2. WSO2 ESB
      3. OpenESB
      4. Protocol bridging
      5. External authentication and authorization
      6. Dynamic routing combined with auditing
      7. Event Driven Architecture (EDA) with Master Data Management (MDM) for Integrating Legacy Systems
        1. Event Driven Architecture (EDA)
        2. Master Data Management (MDM)
        3. Adaptor layer
        4. Integration server
        5. Logic server
        6. Registry
      8. Push and pull
      9. Fault tolerant autoscaling with dynamic load balancing
      10. References
      11. Summary
    20. 14. Axis2 Advanced Features and Usage
      1. Representational State Transfer (REST)
        1. Features of REST
        2. REST services in Axis2
          1. REST web service with GET and POST
      2. Message Transmission Optimization Mechanism (MTOM)
        1. By value
        2. By reference
        3. MTOM on the client side
        4. MTOM on the service side
      3. Axis2 configurator
      4. Deploying Axis2 in various application servers
      5. Asynchronous web services with Axis2
        1. Client side asynchronous
        2. Application-level asynchronous support
        3. Transports-level asynchronous support
      6. Summary
    21. 15. Building a Secure Reliable Web Service
      1. Reliable web services
          1. Sample service
          2. One way invocation
          3. Request-reply invocation
        1. Managing sequences
          1. Creating a sequence without sending a message
          2. Terminate a sequence
        2. Secure web services
          1. Sample service
          2. Writing the password callback
        3. Creating the policy element
          1. Generating client stubs
          2. Invoking the service without security
          3. Invoking the service with security
      2. Summary