I have a VB.NET Compact Framework application that talks to a VB.NET web service locked down with Basic authentication. Does anyone know how to pass Basic credentials to the web service so that I can authenticate via my pocket PC?

Unfortunately the CredentialCache class is not available in the compact framework which appears to be my problem, but from the reading I have done it should be possible.

Created a VB.NET desktop application that connects to my web service without any problem using this code:

VB Code:
  1. Dim TestSvc As New WebTest.ManagementFunctions
  2. TestSvc.PreAuthenticate = True
  3. Dim NewCreds As New NetworkCredential("user", "pass")
  4. Dim NewCache As New CredentialCache
  5. NewCache.Add(New Uri(TestSvc.Url), "Basic", NewCreds)
  6. TestSvc.Credentials = NewCache
  7. ListBox1.Items.Add(TestSvc.GetPhysMem("server"))

This proves that there is not a problem with my web service. Here is the code I was attempting from my pocket pc:

VB Code:
  1. Public WiseSvc As New WiSEService.ManagementFunctions
  2.  
  3. WiseSvc.PreAuthenticate = True
  4.  
  5. Dim objCredential As New System.Net.NetworkCredential
  6. objCredential = New NetworkCredential("user", "pass")
  7. WiseSvc.Credentials = objCredential
  8.  
  9. MessageBox.Show(WiseSvc.GetPhysMem("server"))

Any help would be GREATLY appreciated!