Led & Sustained by

G2one Logo

Developed with

Intellij

Powered by

Spring

XFire plugin

This is an XFire plugin for Grails. This plugin allows you to expose Web services using Grails' service classes.

Latest plugin version is 0.7.3.

Installation

Type this command in your Grail application directory

$> grails install-plugin xfire

or if you have a plugin archive locally.

$> grails install-plugin /path/to/grails-xfire-0.7.3.zip

Dependencies

This snapshot includes some dependency jar file.

If it cannot run out-of-the box, please report in the Grails user group.

Getting Started

This plugin detects the static property 'expose' of a service class.

If the 'expose' property contains 'xfire' keyword,

then the plugin exposes the service as a Web service.

For example, type this:

$> grails create-service Test

You will get "TestService.groovy" in your service directory.

Then, declare the static property "expose" and you may have some methods like:

You may declare some method like:

class TestService {

  static expose=['xfire']

  boolean serviceMethod(YourDomainClass dc){
    return true;
  }

  MyPOGO otherServiceMethod(@WebParam(name="token", header=true)UserToken token, MyOtherPOGO obj) {
    // do something here
  }

}

In the above example WebParam is the standard javax.jws.WebParam annotation. In order to use this you will need groovy 1.1 or later and to add an import statement at the top of the source file.

After running the command "grails run-app",

you can access the WSDL of this example from

http://127.0.0.1:8080/your_grails_app/services/test?wsdl

Please note that TestService.groovy becomes 'test' in WSDL.

Upgrade to Grails 0.6

The name of the plugin has changed from the earlier version to 0.6.1 from XFire to Xfire. Grails gets confused by that, so simply installing the new version is not sufficient, you also have to delete the previous version manually from ./plugins

Upgrade to Grails 0.5(URL Mapping)

  It starts to use URL mapping since grails 0.5,the grails project's XxxUrlMapping.groovy

should be better to modified as blow:

static mappings = {
          "/$controller/$action?/$id?"{
              constraints {
                        controller(matches:/.*[^(services)].*/)
                  }
          }
}

Version History

v. 0.7.3

  • tested against Grails 1.0
  • GRAILSPLUGINS-222 - Regenerate XfireGrailsPlugin*.class when service class is modified
  • GRAILSPLUGINS-229 - Reloading when name or namespace of the service class is changed
  • GRAILSPLUGINS-232 - Exceptions thrown by xfire service methods always returned as java.lang.reflect.UndeclaredThrowableException

v. 0.7.2

  • GRAILSPLUGINS-217 - Support Generics
  • GRAILSPLUGINS-219 - Allow to customize generated targetNamespace via @WebService
  • minor bugs fixed

v. 0.7.1

  • tested against Grails 1.0-RC4

v. 0.6.x

  • tested against Grails 0.6

v. 0.5.1

  • tested against Grails 0.5.6
  • support the WebParam annotation via Groovy 1.1
  • added POGO serialization support (beside Grails domain classes)

v. 0.5

  • updated to use the new Artefact API
  • tested against Grails 0.5
  • updated XFire to 1.2.6

v. 0.4

  • test against Grails 0.4

v. 0.4-M4

  • fixed detection of the transactional property (again)
  • improved skipping of all "Groovy" properties
  • skipped a java.lang.Boolean property (with "get" prefix !)

v. 0.4-M3

  • changed convention (using "static expose=['xfire']" instead of the "XFireService" suffix)
  • changed URI (now it's http://127.0.0.1:8080/app/services/test?wsdl for "TestService.groovy")
  • the jar name is going to be SNAPSHOT until Grails 0.4 released.

v. 0.4-M2

  • updated XFire to 1.2.4
  • fixed detection of the transactional property
  • fixed detection of "metaMethods"
  • refactored

v. 0.4-M1

  • added support for Grails domain classes
  • changed the version number to be compatible with Grails
  • first public release

v. 0.1

  • initial
</