W
Web Team @ Borough of Poole
Hi All,
I am trying to consume a web service that requires a username/password.
If I go direct to the web service in my browser, I get a password box.
If I enter the username/password I am presented with the usual 'The
following operations are supported.' - All fine!
Now, when I try to use the service in my application, I get the
following error:
"The request failed with HTTP status 401: Access Denied."
My code to use the web service is this:
Dim BS7666 As New bs7666.BS7666
Dim CredCache As New CredentialCache
CredCache.Add(New Uri(BS7666.Url), "Negotiate", New
NetworkCredential("UserName", "PassWord", "ServerName"))
BS7666.Credentials = CredCache
Dim DataSet_bs7666 As New DataSet
DataSet_bs7666 = BS7666.GetAddresses(0, "", strPostCode.ToLower,
BuildingNoOrName.ToLower, "", strStreet.ToLower, 0, 0) <-- This is
where it fails.
I don't get it! Help!
Thanks,
Simon.
I am trying to consume a web service that requires a username/password.
If I go direct to the web service in my browser, I get a password box.
If I enter the username/password I am presented with the usual 'The
following operations are supported.' - All fine!
Now, when I try to use the service in my application, I get the
following error:
"The request failed with HTTP status 401: Access Denied."
My code to use the web service is this:
Dim BS7666 As New bs7666.BS7666
Dim CredCache As New CredentialCache
CredCache.Add(New Uri(BS7666.Url), "Negotiate", New
NetworkCredential("UserName", "PassWord", "ServerName"))
BS7666.Credentials = CredCache
Dim DataSet_bs7666 As New DataSet
DataSet_bs7666 = BS7666.GetAddresses(0, "", strPostCode.ToLower,
BuildingNoOrName.ToLower, "", strStreet.ToLower, 0, 0) <-- This is
where it fails.
I don't get it! Help!
Thanks,
Simon.