与 Lotus Connections 交互
我需要从某些 Lotus 连接站点获取数据,例如来自其他站点的用户状态。我尝试通过java与lotus建立连接,例如
> server = "https://" + path + param + "&format=full";
> URL profiles_url = new URL(server);
> // Open the URL: throws exception if not found
> HttpURLConnection profiles_conn = HttpURLConnection)profiles_url.openConnection();
> profiles_conn.connect();
> // Process the Atom feed in the response content
> readResponse(profiles_url.openStream(),args[0]);
但我总是得到响应:HTTP/1.1 401 Unauthorized 请给我任何建议吗?
I need to get the data from some lotus connection site, for example user's status, from the other site. I try to setup a connection with lotus via java, e.g.
> server = "https://" + path + param + "&format=full";
> URL profiles_url = new URL(server);
> // Open the URL: throws exception if not found
> HttpURLConnection profiles_conn = HttpURLConnection)profiles_url.openConnection();
> profiles_conn.connect();
> // Process the Atom feed in the response content
> readResponse(profiles_url.openStream(),args[0]);
But I always get the Response: HTTP/1.1 401 Unauthorized
Please give me any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我这样解决了身份验证问题:
I solved the authentication issue this way:
您没有提及如何进行身份验证,这一点至关重要。正如 401 错误所暗示的那样,Connections 不会将您的请求视为已通过身份验证。您需要一个有效的 Authenticator 实例,但您的代码片段表明您还没有实现这一点,对吗?
(顺便说一句,在使用 Lotus Connections API 时,建议使用 Apache Abdera 项目)。
You don't mention how you're authenticating, which is crucial. As the 401 error implies, Connections isn't treating your request as being authenticated. You need a valid
Authenticator
instance in there, but your code snippet suggests you haven't got that going, correct?(As an aside, the Apache Abdera project is recommended when working with the Lotus Connections API).