"Until recently, web service interactions were solely synchronous and request-response in nature. However, it soon became clear that the synchronous request-response type of interaction is a very small subset of messaging scenarios. Messaging is very important in constructing loosely coupled systems, and as a result, this limitation is critical. Web service specifications, such as WS-addressing and WSDL, have incorporated the concepts of messaging, and lay the foundation to cover a wider range of messaging scenarios. The Apache Axis2 architecture assumes neither one message exchange pattern, nor synchronous/asynchronous behavior. This article explains messaging concepts and how Axis2 can be used to implement several well-known messaging scenarios."
"Web services have been a buzzword for a while. A friend used to say "Web services are like high school sex. Everyone is talking about doing it, but hardly anyone is, and those that are probably aren't doing it well." These days, though, Web services are moving to college, so to speak, and lots of people are starting to "do it" more often and better than before. Tools are maturing, and creating and working with Web services isn't all that hard anymore."
"Whichever framework you choose, you'll have the benefit of an active and stable open source community. Each of these frameworks has corporate backing: Axis2 is backed by WSO2, and CXF by Iona. Both have lively developer communities. Axis2 has been around longer but CXF is catching up quickly. My recommendation is this: If multilanguage support is important, Axis2 is the clear choice. If you care about an implementation focused on Java with tight integration into projects like Spring, CXF is a better choice, particularly for embedding web services inside of other programs. If the new features in these projects are not important, and you're relatively happy with Axis1, you should consider staying on this and keep up with the latest maintenance releases until you have a business reason to migrate."
"When implementing Web services, there are two alternative development paths you can take: the code-first approach and the contract-first approach. This article drills down into the contract-first approach in detail and shows how the Axis2 code generator can be used to generate code for the server side with the contract-first approach."
"The above XML segment is called the response payload. You can find the complete source code for this scenario in Scenario1Client.java inside the file invoking-web-services-using-apache-axis2.zip, found in the Resources section below."
"XML has become one of the major technologies used today for business integration software evolution. Lots of object models are being used today to manipulate XML in various ways. AXIOM will improve XML manipulation by providing a new lightweight object model built around pull parsing, enabling efficient and easy manipulation of XML. AXIOM is the object model for Apache Axis 2, the next generation of the Apache web services engine. AXIOM is different from existing XML object models in various ways, the major one being the way it incrementally builds the memory model of an incoming XML source."
"This book excerpt is from "Apache Axis Live" by James Goodwill, copyright 2004. All rights reserved. This chapter is posted with permission from SourceBeat."
"Apache Axis2 is an effort to incorporate the latest changes in the Web services space and to improve performance and efficiency. During a face-to-face meeting in Colombo, Sri Lanka, in August 2003, some of the leading architects of Apache Axis 1.x got together and initiated Apache Axis2, the next generation of Apache Web services. A new architecture was introduced to fulfill the current demand, taking the best patterns and usage scenarios from Axis 1.x. Key improvements and new features included:"
"The left section of Figure 1 shows an IT infrastructure that implements a service-oriented architecture (SOA). This infrastructure offers a range of services to the functional and human users on the right. The exported services can be consumed immediately (for example, an end user automatically downloads a batch of operating system updates) or they can be combined to form other services. How does this mode of use differ from traditional IT infrastructure?"
"You should now be an JiBX-Axis2 Web service developer, capable of turning several of your favorite Java classes into Web services using Axis2 and JiBX."
"AXIOM (AXIs2 Object Model) is the base for Axis2, where any incoming SOAP message is represented as AXIOM inside Axis2. The advantage of AXIOM over other XML representations is that it is based on a pull parser technique, while most others are based on a push parser technique. The main difference of pull over push is that in the pull technique the invoker has the full control on the parser and he can ask for the next event, where as in the case of push, when we ask the parser to proceed it will fire the events until it reaches the end of the document."
"Web services are increasingly more important in day-to-day development, and one of the more popular open source platform choices for developing Web services is Axis2. Written in the Java language, Axis2 can leverage a great deal of freedom from JiBX, a framework for binding XML to Java. Meaning, you already have a Java project, full of your Java classes and data structures, and you don't want to mess with, or change them whatsoever. JiBX allows this by binding XML data used by Axis2 to your Java classes. Advantages of this include easier code maintenance because the Web service will just use your already developed, tried and true Java classes."
"Deployment of the service in Axis2 is quite simple; just copy the .aar file to the axis2/WEB-INF/services directory in the axis2 Web application in your servlet container. In case of Tomcat, it will be $TOMCAT_HOME/webapps/axis2/WEB-INF/services."
"Apache Axis2 1.1 has been released and offers exciting new features to fans of the long-running Apache series of Web services frameworks. We'll cover Axis2 itself in a future article, but this article digs into the AXIs Object Model (AXIOM) XML document model that lies at the core of Axis2. AXIOM is one of the major innovations behind Axis2, and one of the reasons Axis2 offers the potential for substantially better performance than the original Axis. This article guides you through how AXIOM works, how various parts of Axis2 build on AXIOM, and then finishes with a look at how AXIOM performance compares to other Java? document object models."
"JMS defines a standard way for Java applications to create and exchange messages via Message Oriented Middleware (MOM) . You will be using MQSeries as your MOM. You will be developing a Point to Point (P2P) message based system, which allows messages to be exchanged between the producer and the consumer through a channel called a queue. A queue is a destination to which a producer sends messages and from which the receiver takes messages. Each message is consumed by only one receiver in this model."
"Another alternative, if you're using Java 5 or later, is to use Java Architecture for XML Binding (JAXB) 2.0 and Java API for XML Web Services (JAX-WS) annotations to expose your data objects and service classes as Web services. These annotations don't offer the same level of customization as Jibx2Wsdl provides, but they let you embed your configuration information directly in the source code, which some developers find appealing. Axis2 provides experimental support for JAXB 2.0 and JAX-WS as of the 1.2 release, and this will improve in future releases. Future versions of Jibx2Wsdl may also support using JAXB 2.0 and JAX-WS annotations as customizations. (A future article in this series will cover JAXB 2.0 and JAX-WS in more depth and come back to this topic of generating WSDL from code at that time.)"
"Time to complete your example online banking application. In this final installment of the three-part tutorial series, you'll use Apache Geronimo, Axis2, and the Web service you built in Part 1 and Part 2 to create a user interface (UI) that will allow users to view and modify their personal banking data."
"Apache Axis and Axis2 were designed to streamline the process of creating Web services. From Web Services Description Language (WSDL), both Axis and Axis2 automatically generate the Java? classes -- using the WSDL2Java tool -- that you need to construct and deploy your Web service on Apache Geronimo."
"Srinath Perera is a principal architect for Axis2, and his expertise are in Web services, J2EE, and XML-processing technologies. He is a PMC-Member of the Apache Web Service Project and is a committer of Apache Projects, Geronimo, Axis, EWS and Axis2."
"Apache Axis has made developing Java Web services a breeze. In this article, I will discuss some guidelines that prove to be very helpful when developing Java Web services using Axis. This article discusses the customization of Axis and the deployment of Web services; it does not discuss the theory of Web services, XML, Java, and so forth."
"In simple terms, Axis2 is not just the next version of the Axis 1.x family; rather, it is a revolutionary version of Axis 1.x. Axis2 is no longer bound to request-response Web service invocation. As in the Axis 1.x family, there is no turning point like the "pivot point" in Axis2, and Axis2 is built totally on keeping asynchronous Web service invocation in mind. Axis2 acts as a pipe that carries the SOAP message from one end to other. The entry point to the pipe is a transport receiver, and the end point is a message receiver. After handing over the message to the message receiver, Axis2 does not care about the message. Therefore, it's up to the message receiver to invoke the service and send the response, if any, so service implementation class(es) need not always be a Java class; it can be something else as well."
"As mentioned earlier, Axis2 is transport independent and it does not care about the type of the senders and receivers, or all the transport-related code written using interfaces. It is very easy to implement those interfaces and extend the transport framework. Therefore, adding and removing a transport sender/receiver is not a headache; implementing a transport for a given protocol is just a matter of implementing the sender and receiver and register them in axis2.xml. At last, the Listener Manager API is very useful for applications such as BEPL, WS-Eventing, and WS-Notification, and so on."
"Axis2 is fair enough to provide Web service interaction with dynamic and flexible execution framework. Flexibility is achieved using the concept of phases and phase rules, and the dynamic nature of the execution chain has been achieved by runtime module engagement."
"Message context is the property bag + the incoming SOAP message representation in Axis2. There are some services that want to access message context inside its service implementation class; one probable use case could be to access a transport header inside the service and make a decision on that. Axis2 uses a technique called dependency injection to inject message context to the service implementation class; Axis2 uses Java reflection for that. So, if the service wants to access message context inside its service implementation class, it has to add a method called setOperationContext to service the implementation class as follows."
"As you can see from the preceding code, the axis2.xml file has parameters that can be defined in different levels as well. Here, you have parameters at the top level as well as inside transports. Parameters mainly are used to configure the system and to provide configuration data that may be needed at runtime. For example, if you need to log some request to a particular location, that location can be provided by using a parameter. Parameters are designed to store primitive data types (string, int, double, and so forth), OMelements, and the like, but NOT any type of objects. Even though storing object types inside a parameter is not invalid, it is not the correct method to follow."
"Once you follow the steps above, you have completed the process of all the configurations required to embed Axis2 to an existing application. Now,look at how you are going to share the libraries."
"The flexibility and extensibility of Axis2 is focused mainly on its deployment descriptors. Because all these descriptors are XML-based, the extensibility nature of XML has reflected to Axis2 as well. There are three main deployment descriptors in Axis2, as follows:"
"In the case of a Transport session, Axis2 uses transport-related session management techniques to manage session. As an example, in the case of HTTP, it uses HTTP cookies to manage the session. The lifetime of the session is controlled by the transport, not by Axis2; Axis2 stores the service context and serviceGroupContext in the transport session object so that the service can access those contexts as long as the session lives."
"It is possible to write POJO applications with object arrays, and you can have an object array as a field of a bean and as a method in a Service class as shown below. It should be noted here that an object array can be any kind."