Sponsored Links
Axis2 Tutorials
Tutorials
Axis2Apache Axis2 - Data Binding
Data Binding
Databinding for Axis2 is implemented in an interesting manner. Databinding has deliberately not been included in the core, and hence the code generation allows different data binding frameworks to be plugged in. This is done through an extension mechanism where the codegen engine calls the extensions first, and then executes the core emitter.
The extensions plot a map of QNames versus class names that is passed to the code generator wherein the emitter operates.
Axis2 supports the following data binding frameworks including its own data binding framework called ADB:
- ADB: ADB (Axis2 Data Binding) is a simple and lightweight framework that works off StAX and is fairly performant.
- XMLBeans: XMLBeans is preferred if we want to use full schema support as XMLBeans claims that it supports complete schema specification.
- JaxMe: JaxMe support has been added to XMLBeans, and it serves as another option for the user.
- JibX: This is the most recent addition to the family of data binding extensions.
Extensible Nature of Axis2
In Axis2, there are many ways to extend the functionalities. In this book, we will be discussing a few of them, which are listed below:
- Service extension of the module
- Custom deployers
- Message Receivers
Service Extension of the Module
Both Axis1 and Axis2 have the concept of handlers but when compared to Axis 1.x, there are few changes in the way Axis2 specifies and deploys handlers. In Axis 1.x, if you want to add a handler, then you need to change the global configuration file and then restart the system. In the meantime, it does not have a way to add or change handlers dynamically.
To overcome the above problem as well as to add new features, Axis2 introduced the concept of Web Service extensions or a modules, wherein the main purpose of a module is to extend the core functionality. It is similar to adding handler chains in Axis1.x. The advantage of Axis2 modules over Axis 1.x handler chains is that we can add new modules without changing any global configuration files.
A module is a self-contained package that includes handlers, third-party libraries, module-related resources, and a module configuration file.
A module can be deployed as an archive file. Axis2 came up with a new file extension for modules, called ".mar". The most important file in a module archive file is the module configuration file or module.xml. A module will not be functional unless it has a module.xml fi le. A module configuration file mainly specifies handlers and their phase rules. So once we engage a module, depending on the phase rule, the handlers will be placed in different flows (inflow, outflow, and so on).
The idea of modules is very simple. To implement support for WS-Addressing or WS-Security in our services, we need to download the corresponding modules and drop them into the modules directory of the Axis2 repository. We can engage the module at deployment time by adding
Comments
Sponsored Links
