title: Reporting Services 2008 - 401: Unauthorized
body: <p>I've an application that connects to Reporting Services in SQL Server 2008 R2.  </p>
  
  <p><strong>The error is the following:</strong></p>
  
  <pre><code>System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
  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 Microsoft.SqlServer.ReportingServices2005.Execution.ReportExecutionService.LoadReport
     (String Report, String HistoryID) 
  </code></pre>
  
  <p><strong>The application is running in production fine in 2 different customers</strong>, so it's not a codeing issue.</p>
  
  <p>I'm trying to install it now on a customer's server, which is using AD.  The SQL Server and the IIS is all in the same machine though, so I don't really care about AD.</p>
  
  <p>It runs if I run IE as Administrator, but it doesn't work with other users.  The ASP.NET app is connecting to SSRS using a user created in the local machine (called <em>ReportingServicesUser</em>), member of the ReportingServicesUser group.</p>
  
  <p><strong>Things I've tried:</strong></p>
  
  <ul>
  <li>Adding <em>ReportingServicesUser</em> to the Site Settings in the RS website (did the same for Network Service, IUSR, the Authenticated Users group, Local Service, etc)</li>
  <li>Adding <em>ReportingServicesUser</em> to the folder permissions in the RS website (did the same for Network Service, IUSR, the Authenticated Users group, Local Service, etc)</li>
  <li>Added permissions for that users to the databases (app database and RS related dbs)</li>
  <li>Added NTFS permissions to the RS folders (I will double check though).</li>
  <li>Connecting to the RS using <code>http://localhost</code>, <code>http://computername</code> and <code>http://domain.com</code></li>
  </ul>
  
  <p>For reference, the code is this (simplified version):</p>
  
  <pre><code>var service = new ReportExecutionService();
  service.Credentials = new NetworkCredential("ReportingServicesUser", "password");
  service.Url = "http://computername:90/ReportServer/ReportExecution2005.asmx";
  
  service.ExecutionHeaderValue = new ExecutionHeader();
  
  var execInfo = new ExecutionInfo();
  execInfo = service.LoadReport("path-to-the-report", null);
  ===&gt;  Here it throws the exception
  </code></pre>
  
  <p>I've read a lot of posts and pages about this but I cannot get an answer that works for me.</p>