Plugins You can find out about all the publicly available Grails plugins.

Apache Axis2 Plugin

  • Tags: web services, axis2
  • Latest: 0.7.0
  • Last Updated: 27 February 2010
  • Grails version: *
  • Authors: null
2 votes
compile ":axis2:0.7.0"




This plugin allows Grails developers to expose methods defined in Grails Service classes as Web Services. The latest version of the plugin is 0.6.1. This version supports Grails v1.1.

NOTE: Please use version 0.5 for Grails 1.0.4 and earlier versions.


Type the following command in your Grails application directory to install Apache Axis2 plugin.

$> grails install-plugin axis2
Alternatively, you can use the following command, if you have a plugin archive locally.
$> grails install-plugin /path/to/grails-axis2-<version>.zip


This plugin is based on the WSO2 WSF/Spring framework, which integrates the Apache Axis2 Web services engine into Spring.

Getting Started

Just add the following line to a Grails service class to expose is as a web service. This will expose all the methods of the service class as web service operations.

static expose=['axis2']

For more information on service classes refer to the section on Services in the Grails user guide.

The following code illustrates a sample service class exposed as an Apache Axis2 web service.

import javax.jws.WebParam;

class TestService {

static expose=['axis2']

String sayHello(String yourName) { return "Hello ${yourName}!" }

def availableBooks() { return Book.list() }

Book getBookById(int id) { return Book.get(id) }

void addBook(@WebParam(name="name")String pName, @WebParam(name="author")String pAuthor) { new Book(name:pName, auther:pAuthor).save(); } }

You can use Java or Groovy classes (including domain classes) as parameters and return types.

After running the application (grails run-app), the EPR of the web service will be:


And the WSDL will be available at:


You can browse the Axis2 web interface at:



The following features are planned to implement in the near future.

  • Custom WSDLs
  • WS-* support

Source Code

This source code is available at

Report Bugs

Please use JIRA issue tracker available at!default.jspa. Report the bugs under the "Grails-axis2" component of the "Grails Plugins" project. If you do not have an exsisting JIRA account, please sign up at!default.jspa.

Version History

v. 0.6.1

  • Bug fixes
v. 0.6
  • Supports Grails 1.1
v. 0.5
  • Updated to WSF/Spring v1.5
  • Partial support for @WebParam annotation ('name' attribute)
v. 0.2
  • Groovy classes (including Grails domain classes) for parameters and return values.
v. 0.1.2
  • Grails v1.0.1 support
v. 0.1.1
  • Minor changes and bug fixes
v. 0.1
  • Initial release