title: User auth problem when trying to access to the SQL Server Reporting service's webservice
body: <p>I've a SSRS(2008 standard, not R2), so I'm using ReportExecution2005.asmx and ReportService2005.asmx to run them.</p>
  
  <p>We developed an application which can connect to the SSRS through a webservice. It worked well on our test server, but now I'm trying to configure a new server on a virtual machine, and no way, everytimes the application tries to connect to the SSRS webservice, I get a 401 unautorized.</p>
  
  <p>it's very strange, because if I only put the .asmx url in firefox on the client workstation, it prompts me for username-password, I enter it and I get the wsdl definition, so I think that the access is correct.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    public ReportGateway()
      {
          _rs = new ReportingService2005 { Credentials = new NetworkCredential(ConfigurationManager.AppSettings["ReportGatewayUser"], ConfigurationManager.AppSettings["ReportGatewayPassword"])  };
          _rs.Url = "http://MyMachine:80/ReportServer/ReportService2005.asmx";//?? I saw when I was debugging that it wasn't reading the value in the app.config, but keeping the url of the reference when I created it, so for my test of the moment, I hard-setted it
          _rsExec = new ReportExecution2005.ReportExecutionService { Credentials = new NetworkCredential(ConfigurationManager.AppSettings["ReportGatewayUser"], ConfigurationManager.AppSettings["ReportGatewayPassword"]) };
          _rsExec.Url = "http://MyMachine:80/ReportServer/ReportExecution2005.asmx";//Same
          GenerateReportList();
      }
      [MethodImpl(MethodImplOptions.Synchronized)]
      private void GenerateReportList()
      {
          try
          {
              Dictionary&lt;String, SRSSReport&gt; reports = new Dictionary&lt;String, SRSSReport&gt;();
              foreach (var children in _rs.ListChildren("/", true))
              {
                  if (children.Type == ItemTypeEnum.Report)
                  {
                      SRSSReport report = new SRSSReport {Name = children.Name, Path = children.Path};
                      ReportParameter[] parameters = _rs.GetReportParameters(children.Path, null, false, null, null);
                      foreach (ReportParameter parameter in parameters)
                          report.Parameters.Add(new SRSSReportParameter {Name = parameter.Name, Type = _typeConverstion[parameter.Type]});
                      reports.Add(report.Path, report);
                  }
              }
              lock (_lockObject)
              {
                  _reports = reports;
              }
          }catch(Exception ex)
          {
              _reports = new Dictionary&lt;string, SRSSReport&gt;();
              Logger.Instance.Error("Error when contacting the reporting server", ex);
          }
      }
  </code></pre>
  
  <p>I'm completly desperate for now, I've looked for a solution during days, and I don't know what I can have done wrong.</p>
  
  <p>Do you have an idea/solution/... to help me?</p>
  
  <p>Thank you very much, any help would be really appreciated.</p>