Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Groovy SOAP

Error rendering macro 'link' : Link needs a name and a URL as arguments.
 is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. Groovy has a SOAP implementation based on
Error rendering macro 'link' : Link needs a name and a URL as arguments.
which allows you to create a SOAP server and to make calls on remote SOAP servers.

Installing GroovySOAP

 You need to install 3 jar files in your ${user.home}/.groovy/lib directory:

  1. A jar file containing GroovySOAP and the related XFire dependencies. You can get it here.
  2. The JavaBeans Activation Framework (aka jaf) is also required. Get it here.
  3. Then you need the java mail API from here.
    That's all you need. Then your are ready to build your first web services using Groovy.

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.

  1. MathService.groovy
  2. You can also using something more Groovy
  3. Then the easy part ... no need for comments
    That's all !
  4. Oh ... you want to test it ... two more lines.
  5. You're done!

The Client

It's pretty easy to make the remote calls too

  1. Import the Soap Client class
  2. Create a proxy object to represent the remote server - that's  all you need to do. No need to generate stubs thanks to groovy & xfire !
  3. Call the remote method via the proxy
  4. You are done
  • No labels