title: How to send HTTP Auth Credentials with a WCF Service Reference
body: <p>I'm attempting to consume a HTTP Basic Auth Secured PHP WebService using VB.NET. I've so far managed to get 100% perfect integration by adding it as a Web Reference and doing the following:</p>
  
  <pre><code>Dim Credentials = New System.Net.NetworkCredential("username", "password")
  Dim CredentialCache = New System.Net.CredentialCache()
  CredentialCache.Add(New Uri(MyWebService.Url), "Basic", Credentials)
  MyWebService.Credentials = CredentialCache
  MyWebService.PreAuthenticate = True
  </code></pre>
  
  <p>I can also successfully add the webservice as a 'Service Reference' and this also works fine, as long as i turn off all HTTP authentication on the SOAP server.</p>
  
  <p>My problem is that I can't find any documented means of sending basic HTTP Auth Credentials when using Service References as opposed to 'Web References'</p>
  
  <p>Am I right in my understanding that 'Web References' are a legacy method of Web Service consumption?</p>