【问题标题】:SSRS Report Viewer: request failed with HTTP status 401SSRS 报告查看器:请求失败,HTTP 状态为 401
【发布时间】:2013-01-29 16:26:54
【问题描述】:

我花了很多时间试图解决这个问题,但没有运气 - 所以我会尝试在这里发布问题。

我在同一台服务器上运行 2 个 ASP.NET 网站。这两个网站都在 IIS 7.5 + .NET 4 上运行。这些网站使用 SSRS 报告查看器来显示来自另一台服务器的报告。

我们最近将网站和 RS 都移到了新服务器上(从 RS 2005 切换到 RS 2008 并从 IIS 7.0 切换到 IIS 7.5)。但是,在迁移到新服务器后,其中一个网站无法查看报告服务,因为我们收到以下错误:

request failed with HTTP status 401

奇怪的是,报告查看器在两个网站中的配置完全相同相同(只是在两者之间复制粘贴)。此外,使用“工作网站”,我们可以查看属于这两个网站的报告 - 而使用另一个网站,我们无法查看任何报告。

两种情况下的授权都是这样的:

凭据:

[Serializable]
public sealed class ReportServerCreditentials : IReportServerCredentials
{
    public WindowsIdentity ImpersonationUser
    {
        get { return null; }
    }

    public ICredentials NetworkCredentials
    {
        get
        {
            string userName = ConfigurationManager.AppSettings["ReportViewerUser"];
            string password = ConfigurationManager.AppSettings["ReportViewerPassword"];
            string domain = ConfigurationManager.AppSettings["ReportViewerDomain"];

            return new NetworkCredential(userName, password, domain);
        }
    }

    public bool GetFormsCredentials(out Cookie authCookie, out string userName, out string password, out string authority)
    {
        authCookie = null;
        userName = null;
        password = null;
        authority = null;

        return false;
    }
}

报告查看器使用情况

public partial class ReportServicesViewer : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string reportingFolder = ConfigurationManager.AppSettings["ReportingFolder"];

            showReport(string.Format("/{0}/{1}", reportingFolder, Request.QueryString["report"]));
        }
    }

    private void showReport(string reportPath)
    {
        RevReport.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServer"]);
        RevReport.ServerReport.ReportServerCredentials = new ReportServerCreditentials();
        RevReport.ServerReport.ReportPath = reportPath;
    }
}

在 aspx 中:

<rsweb:ReportViewer ID="RevReport" runat="server" Height="100%" Width="100%" Font-Names="Verdana" Font-Size="8pt" ProcessingMode="Remote" ZoomMode="Percent" ZoomPercent="100"></rsweb:ReportViewer>

其他意见

有一次,我们尝试使用 Fiddler 监控网站和 RS 之间的流量,但不知何故,这种通信实际上在这种情况下正常工作。

但是,当我稍后尝试此操作时,Fiddler 给出了以下响应:

[Fiddler] The socket connection to <servername> failed. <br />ErrorCode: 10061. <br />No connection could be made because the target machine actively refused it 10.0.0.17:443                                                                                          

我不确定如何准确解释这一点,因为我们没有将 SSL 用于网站 RS 通信。

任何建议将不胜感激。

【问题讨论】:

  • 两台机器的 machine.config 和 web.config 中的配置是否相同?例如,是否都启用了 KeepAlive?
  • 两个网站在同一台服务器上运行。配置文件(或多或少)相同。我明天可以发布差异。还是您指的是新旧服务器?
  • 我想知道你是否解决了这个问题。我看到了类似的东西。
  • @SteveDonie 恐怕它从未解决。我们必须实施一种解决方法,在其中我们为另一个网站构建了框架,它可以在其中工作。抱歉,我无法提供更多帮助。

标签: asp.net .net reporting-services ssrs-2008 reportviewer


【解决方案1】:

我们在构建新的 SSRS 服务器时遇到了类似的问题。 Web 应用程序无法连接到报表服务器。我可以通过以下方式解决问题:

  1. 在服务器上启用 Kerberos 身份验证
  2. 在服务器上设置 spn(服务器主体名称)
  3. 在 Web 应用程序中启用模拟

【讨论】:

    猜你喜欢
    • 2011-04-10
    • 2023-03-18
    • 1970-01-01
    • 2012-11-27
    • 1970-01-01
    • 1970-01-01
    • 2011-03-18
    • 2012-06-30
    相关资源
    最近更新 更多