Skip to: Site menu | Main content

Groovy 

      Download | Documentation | Developers | Community

An agile dynamic language for the Java Platform

Consuming a web service Add comment to Wiki View in Wiki Edit Wiki page Printable Version

The Client

Oh ... you want to test the previously defined web service Publishing a web service

import groovyx.net.ws.WSClient

def proxy = new WSClient("http://localhost:6980/MathService?wsdl", this.class.classLoader)
proxy.initialize() // from 0.5.0
def result = proxy.add(1.0 as double, 2.0 as double)
assert (result == 3.0)

result = proxy.square(3.0 as double)
assert (result == 9.0)

You're done!