ASP.Net 页面调用 Reporting Service Web 服务时收到“401 Unauthorized”错误错误
我编写了一个 ASP.Net,它充当我们公司的报告服务中心。我参考了MSDN,有如下设置:
rs = New ReportingService()
rs.UseDefaultCredentials = True
rs.PreAuthenticate = True
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
并在Visual Studio 2008下测试,工作正常。然而,一旦我将其发布到我的开发 PC (Windows XP) 上的 IIS (5.5) 进行预生产部署测试,并从另一个工作站访问它,就会出现“HTTP 401:未经授权的错误”。 (但它通过本地访问起作用)
我在 Web.config 中有以下几行:
<authentication mode="Windows"/>
<identity impersonate="true"/>
<authorization>
<deny users="?"/>
</authorization>
并且我在 IIS 服务器中具有以下设置:
- 无匿名访问(在目录安全性下)
- 使用集成 Windows 身份验证(在目录安全性下)
请注意建议!
非常感谢。 威廉
I wrote an ASP.Net which acts as our company's hub of reporting services. I reference to the MSDN, having the following settings:
rs = New ReportingService()
rs.UseDefaultCredentials = True
rs.PreAuthenticate = True
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
and testing under the Visual Studio 2008, it works fine. However once I publish it to the IIS (5.5) on my development PC (Windows XP) for pre-production deployment testing, and access it from another workstation, it results at "HTTP 401: Unauthorized error". (But it works by local access)
I have the following lines in the Web.config:
<authentication mode="Windows"/>
<identity impersonate="true"/>
<authorization>
<deny users="?"/>
</authorization>
And I've the following settings in the IIS Server:
- NO Anonymous Access (under Directory Security)
- Use Integrated Windows Authentication (under Directory Security)
Please kindly advise!
Many thanks.
William
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能从未听说过委托,对吧? http://msdn.microsoft.com/en-us/library/ff647404.aspx
使委派工作,然后您可以将凭据传递给报告服务。
You probably never hear of delegation, right? http://msdn.microsoft.com/en-us/library/ff647404.aspx
Make delegation work, and then you can pass the credential to reporting services.