title: 401 - Unauthorized: Access is denied due to invalid credentials
body: <p>I am trying to consume a third party service like this:</p>
  
  <pre><code> var context = new DataSource(new Uri("http://api.olr.com/Service.svc"));
  
   context.Credentials = new NetworkCredential("username", "password", "http://api.olr.com/Service.svc");
  
  
   var agents = from a in context.Agents
                       select a;
  
   tbResponse.Text = agents.FirstOrDefault().ToString();
  </code></pre>
  
  <p>but getting reponse:</p>
  
  <pre><code>&lt;div class="content-container"&gt;&lt;fieldset&gt;
   &lt;h2&gt;401 - Unauthorized: Access is denied due to invalid credentials.&lt;/h2&gt;
   &lt;h3&gt;You do not have permission to view this directory or page using the credentials that you supplied.&lt;/h3&gt;
  &lt;/fieldset&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried to access the service using browser and it is working. </p>
  
  <p>third parameter to following line is domain. what to put in domain ? the Service url as i did ?</p>
  
  <pre><code>context.Credentials = new NetworkCredential("username", "password", "http://api.olr.com/Service.svc");
  </code></pre>