更新以反射(reflect)更改后的新错误消息
嗨,我正在尝试从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:执行 Controller [myPackage.myController]的操作[index]导致异常:java.lang.NoClassDefFoundError:org / apache / cxf / endpoint / Client
一直在尝试进行故障排除,但是找不到任何有用的资源。任何有关补救方法的帮助或建议,将不胜感激。
谢谢。
最佳答案
您错过了new
运算符,它看起来像:
def proxy = new WSClient(serviceUrl.toString(), this.class.classLoader)
关于web-services - Grails-调用Web服务时未找到类定义错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5105461/