Consuming Web Service via Windows Authentication
- by saravanaram
I am just trying to consuming a web service in remote computer using windows authentication however login credentials are different in local & remote computer.
Code Snippet:
Dim objproxy As New WebReference.Service1
'Create a new instance of CredentialCache.
Dim mycredentialCache As CredentialCache = New CredentialCache()
'Create a new instance of NetworkCredential using the client
Dim credentials As NetworkCredential = New NetworkCredential("username", "pwd","domain")
'Add the NetworkCredential to the CredentialCache.
'mycredentialCache.Add(New Uri(objproxy.Url), "Basic", credentials)
objproxy.Credentials = credentials
It is timing out but when i use
mycredentialCache.Add(New Uri(objproxy.Url), "Basic", credentials)
I get "401 Unauthorized" message,
Please assist.