Error 401 when trying to run a report from an ASP.Net Application

  • Hi,

    I'm facing this issue for which I didn't find any working solution. I have SSRS 2005 installed on Windows Server 2003, and an ASP.Net (2.0) application running on another Windows Server 2003.

    Report Manager & Server are correclty configured, I can run the reports from the report manager. But when I launch the report from the web application, I get this error message.

    Exception type: WebException

    Exception message: The request failed with HTTP status 401: Unauthorized.

    Thread information:

    Thread ID: 7

    Thread account name: NT AUTHORITY\NETWORK SERVICE

    Is impersonating: False

    Stack trace: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

    at Ontex.Sales.Gui.ontexserver.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds) in D:\data\Ontex\ID Budget Control\Ontex.Sales.Gui\Web References\ontexserver\Reference.cs:line 1426

    at Ontex.Sales.Gui.Class.Utility.RenderReportAsPdf(String reportPath, ParameterValue[] parameters) in D:\data\Ontex\ID Budget Control\Ontex.Sales.Gui\App_Code\Utility.cs:line 661

    at Ontex.Sales.Gui.modules.BaseReport.RenderReportAsPdf(String reportPath, ParameterValue[] parameters) in D:\data\Ontex\ID Budget Control\Ontex.Sales.Gui\modules\BaseReport.cs:line 29

    at Ontex.Sales.Gui.modules.reports.ProductOverview.ucToolbar_Report(Object sender, EventArgs e) in D:\data\Ontex\ID Budget Control\Ontex.Sales.Gui\modules\reports\ProductOverview.aspx.cs:line 52

    at Ontex.Sales.Gui.Usercontrols.ucToolbar.btnReport_Click(Object sender, ImageClickEventArgs e) in D:\data\Ontex\ID Budget Control\Ontex.Sales.Gui\Usercontrols\ucToolbar.ascx.cs:line 113

    at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)

    at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)

    at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)

    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)

    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)

    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Another thing is that I can actually view the web service code when typing the URL http://testbudget:81/reportserver/reportservice.asmx.

    In IIS, both Reports & ReportServer have Integrated Windows Authentication and no Anonymous access.

    Any idea ?

    Thanks

    Patrick H

  • Are u Passing Network Credentials with the report

    i.e

    ReportServerUserName

    ReportServerPassword

    ReportServerDomain

    try to pass it with

    ReportViewer1.ServerReport.ReportServerCredentials=(Your Creditionals);

  • Yes, I'm sending the credentials :

    ReportingService rs = new ReportingService();

    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply