Skip to main content

Learning Apache Axis2 from level zero

Well I guess you have come to this page with the intention of learning something about Apache Axis2. If you search for google the word "Apache Axis2", you may get millions of pages. But most of them have some pre-requisites before teaching you about Apache Axis2. My intention with this post is to share my experience about learning Apache Axis2 from level zero. If you have used a computer and know how it works, that would be enough.

Since you have used computers, you might know what it does. It does some computing task for you. All the processing, memory, power, data all the components are within a single place and that is what you called your personal computer. That is enough for processing your word document, print your photograph and many more personal things.

Let's think about something bigger than your computing need. Think about a bank doing day to day transactions on their hundreds of branches and each one of them are connected with each other. In this scenario, you can understand that the computing resources are "Distributed" among several locations (Branches). To achieve this kind of computing need, we use a Distributed Computing System in which the computers and resources are distributed in several physical and logical locations.

Now you know what is a distributed computing system. Let's figure out how this system really works to achieve the requirement of the banking system. Let's say Bank has following main systems.


  • Fixed Deposit system - Handle the FD related tasks
  • Pawning system - Handle the Pawning related operations
  • Micro Finance system - Deal with the leasing, loans related operations
  • Savings/Current account system - Handle account related tasks
  • Credit Card system - Deal with credit cards 
  • Inter Bank transaction system - Handle Bank to Bank transactions

These systems need to be developed as separate systems but they need to be interconnected when needed and all of these systems should be accessible from the web interface which is present at the computers of bank officers. We can develop these systems as Services and then we can inter-connect these services in to a common architecture (platform). This kind of system is called as a Service Oriented Architecture (SOA). 

Now we have a basic understanding about the SOA and what it does. Let's move in to the implementation of the above mentioned architecture. Since we are having few systems, we need to interconnect these systems in a reliable and efficient way. From now on we'll call these systems as Services. To connect this kind of services with each other we have the following 03 options.

  • Java Messaging System (JMS)
  • Plain Old XML (POX) with REST services
  • Web services with SOAP
JMS can be used to connect different services in an SOA system. But the problem with this is that when we are connecting services with JMS both the services should be implemented with the same implementation.

REST(REpresentational State Transfer) with POX is a heavily used methodology to connect services or applications in WorldWideWeb (WWW) or in the internet. But the limitation with this mechanism is it only supports few operations (GET, POST, UPDATE, DELETE) .

SOAP(Simple Object Access Protocol) with Web Services is the most convenient and feature rich methodology to connect different services or applications in an efficient way. This methodology will overcome all the limitations which the above two methods had.

Now this is getting a bit complicated. But don't worry if you don't understand some of the words mentioned in the previous paragraph since we are not using them heavily in the preceding sections except few.

So we are going to implement our Banking system with Web Services and SOAP messaging system. For this to be implemented we need a comprehensive platform to work with. Apache SOAP was the first web service platform which provided the "proof of concept" for the web service implementation. That system allowed the users to connect different web services with the SOAP messaging. But when we consider the requirements of a banking system we need a more sophisticated system which is capable of handling advanced features like reliable messaging, security, transactions, etc.

Apache SOAP framework has evolved in to Apache Axis project. This project had some of the above mentioned features but not the entire set. This project was a huge success in the Apache community as well as in the industry. We can use the Apache Axis framework to implement our banking system and connect different services with reliable messaging and security.

When the Bank is growing and the challenge is coming from the competitors, bank need a faster transactions and more powerful features to compete with them. This is where Axis2 comes in to the picture. It has the following features.


  • Speed: Axis2 uses its own object model and StAX (Streaming API for XML) parsing to achieve significantly greater speed than earlier versions of Apache Axis.
  • AXIOM: Axis2 comes with its own lightweight object model, AXIOM, for message processing, which is extensible, performs highly, and is developer-convenient.
  • Hot deployment: Axis2 is equipped with the capability of deploying web services and handlers while the system is up and running. In other words, new services can be added to the system without having to shut down the server. Simply drop the required web service archive into the services directory in the repository, and the deployment model will automatically deploy the service and make it available for use.
  • Asynchronous web services: Axis2 now supports asynchronous web services and asynchronous web services invocation using non-blocking clients and transports.
  • MEP support: Axis2 now comes handy with the flexibility to support Message Exchange Patterns (MEPs) with in-built support for basic MEPs defined in WSDL 2.0.
  • Flexibility: The Axis2 architecture gives the developer complete freedom to insert extensions into the engine for custom header processing, system management, and anything else that you can imagine.
  • Stability: Axis2 defines a set of published interfaces, which change relatively slowly, as compared to the rest of Axis.
  • Component-oriented deployment: You can easily define reusable networks of Handlers to implement common patterns of processing for your applications or to distribute to partners.
  • Transport framework: Axis2 has a clean and simple abstraction for integrating and using Transports (that is, senders and listeners for SOAP over various protocols such as SMTP, FTP, message-oriented middleware, and so on), and the core of the engine is completely transport-independent.
  • WSDL support: Axis2 supports the Web Service Description Language (versions 1.1 and 2.0), which allows you to easily build stubs to access remote services, and also to automatically export machine-readable descriptions of your deployed services from Axis2.
  • Add-ons: Several web service specifications have been incorporated, including WSS4J for security (Apache Rampart), Sandesha for reliable messaging. Kandula is an encapsulation of WS-Coordination,  WS-AtomicTransaction, and WS-BusinessActivity.
  • Composition and extensibility: Modules and phases improve support for composability and extensibility. Modules support composability and can also support new WS-* specifications in a simple and clean manner. They are, however, not hot deployable, as they change the overall behavior of the system.
Now you know that Apache Axis2 is a feature rich and advanced web service framework which you can use to implement your SOA system such as the Banking system described in the beginning of this article. You can implement reliable messaging, security, transactions and other required features for the banking system implementation. If you need more information about implementations with the Apache Axis2, you can refer the Axis2 official web site http://axis.apache.org/axis2/java/core/

This article has been prepared with the help of the book "Apache Axis2 Web Services 02nd edition" by Afkham Azeez and Deepal Jayasinghe.





Comments

Popular posts from this blog

Understanding Threads created in WSO2 ESB

WSO2 ESB is an asynchronous high performing messaging engine which uses Java NIO technology for its internal implementations. You can find more information about the implementation details about the WSO2 ESB’s high performing http transport known as Pass-Through Transport (PTT) from the links given below. [1] http://soatutorials.blogspot.com/2015/05/understanding-wso2-esb-pass-through.html [2] http://wso2.com/library/articles/2013/12/demystifying-wso2-esb-pass-through-transport-part-i/ From this tutorial, I am going to discuss about various threads created when you start the ESB and start processing requests with that. This would help you to troubleshoot critical ESB server issues with the usage of a thread dump. You can monitor the threads created by using a monitoring tool like Jconsole or java mission control (java 1.7.40 upwards). Given below is a list of important threads and their stack traces from an active ESB server.  PassThroughHTTPSSender ( 1 Thread )

WSO2 ESB tuning performance with threads

I have written several blog posts explaining the internal behavior of the ESB and the threads created inside ESB. With this post, I am talking about the effect of threads in the WSO2 ESB and how to tune up threads for optimal performance. You can refer [1] and [2] to understand the threads created within the ESB. [1] http://soatutorials.blogspot.com/2015/05/understanding-threads-created-in-wso2.html [2] http://wso2.com/library/articles/2012/03/importance-performance-wso2-esb-handles-nonobvious/ Within this blog post, I am discussing about the "worker threads" which are used for processing the data within the WSO2 ESB. There are 2 types of worker threads created when you start sending the requests to the server 1) Server Worker/Client Worker Threads 2) Mediator Worker (Synapse-Worker) Threads Server Worker/Client Worker Threads These set of threads will be used to process all the requests/responses coming to the ESB server. ServerWorker Threads will be used to pr

How to configure timeouts in WSO2 ESB to get rid of client timeout errors

WSO2 ESB has defined some configuration parameters which controls the timeout of a particular request which is going out of ESB. In a particular  scneario, your client sends a request to ESB, and then ESB sends a request to another endpoint to serve the request. CLIENT->WSO2 ESB->BACKEND The reason for clients getting timeout is that ESB timeout is larger than client's timeout. This can be solved by either increasing the timeout at client side or by decreasing the timeout in ESB side. In any of the case, you can control the timeout in ESB using the below properties. 1) Global timeout defined in synapse.properties (ESB_HOME\repository\conf\) file. This will decide the maximum time that a callback is waiting in the ESB for a response for a particular request. If ESB does not get any response from Back End, it will drop the message and clears out the call back. This is a global level parameter which affects all the endpoints configured in ESB. synapse.global_timeout_inte