title: SharePoint : web service permission error
body: <p>I have a sharepoint site, and I am calling a standard sharepoint web service. </p>
  
  <p>I create the web service request like this :</p>
  
  <pre><code>wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx";
  </code></pre>
  
  <p>When I use localhost as hostname it works, but when I use machine name I get an error 401 Unauthorized. </p>
  
  <p>I am setting the credentials like this:</p>
  
  <pre><code>    NetworkCredential NC;
      if (string.IsNullOrEmpty(this.Domain))
      {
          NC = new NetworkCredential(this.Username, this.Password);
      }
      else
      {
          NC = new NetworkCredential(this.Username, this.Password, this.Domain);
      }
  
  
      //Lists
      wsLists.Timeout = -1;
      wsLists.Credentials = NC;
  
      //Dws
      wsDws.Timeout = -1;
      wsDws.Credentials = NC;
  </code></pre>
  
  <p>Any ideas how I can fix this?</p>