开发者

Grails - No class def found error when calling web service

开发者 https://www.devze.com 2023-02-13 08:44 出处:网络
Updated to reflect new error message after changes Howdy, I am trying to call a web service from Grails, but keep running in to errors.

Updated to reflect new error message after changes

Howdy, I am trying to call a web service from Grails, but keep running in to errors.

Here's what my class looks like:

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

...

I am encountering a grails runtime exception:

Error 500: Executing action [index] of controller [myPackage.myController] caused exception: java.lang.N开发者_StackOverflow社区oClassDefFoundError: org/apache/cxf/endpoint/Client

Have been trying to troubleshoot, but have been unable to find any helpful resources. Any help or suggestions on how to remedy would be much appreciated.

Thanks.


You missed the new operator it looks like:

def proxy = new WSClient(serviceUrl.toString(), this.class.classLoader)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号