0
甚至可能吗?文件没有说清楚。我尝试了各种不同的机制来获得身份验证的工作,但我不断得到一个“401:未经授权”的错误。这里是我在哪里:Axis2甚至可以使用BASIC认证
stub = new EngineStub();
HttpClient client = new HttpClient();
client.getParams().setAuthenticationPreemptive(true);
stub._getServiceClient().getServiceContext().getConfigurationContext().setProperty(HTTPConstants.CACHED_HTTP_CLIENT, client);
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
List<String> authpref = new ArrayList<String>();
authpref.add(AuthPolicy.BASIC);
auth.setAuthSchemes(authpref);
auth.setUsername(username);
auth.setPassword(password);
auth.setPreemptiveAuthentication(true);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE, auth);
看一看这样的: http://stackoverflow.com/questions/3283234/http-basic-authentication-in-java-using-httpclient – 2013-03-11 04:09:59
还共享安全如何配置这些网页的细节-服务。 – 2013-03-11 04:11:09
关于此的文档是无用的。整件事情都被打破了。 – Jacob 2013-03-11 05:30:57