Compact Framework\Web Service and Basic Auth
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:
Dim TestSvc As New WebTest.ManagementFunctions
TestSvc.PreAuthenticate = True
Dim NewCreds As New NetworkCredential("user", "pass")
Dim NewCache As New CredentialCache
NewCache.Add(New Uri(TestSvc.Url), "Basic", NewCreds)
TestSvc.Credentials = NewCache
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:
Public WiseSvc As New WiSEService.ManagementFunctions
WiseSvc.PreAuthenticate = True
Dim objCredential As New System.Net.NetworkCredential
objCredential = New NetworkCredential("user", "pass")
WiseSvc.Credentials = objCredential
MessageBox.Show(WiseSvc.GetPhysMem("server"))
Any help would be GREATLY appreciated!