Module Overview
GroovyWS is taking over GroovySOAP as CXF replaces XFire. The major difference here is that GroovyWS is using Java5 so if you need to stick to 1.4 please continue to use GroovySOAP.
Warning: Most of the documentation is adapted from the former GroovySOAP documentation and will improve in the future. I tried to make it as accurate as possible but feel free to report any error.
Warning: GroovyWS is Java5 dependent (due to CXF) and has been tested using groovy-1.1-beta-2 only.
Download
Distributions
GroovyWS is distributed as a single JAR file containing all CXF JARs and dependencies. It is located here
Installing
You just need to place the above mentioned JAR file in your ${user.home}/.groovy/lib directory.
Pre-requisites
As the pre-requisites are quite tricky to handle, an all-in-one JAR file is distributed
Documentation
Getting Started
The Server
You can develop your web service using a groovy script and/or a groovy class. The following two groovy files are valid for building a web-service.
- MathService.groovy
- You can also using something more Groovy
- Then the easy part ... no need for comments
That's all !
The Client
- Oh ... you want to test it ... two more lines.
- You're done!
Complex types
The Server
Let say we have a server that manage a library in which you can add a book, find a book and get all the books. The server code will probably look like this ![]()
- BookService.groovy
- with the class Book being something like that.
Book.groovy
To ignore themetaClassproperty a custom type mapping must be defined (for details refer to Aegis Binding).Book.aegis.xml
However, if you compile custom data types from Java the bytecode won't contain ametaClassproperty and, hence, there is no need to define a custom mapping.
The Client
The good think here is that the client does not have to know about the Book class. It is automatically generated during the proxy creation time and can be used by your client. Here it is located in the defaultnamespace package since no package was used on the server side.
Here is how the client looks like now:
More Information
Current limitations (and workaround)
- Still no basic authentication (see JIRA issue 1457 for GroovySOAP)
Demos with public web services
There exist a lot of web-services available for testing. One which is pretty easy to evaluate is the currency rate calculator from webservicex.net.
Here is a small swing sample that demonstrate the use of the service. Enjoy !
Developers
Guillaume Alleon
Source Control
http://svn.codehaus.org/groovy-contrib/groovyws
Building
Contributing
Community
Mailing List(s)
use user@groovy.codehaus.org
Issue tracker
There is a GroovyWS category in JIRA