der kl@mmeraffe | ruby. java. development.

a developers guide to the world of code

Thursday, July 13, 2006

Groovy and SOAP

All right, i've never seen SOAP implemented as easy as this:

Write a groovy-Script like that:

class SOAPTest {
  String printMe(String name) {
    return "Hello "+ name
  }
}

Start a SOAP-Server:

import groovy.net.soap.SoapServer
def server = new SoapServer("localhost", 6980)
server.setNode("SOAPTest")
server.start()


And check it with a client:

import groovy.net.soap.SoapClient
def proxy = new SoapClient("http://localhost:6980/SOAPTest?wsdl")
def result = proxy.printMe("Johnny")

More Information at the Codehaus-Homepage:
Groovy and SOAP @ codehaus.org

add to del.icio.us | submit to digg | submit to reddit

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home