首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GroovyWS WSClient抢占式基本身份验证

GroovyWS WSClient抢占式基本身份验证
EN

Stack Overflow用户
提问于 2013-01-16 18:32:07
回答 1查看 1.6K关注 0票数 0

我无法在groovyws中设置抢占式身份验证。(ws提供程序需要抢占式身份验证。)

我试图在groovyws document中找到答案,但没有线索。

代码语言:javascript
复制
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()

下面是一个错误。

代码语言:javascript
复制
Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: http://192.168.3.69/provider/myService
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-16 19:43:11

你试过groovy-wslite吗?它说GroovyWS的in the documentation是:

由于可用性低,项目目前处于休眠状态,您可以考虑使用groovy-wslite作为替代模块

所以,各位朋友,这应该很接近了(我假设你是using SOAP):

代码语言:javascript
复制
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

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14356309

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档