문제

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.NoClassDefFoundError: 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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top