Axis2M Spring module Guide

Axis2M Spring module was designed to simplify the Axis2 web service development in Spring way. Generally it requires a service.xml descriptor file other than Spring bean definition file in order to deploy any Spring based Axis2 Web Service. Axis2M Spring module facilitates to define Axis2 Web Services and Modules within the Spring bean definition file and does not require any other files such as services.xml and module.xml. Basically Axis2M-spring module provides following features.

  1. Deploys code first web service using generic Spring "bean" element.
  2. Deploys code first web services using Spring namespace support "<service>" element.
  3. Supports Castor, XStream, JIBX and JAXB data binding through the Spring-oxm package without any custom code generation tools.
  4. Deploys Axis2 Module using Spring generic "bean" element.
  5. Deploys Axis2 Module using Spring namespace support "<module>" element.
  6. Converts POJOs in to Axis2 Modules suing Spring configuration.
  7. Two new Maven archetypes to get started with above approaches and deploy services on the fly.


Generally it requires a service.xml descriptor file other than the Spring bean definition file to deploy any Spring based Axis2 Web Service. Most of the times, developers use Spring as a dependency injection ( DI) container and also to assemble and configure other frameworks components within the Spring ApplicationContext . Also another great feature provided by the Spring framework is, that you can convert pure java objects (POJOs) in to native components using spring context, as a XML configuration or Java Annotations. Qurtz scheduler and Castor data binding framework are some of the ideal examples that come under above category. Some of the web service frameworks also provide such features.

Some people comment, that Axis2 is not specifically designed for first class Spring support. But the reality is, there were no such serious design issues found in Axis2 but absence of good Spring supporting module mislead people to get such wrong impression. There were few recent efforts to fill that gap by developing a good Axis2 Spring support module , WSO2 WSF/Spring project was the first notable effort for this, WSO2 WSF/Spring framework provides way to configure Axis2 within Spring bean definition file and define web Services using Spring "bean" element. Axis2M Spring module also reuse some of the basic concepts from WSO2 WSF/Spring framework specially like it's service deployment approach but both these frameworks provide their own unique features. Axis2M Spring module does not provide any feature to configure Axis2 framework within the Spring context, it still utilizes standread axis2.xml file for configuration. With Axis2M -Spring it is possible to configure Axis2 by simply placing axis2.xml file on the CLASSPATH. One of the new features available with Axis2M Spring module is, it's ability to deploy Axis2 Modules only using Spring context. It is possible to define Axis2 modules using Spring "bean" element or <module> element. Along with that it is possible to convert POJOs in to Axis2 modules using popular Spring factory approach.

Spring XML namesapace supports is a popular trend used by the framework developers to implement Spring support for their frameworks without using Spring <bean> tag. it facilitate to define your own XML grammar for your framework that can be used within the Spring context file. Earlier Apache XBean project provided such features, but now Spring framework itself supports for this useful feature. Axis2M Spring provide two such elements called <service> and <module>.

Spring OXM is a very useful package for data binding and it provides wrappers for some of the popular frameworks like Castor , XStream , JIBX and JAXB. One of the key features with Spring OXM is, it's ability to keep Java objects as POJOs and define data banding rules using external files or Java Annotations. This enables to use Spring POJO based practices with data binding tool. Axis2 already supports wide range of data-binding frameworks but Axis2M -Spring module facilitates to achieve data binding through the Spring - OXM package . Having many alternatives is a beneficial feature for any project, Axis2M Spring-OXM module provide two new data-binding frameworks XStream and Castor support for Axis2 users. Further this will not required to generate any legacy code using tools like WSDL2JAVA.

Other than the Spring XML based configuration approach, there is a plan to supports annotations to define services and modules, but this feature will not be implemented in first few releases.

Table of contents