title: SharePoint custom web service consumption problems - HTTP 401: Unauthorized
body: <p>I have a custom web service deployed into WSS 3. It has two web methods.</p>
  
  <p>The first one returns the version of the loaded assembly without any invocation of the SharePoint objects.
  The second returns some basic info about the library, something like:</p>
  
  <pre><code>var spLibrary = [find library logic];
  return spLibrary.Name+"@"+spLibrary.Url;
  </code></pre>
  
  <p>In the client app I have something like the following:</p>
  
  <pre><code>var service = new WebService1();
  service.Url = [url];
  service.Credentials = System.Net.CredentialCache.DefaultCredentials;
  
  service.Method1();
  service.Method2();
  </code></pre>
  
  <p>When the client app runs on the machine where SharePoint is deployed, everything works just fine.</p>
  
  <p>When the client app runs on the remote machine (but under the same user) the first method still works, but the second one throws System.Net.WebException: HTTP 401: Unauthorized.</p>
  
  <p>I have tried to set credentials manualy (service.Credentials = new System.Net.NetworkCredential(login, password, domain);) but this doesnt help.</p>
  
  <p>I've tried to invoke the built in SharePoint web services using a similar scenario<strike>, and they work just fine:</strike>
  <strong>Sorry for the mistake... Some methods were not working fine without the appropriate privileges.</strong></p>
  
  <pre><code>var service = new GroupsService(); 
  service.Url = [url]; 
  service.Credentials = System.Net.CredentialCache.DefaultCredentials; 
  
  service.SomeMethod();
  </code></pre>