Thursday, December 4, 2008

Easy Web services with Grails

It was quite interesting to see Samisa's blog post about the ease of creating web services using Visual Studio.

http://www.bloglines.com/blog/samisa?id=111

True enough doing the same in PHP/JAVA may involve a little bit of more coding.

However, doing the same in Open Source is equally simple with the advent of technologies like GRAILS (www.grails.org)

With the Axis2 Plugin for grails,


a service class can be very simply exposed as a web service by adding

a

static expose=['axis2']


to the top of the service class code.

Ex:

mport javax.jws.WebParam;

class TestService {

static expose=['axis2']

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