如何使用Axis2 ADB客户端进行基本身份验证? [英] How to do Basic Authentication with an Axis2 ADB Client?

查看:430
本文介绍了如何使用Axis2 ADB客户端进行基本身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试弄清楚如何使用ADB Axis2 1.5版客户端进行基本身份验证。

I'm trying to figure out how to do Basic Authentication with an ADB Axis2 version 1.5 Client.

我正在尝试以下方法:

HttpTransportProperties.Authenticator basicAuth = new HttpTransportProperties.Authenticator();
basicAuth.setUsername(username);
basicAuth.setPassword(password);
final Options clientOptions = serviceStub._getServiceClient().getOptions();
clientOptions.setProperty(HTTPConstants.AUTHENTICATE, basicAuth);

但是这不起作用,并且没有添加消息头中所需的行。

However this does not work and the needed line in the message header is not being added.

推荐答案

从以下网站获得答案:

http://www.inpc.de/blog/2007/05/axis2 -12-basic-authentication.html

显然我失踪了:

basicAuth.setPreemptiveAuthentication(true);

这篇关于如何使用Axis2 ADB客户端进行基本身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆