Simple Groovy WS client is failing but why?
i am trying to use Groovy WS and use the following code.
@Grab(group='org.codehaus.groovy.modules', module='groovyws', version='0.5.2')
import groovyx.net.ws.WSClient
proxy = new 开发者_JAVA百科WSClient("http://lyricwiki.org/server.php?wsdl", this.class.classLoader)
proxy.initialize()
result = proxy.searchArtist("shakira")
println "${result}"
It should be simple, but somehow it fails with a failure telling me:
Caught: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
What am i doing wrong?
Unfortunatly, if GroovyWS is awesome when deployed against a well-known web-service, discovering web-services abilities with it may sometimes be ... difficult, as all and everything is hidden below the proxy.
Poersonnally, when trying to connect to a WSDL web-service, my first weapon is SoapUI.
I first try to connect to WS using SoapUI, then perform all the requests I will latter try to execute in groovy-world. This way, I get errors more readable than with GroovyWS (although I really like its simplicity).
精彩评论