我无法在groovyws中设置抢占式身份验证。(ws提供程序需要抢占式身份验证。)
我试图在groovyws document中找到答案,但没有线索。
import groovyx.net.ws.WSClient
//def proxy = new WSClient("http://202.44.4.97/webservice/pttinfo.asmx?wsdl", this.class.classLoader)
def proxy = new WSClient("http://192.168.3.69/provider/myService", this.class.classLoader)
proxy.setBasicAuthentication('user', 'pass')
proxy.initialize()下面是一个错误。
Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: http://192.168.3.69/provider/myService发布于 2013-01-16 19:43:11
你试过groovy-wslite吗?它说GroovyWS的in the documentation是:
由于可用性低,项目目前处于休眠状态,您可以考虑使用groovy-wslite作为替代模块
所以,各位朋友,这应该很接近了(我假设你是using SOAP):
import wslite.soap.*
def client = new SOAPClient('http://192.168.3.69/provider/myService')
client.authorization = new HTTPBasicAuthorization( 'user', 'pass' )这里有instructions for getting wslite working with Grails here。
https://stackoverflow.com/questions/14356309
复制相似问题