Working with Modules
A module is an archive file that bundles a set of classes, related libraries and third party library dependencies.Â
Introduction to Axis2 modules
The folder structure of the module archive file will look as follows:
Test.mar - META-INF - module.xml TestModule.class TestHandler.class
The ESB profile of WSO2 EI has the following modules deployed by default:
Name | Version | Description |
---|---|---|
rampart | 1.61-wso2v14 | This module provides |
addressing | 4.4.0 | This is the |
relay | 4.4.1 | Unwraps the binary messages coming from the Message Relay for Admin Services. |
rahas | 1.61-wso2v14 | This module is used to enable STS for service where it adds the |
For more information on Axis2 Modules, see Apache Axis2 Architecture Guide.
The ESB profile of WSO2 EI provides a user-friendly interface to work with modules. See the following topics for more information on how to work with modules:
Adding a module
You can add a module to the ESB profile of WSO2 EI if you need to extend its capabilities. Follow the instructions below to add a module:
- Sign in. Enter your user name and password to log on to the ESB's management console.
- Click on "Main" in the left menu to access the "Manage" menu.
- In the "Manage" menu, click on "Add" under "Modules."
- The "Add modules" page appears.
Click "Browse" to select the module archive file (MAR) you want to upload. To learn the detailed information about custom modules, see Writing an Axis2 Module .
Tip
Use the plus sign button to upload more than one module.
- Click Upload.
- If the file was uploaded successfully, a message will appear prompting you to restart the server to activate the module. Click "OK."
Once the server has been restarted, the module will be active and displayed on the "Deployed Modules" page.Â
Engaging modules
A module is an archive file that bundles a set of classes, related libraries and third party library dependencies. After uploading a module to the system, you can engage the module to make it active. You can engage a module on a global level as well as at service level.
To engage a module at service level
Add the engagedModules
 service parameter to the proxy service and specify the modules you want to engage as comma separated values. For example, if you need to engage the rampart module and the sample-logging module, add the following parameter to the proxy service:
<parameter name="engagedModules">rampart,sample-logging</parameter>
Following is a sample proxy service where the engagedModules
 parameter is specified to engage the sample-logging module:
 <proxy xmlns="http://ws.apache.org/ns/synapse" name="Pass" transports="http,https" statistics="disable" trace="disable" startOnLoad="true"> <target> <outSequence> <send/> </outSequence> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> </endpoint> </target> <parameter name="engagedModules">sample-logging</parameter> <description/> </proxy>
To engage a module on a global level Â
- In theÂ
<EI_HOME>/conf/axis2/axis2.xmlÂ
file, under the Global Engaged Modules section, add aÂ<module ref="modulename"/>
 entry for every module that you want to engage on a global level. - Restart the server.
For example, to engage the rampart module on a global level, add the following entry and restart the server.
<module ref=“rampart"/>
Note
The WS-Addressing
 module is always engaged on a global level by default.