从 asp.net 访问 Domino 服务器
我选择了这个项目,它使用 XML 访问 domino 服务器并将数据返回到 asp.net 页面。我对多米诺一无所知。
它失败的代码是
objRequest.Credentials = new NetworkCredential(NSGlobal.User, NSGlobal.Password, NSGlobal.Domain);
objRequest.PreAuthenticate=true;
objRequest.Timeout = 1200000;
objResponse = objRequest.GetResponse();
它在最后一行失败并转到 catch 块。捕获错误是“远程服务器返回错误:(401) 未经授权。”
我已验证用户、密码和域有效。我很困惑。请帮忙。
I picked up this project which used XML to access a domino server and returns data to a asp.net page. I know nothing about Domino.
The code that it is failing on is
objRequest.Credentials = new NetworkCredential(NSGlobal.User, NSGlobal.Password, NSGlobal.Domain);
objRequest.PreAuthenticate=true;
objRequest.Timeout = 1200000;
objResponse = objRequest.GetResponse();
It fails on the last line and goes to the catch block. The catch error is "The remote server returned an error: (401) Unauthorized."
I have validated that the user, password and domain are valid. I am stumped. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 Domino API 不太了解,并且看到您的代码似乎基本没问题,所以我会尝试一下 objRequest 的属性,看看是否有任何重要的内容尚未设置。
另请参阅这个问题:使用 ibm Lotus 发送电子邮件 C# smtpclient 尤其是回答他解释说有时设置属性的顺序确实很重要!
这也可能有帮助: http://www.codeproject.com/KB/cs/lotusnoteintegrator .aspx
not knowing much about the Domino APIs and seeing that your code seems to be mostly ok, I would play around with the properties of the objRequest to see if anything important has not been set yet.
see also this question: send email C# smtpclient using ibm lotus especially the answer where he explains that sometimes the order in which properties are set does matter!
this might also help: http://www.codeproject.com/KB/cs/lotusnoteintegrator.aspx
这已经解决了。我将 web.config 替换为更新的 web.config。我不确定为什么会出现这种差异,但我很高兴它现在可以工作了。
This has been solved. I replaced the web.config with a more recent one. I'm not sure why the difference, but I'm happy it is now working.