WSClient

  • Tags: web services
  • Latest: 1.0
  • Last Updated: 25 January 2010
  • Grails version: 1.1.1 > *
  • Authors: Cazacu Mihai
1 vote
Dependency:
compile ":ws-client:1.0"

 Documentation

Summary

Installation

grails install-plugin ws-client

Description

WSClient Plugin

This plugin allows you to connect to web services. It is based on GroovyWS - GroovySOAP replacement that uses CXF and Java5 features.

Requirements

  • Grails Version: 1.1.1 and above
  • JDK: 1.5 and above

Installation

grails install-plugin ws-client

Usage

import org.grails.plugins.wsclient.service.WebService

class TestController { WebService webService

def index = { def wsdlURL = "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL" def proxy = webService.getClient(wsdlURL)

def result = proxy.CelsiusToFahrenheit(0) result = "You are probably freezing at ${result} degrees Farhenheit" render result } }

  • or you can skip the usage of WebService class and use directly:
def proxy = new WSClient(wsdlLocation [, classLoader, soapVersion])

If the WSDL contains complex types you can enable DEBUG logging to see a list of bean classes as they are defined:

log4j = {
    …
    debug  'org.apache.cxf'
}

For more information, please access: GroovyWS

Version History

  • 1.0 - Updated to GroovyWS 0.5.1.
  • 0.1 - First official release.

Suggestions, comments or bugs

Feel free to submit questions or comments to the Grails users mailing list. Alternatively you can contact me directly - cazacugmihai at gmail dot com

Please report any issues to the Grails users mailing list and/or write up an issue in JIRA at http://jira.codehaus.org/browse/GRAILSPLUGINS under the Grails-WSClient component.