Grails - 调用Web服务时没有类def def错误

时间:2011-02-24 13:45:29

标签: web-services grails groovy groovyws

已更新,以反映更改后的新错误消息

您好,我正在尝试从Grails调用Web服务,但仍然遇到错误。

这是我班级的样子:

import groovyx.net.ws.WSClient

...

    def serviceUrl = "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL"
    def proxy = new WSClient(serviceUrl.toString(), this.class.classLoader)
    serviceResult = proxy.FahrenheitToCelsius("80")
    println serviceResult

...

我遇到了grails运行时异常:

错误500:执行控制器[myPackage.myController]的操作[index]导致异常:java.lang.NoClassDefFoundError:org / apache / cxf / endpoint / Client

一直在尝试进行问题排查,但一直无法找到任何有用的资源。任何有关如何补救的帮助或建议将不胜感激。

感谢。

1 个答案:

答案 0 :(得分:0)

你错过了new运营商的样子:

def proxy = new WSClient(serviceUrl.toString(), this.class.classLoader)
相关问题