Deprecated Garbage Collections – Kenny Lee Chee Wei

A truckload of garbage by Kenny Lee Chee Wei

Groovy Web Service Client (GroovyWS)

with 5 comments

Here’s 2 examples of how simple groovy web service clients can be. You will need to download a groovy lib jar from the GroovyWS Home Site. Basically it just creates the classes dynamically on-the-fly instead of creating stubs.

1. CurrencyConvertor

proxy = new WSClient("", this.class.classLoader)
//'USD', 'EUR', 'CAD', 'GBP', 'AUD', 'SGD'
rate = proxy.ConversionRate('SGD','USD')
print rate

2. Stock Quote

proxy = new WSClient("", this.class.classLoader)
quote = proxy.GetQuote('GOOG')
print quote

Read Geertjan’s groovy_web_service for more info (Swing).

Read the official Groovy Web Service Doc for more info (Groovy WS) .

Written by kennii

January 2, 2008 at 8:03 am

Posted in Groovy

5 Responses

Subscribe to comments with RSS.

  1. That is exactly how complex a client should be. Java web service clients have been too complex in the past. It doesn’t help that in the past vendors (I’m looking at you BEA) always liked to pile on their cruft to make life (cough, cough) easier 🙂


    July 18, 2008 at 5:28 pm

    • Let’s see you some message level encryption via WS-Security used on this call and see how simple it remains.


      June 16, 2009 at 11:36 am

  2. these are just toy programs .


    January 7, 2009 at 9:17 am

  3. Following script is generated with SoamMoa

    /* Generated GroovyWS Script by SoaMoa, :ridvan at Thu Oct 08 23:14:13 CEST 2009 */


    def proxy = new WSClient(“”, this.class.classLoader)
    def conversionRateResponse = proxy.ConversionRate(‘USD’, ‘EUR’)
    assert (conversionRateResponse == 0.676)


    October 8, 2009 at 9:16 pm

  4. The examples did not work by exactly copy/pasting and running them.
    I had to add the line
    after creating the proxy.

    Still got WARNING: Using SOAP version: 1.1 but got the reply.

    How can I set wait timeouts to the proxy?


    January 7, 2010 at 2:40 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: