SOAPSOAP is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. Groovy has a SOAP implementation based onXfire
which allows you to create a SOAP server and to make calls on remote SOAP servers.
You need to install 3 jar files in your $
- A jar file containing GroovySOAP and the related XFire dependencies. You can get it here.
- The JavaBeans Activation Framework (aka jaf) is also required. Get it here.
- 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.
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.
- You can also using something more Groovy
- Then the easy part ... no need for comments That's all !
- Oh ... you want to test it ... two more lines.
- You're done!
It's pretty easy to make the remote calls too
- Import the Soap Client class
- 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 !
- Call the remote method via the proxy
- You are done