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