CXF客户端授权问题
我使用 JAXRSClientFactory.create 方法来创建代理,如下所示:
IMyService myService
= JAXRSClientFactory.create("http://myserviceurl/", IMyService.class, "login1", "pwd", null);
并且此代码工作正常。
之后,我需要将此服务与另一个凭据一起使用,并尝试使用另一个凭据创建相同的服务,如下所示:
IMyService myNewService
= JAXRSClientFactory.create("http://myserviceurl/", IMyService.class, "login2", "pwd", null);
此代码可以工作,但使用错误的凭据(使用第一个服务的凭据)。我没有找到任何方法来改变它(重置,或清除,或类似的东西)。
还有一个细节,这个问题只有摘要授权。有了基本的效果就很好。
有人可以帮我解决这个问题吗?
谢谢。
I use JAXRSClientFactory.create method to create proxy like this:
IMyService myService
= JAXRSClientFactory.create("http://myserviceurl/", IMyService.class, "login1", "pwd", null);
and this code work ok.
After that I need to use this service with another credentials and I try to create same service with another credentials like this:
IMyService myNewService
= JAXRSClientFactory.create("http://myserviceurl/", IMyService.class, "login2", "pwd", null);
this code work, but work with wrong credentials (with credentials from first service). I didn't found any way to change it (reset, or clear, or something like this).
And one more detail, this issue only with digest authorization. With basic it works well.
Could anybody help me with this issue.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
摘要身份验证如何与 JAXRSClientFactory.create 一起使用?
根据API的描述,该方法用于获取具有基本身份验证的客户端。
How does digest auth work with JAXRSClientFactory.create?
According to the description of the API, the method is used in order to get a client with basic authentication.
也许这样的事情应该有效:
Maybe something like this should work :