Software Development Network>> .NET Development>> The request failed with HTTP status 401: Access Denied. error when accessing .net webservice
Looks like you have authentication turned on at the server and your client is not passing the right credentials.
You are getting this error because your web service needs Authentication and you are not providing the same when you access the web service.
The Two solutions for the above problem is
C#
Service1.PreAuthenticate =
Service1.Credentials = System.Net.CredentialCache.DefaultCredentials;
VB.Net
webService.PreAuthenticate =
webService.Credentials = System.Net.CredentialCache.DefaultCredentials
This should reslove your problem.
The request failed with HTTP status 401: Access Denied. error when accessing .net webservice
JeanL
Looks like you have authentication turned on at the server and your client is not passing the right credentials.
cka11
You are getting this error because your web service needs Authentication and you are not providing the same when you access the web service.
The Two solutions for the above problem is
C#
Service1.PreAuthenticate =
true;Service1.Credentials = System.Net.CredentialCache.DefaultCredentials;
VB.Net
webService.PreAuthenticate =
TruewebService.Credentials = System.Net.CredentialCache.DefaultCredentials
This should reslove your problem.