ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

You may receive the error "The request failed with HTTP status 401: Access Denied." when trying to access a Webservice from your ASP.NET Application.

This normally indicates that Anonymous access has been disabled for the Webservice.

Also, when you try to step into the webservice using the Visual Studio debugger, "Unable to automatically step into the server. The remote procedure could not be debugged. This usually indicates that debugging has not been enabled on the server. See help for more information"
in this scenario.

We can resolve this issue by either of the following ways:

1. Enabling Anonymous Access in the IIS Directory Security

To do this, the following steps will help you.

1. Click "Start" - "Run" - Type "inetmgr" and press "Ok" or "Enter" Key

2. IIS Control panel opens.

3. Expand the appropriate nodes and navigate to the virtual directory of your Web Service Application.

4. Select the Virtual directory, Right Click and select "Properties"

5. Switch to the "Directory Security" Tab and then Click "Edit".

6. Check the "Anonymous Access" CheckBox.

7. Click "Ok" twice to exit.

This should solve the issue.

2. Programattically assigning the Credential Cache

In case you dont have access to change the IIS Settings or you just dont want to allow anonymous because other applications are using it, then you can programatically provide the permissions by specifying the credential cache.

Let us assume we have a Webservice, Service which has the default Web Method HelloWorld. Let us see the steps involved in accessing the service.

Service Service1 = new Service();
Service1.PreAuthenticate = true;
Service1.Credentials = System.Net.CredentialCache.DefaultCredentials;
Response.Write(Service1.HelloWorld());


As you can see, we are passing the CredentialCache object for the Service1.

This would ensure that we preauthenticate the access to the Service. This would be applicable in the case of Integrated Windows Authentication scenarios.

Cheers and Happy Programming !!!

Print | posted on Tuesday, February 21, 2006 3:14 AM

Comments on this post

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
do as in number 1. and if it still does not work, set the User to ASPNET and password to nothing...worked for me
Left by RonCola on Jul 19, 2006 7:11 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I have a simular problem and would like some feedback.

Regards,
Tony
Left by Tony on Nov 08, 2006 1:11 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks very much, I work with me !
Left by SonNguyen on Nov 25, 2006 1:21 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot. The article was definitely helpful.
Left by Nimish v. Goray on Dec 12, 2006 2:32 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot!!
it did work 4 me...
Left by vijay makam on Dec 13, 2006 1:27 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks for the help. Solve my problem.
Left by Vijay on Jan 30, 2007 4:07 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I get the error even after i do all this. The webservice is deployed in a different server.
Left by Sudha on Jan 30, 2007 7:52 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I get the error even after i do all this.
Left by Muhammad Rashid on Feb 08, 2007 12:44 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I get error when I am trying to access the webservice from another client machine
Left by Sachin on Feb 26, 2007 7:55 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi Friends,

I am also felt this same problem and now its working fine. The Solution is

1. Click Start - Choose Run - Type "Inetmgr" and press Enter Key.
2. The IIS Control Panel window opens.
3. Select your virtual directory and right click - select "Properties"
4. Click the "Directory Security" tab and and click "Edit" Button.
5. Check the "Anonymous Access" Check box is enable or not.
6. If it is not enable click the check box and also click "Edit Button"
in that form.
7. Check the "Allow IIS to control Password" checkbox is enable or
not.
8. If it is also not enable click the check box.
9. Press "OK" button twice to exit.

This problem should be solve...

Regards,
Anish
Left by Anish Kumar on Mar 08, 2007 5:54 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I had this issue, googled and your thread is toppest. The second solution is perfect for me..

Thanks,
Raghu
Left by Raghu on Mar 09, 2007 4:31 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Last solution works
Left by re on Aug 09, 2007 5:01 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thank you for your solution
Left by armagan on Aug 12, 2007 6:11 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot for this querry
Left by prashant on Nov 01, 2007 8:07 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
If the above solutions don't work,try the following steps:

To do this, the following steps will help you.

1. Click "Start" - "Run" - Type "inetmgr" and press "Ok" or "Enter" Key

2. IIS Control panel opens.

3. Expand the appropriate nodes and navigate to the virtual directory of your Web Service Application.

4. Select the Virtual directory, Right Click and select "Properties"

5. Switch to the "Directory Security" Tab and then Click "Edit".

6.Try Checking the integrated windows authentication checkbox.

Left by Kateki Gupta, New Delhi on Jan 15, 2008 9:40 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
if it does not solve ,
add this code to the proxy Credentials

oApp.Credentials = System.Net.CredentialCache.DefaultCredentials
Left by Abhi on Mar 10, 2008 8:41 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
it is very useful for me.thanks for ur help
Left by Gokulsankar on Mar 11, 2008 2:22 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Both the solutions works fine.
Left by Ashok on Mar 16, 2008 6:27 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Both worked for me :).
Thanks for the solution.
Left by jones1977 on Mar 24, 2008 5:47 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks for the solution. First option itself solved my problem. :)
Left by Tulika Gupta on Mar 25, 2008 8:42 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
hi what r the steps for second solution, bcoz i havn't the permission to access the IIS.
plz anyone help to solve using second solution
Left by deepa on Jun 04, 2008 6:55 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Yes, that works
Left by Luis on Jun 11, 2008 3:24 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks, the first option doesn't work in some servers. The second option solved my problem.
Left by Carla on Jul 07, 2008 3:05 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi,
I do not create the proxy classes using the WSDL and VS IDE, I create all of them on fly. And then I try invoking the web-method using Reflection.
// ClassObj = dynamically compiled class from web-ref.
// This works in case i keep anonymous access ON, but I don't want to do that.
object objResult = objMethodInfo.Invoke(ClassObj, args);

Can you tell me how to aviod 401 in this case, or to pass credentials in my case?

Regards,
Vaibhav
Left by Vaibhav Gaikwad on Jul 07, 2008 4:22 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi again,
Pls. don't spare time on my issue.
I found the solution by casting my object type to SoapHttpClientProtocol type, and then setting its credentials property.

Thanks
Vaibhav
Left by Vaibhav Gaikwad on Jul 07, 2008 4:33 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi
I am new to asp.net. I am creating an intranet application which needs the windows loginname. I have unchecked the Anonymous login in inetmgr and in web.config, identity impersonate="true". I got the login name from System.Security.Principal.WindowsIdentity.GetCurrent.Name. It worked fine in my localhost machine. But the problem is that when I am trying to access the site from another machine, it requests for windows login. Then I checked the Anonymous login in inetmgr. At that time the login was not there but the windows login user name is not getting properly. It is showing the anonymous access's username. How can I solve this problem? How can I get the windows login username while accessing the site from another machine?

Please help me..

Thanks in advance.
Cibi Jacob
Left by Cibi Jacob on Jul 08, 2008 2:26 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
good job...it works for me
Left by Rits on Jul 22, 2008 9:33 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Spot on! Especially the part that lets us step into and debug web services when anonymous access is turned off. Thanks a bazillion.

David
Left by anyoneis on Aug 01, 2008 6:51 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
good solution
Left by Prachi on Aug 19, 2008 11:57 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi,
I have applied all the setting sspecified here, But nothing works for me. I have a webservice and an ASP.Net web Application in my local pc. When i try to open the web service in browser, it is working fie. But when i try to call it from ASP.Net Application it is throwing error "The request failed with HTTP status 401: Access Denied". I have admin rights in my system and i have checked the anonimous access check box for the application as well as service. I have the Integrated Windows Authentication check box on. I dont know why i am keep on getting the same error. Even i changed the user name to ASPNET and set the leave the password column as empty. Please help me.
Left by Uday on Aug 20, 2008 1:07 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thank youuu
Left by rüya tabiri on Aug 29, 2008 2:36 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
i need validate my webservice client with the webservice server but the server have the next:
1.-anonymous access is disabled
2.-Basic authentication(password is sent in clear text) ACTIVATED

what i do i need help thank you
Left by Adrian castañeda on Sep 01, 2008 1:45 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot. You are such a life saver :)
Left by Anup on Sep 04, 2008 9:58 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thank you so much.
-Aravinda
Left by Aravinda on Sep 11, 2008 7:57 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
above solution worked,thanks
Left by biswajit on Sep 23, 2008 11:52 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi, I have installed my .net application on a Windows 2003 machine having sharepoint installed
Could Sharepoint be conflicting with the web service of the .net application?I am getting the same error
The request failed with HTTP status 401: Unauthorized.
Left by Reena on Sep 24, 2008 6:28 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Very very good. It works for me
Left by davood on Sep 27, 2008 10:24 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I have an asp.net website which consumes the web service via a class library project. I followed the above mentioned steps. Still I am getting the same error message. Please help me.
Left by Kris on Oct 06, 2008 7:51 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi,

I'm gettin general network error in application.
It is occuring sometimes in application and gets resolved automatically.

Please someone help me.
Left by rahu on Oct 07, 2008 10:34 AM

# General network error in asp.net application

Requesting Gravatar...
Hi,

I'm gettin general network error in application.
It is occuring sometimes in application and gets resolved automatically.
Left by rahu on Oct 07, 2008 10:53 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thanks you help me alot be succed
Left by narges on Oct 12, 2008 1:50 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Very good! Great solution :)
Left by Rain on Oct 13, 2008 1:33 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Since the lat batch of windows updates on 11/17 I now get the same error. We roll back the patches and everything works. I use the process you described in step 2 to pass the credentials to my WS and it does not work. Anyone else have the same problem? BTW my app runs on a win2k server box and is asp.net 1.1.

Thanks in advance.
Left by Joe on Nov 22, 2008 4:23 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I have seen many sites before and most of them do not look this good.
Very helpful....
Regards,
SBL
Left by SBL on Nov 29, 2008 5:24 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks :)))))))))

Great, clear answer
Left by ck on Dec 29, 2008 11:42 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thx So Much ^^¡
Left by oscar on Jan 26, 2009 6:28 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Ok, I fought with this for 3 days, but finally got it. Set the directory security to ASPNet, allow IIS to control the password. Then go to the ASP.NET tab, click Edit Configuration and go to the Authentication tab. At the bottom check the Role Management Enabled and select ASPNetSQLProvider from the Role Provider Class. That fixed it for me.
Left by TekNik on Feb 06, 2009 7:17 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
In my case, I had to give proper permissions to the Internet Guest Account. In IIS Manager right click on the web service node, click on "Permissions" and add the Internet Guest Account. Hope that helps anybody.
Left by TribunMax on Feb 10, 2009 7:48 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thanks alot , it work with me .
Left by Phi on Feb 25, 2009 8:26 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thank u very much for ur clear explanation
Left by Sarvesh on Mar 21, 2009 2:39 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks for the help. Solve my problem.
Left by Pavel on Apr 09, 2009 6:17 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thanx a lot...
Left by irfan saputra on Apr 14, 2009 1:04 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks alot dude... :)
Left by Suresh on Jun 17, 2009 5:10 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
excelent! the second solution work for me! :)

thanks
Left by jesusldb on Jul 01, 2009 10:00 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks for the help. Solve my problem.
excelent! the second solution work for me! :)
Left by web tasarımı on Jul 27, 2009 5:13 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot. Solved my issue by method #2.
Left by S.Arunkumar on Jul 30, 2009 12:47 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks. 2nd one worked for me.great.
Left by Hira on Aug 04, 2009 1:31 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I have tried every solution you guys provided without much luck.

I am trying to access Project Server 2007 services using PSI. Added web reference, set Credentials to DefaultCredentials and followed the above stated steps. Yet, I keep getting the 401 Unauthorized error.

Please HELP !!!
Left by Manny on Aug 10, 2009 11:20 PM

# ASP.NET Webservices: "The request failed with HTTP status 401: Unauthorized." Error

Requesting Gravatar...
Hi,

I'm getting the same error as above, but I have anonymous access enabled. The web service I'm trying to access is located on a different server to the web application that's calling it.

I've installed the web service on the same machine as the web app, and it runs fine. But as soon as I alter the web app to call the web service on a different server, I get the 'unauthorized' error message.

Are there any permissions/settings that I need to check? Any other ideas?

Thanks a lot! :)
Left by Dom on Aug 21, 2009 3:50 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot! :)
Left by rana omair on Aug 27, 2009 2:36 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks, its solve my problem.
Left by mamun on Sep 14, 2009 7:23 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
The second solution worked for me perfeectly!!
Left by Programmer on Sep 16, 2009 3:35 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I tried ASPNET user and it worked for me...
Left by Niks on Sep 21, 2009 11:06 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot !! The second solution worked like a charm :)
Left by Priyanka on Sep 24, 2009 5:46 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi all,
I tried each and every of the option listed above but still am not able to solve the problem. Am not able to hit any web services from my application. Plz some one let me know the reason for it.
Left by Marimuthu.R on Sep 30, 2009 12:07 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hey, that was interesting, the aspnet user most deffinately worked for me! Fantastic.



Anyway, thanks for the post
Left by Web developer on Oct 01, 2009 3:35 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
After tring, Service Service1 = new Service();
Service1.PreAuthenticate = true;
Service1.Credentials = System.Net.CredentialCache.DefaultCredentials;

I get {"Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown."}.
Left by Ritesh on Oct 08, 2009 7:25 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I am calling an secure java web service from asp.net client , I am sending the user name and pwd from code

Protected Overrides Function GetWebRequest(ByVal uri As System.Uri) As System.Net.WebRequest
Dim webRqest As System.Net.WebRequest
Dim crd As System.Net.ICredentials
Dim netCredential As System.Net.NetworkCredential


webRqest = MyBase.GetWebRequest(uri)
netCredential = New System.Net.NetworkCredential("AxisUser", "AxisPassword")
crd = netCredential.GetCredential(uri, "Basic")
webRqest.Credentials = crd
webRqest.PreAuthenticate = True
GetWebRequest = webRqest

End Function
Left by Shiva on Oct 14, 2009 11:43 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Ya this aritcle is very much helpfull for all beginners

thanks guys
Left by M Sri on Oct 15, 2009 6:14 PM

# Mr

Requesting Gravatar...
hi

thanks for the listing the steps to solve the problem easily

Left by Raj on Oct 19, 2009 11:45 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
hi, thanks a lot...i spent nearly 3 days to get it done..finally the adding of aspnet user and providing permissions worked, hurrah!!!
Left by vinarja on Nov 24, 2009 1:54 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot for your help.

I am strugling with this issue from the last 2 days.
Just because of your blog; my problem resolved.

Thanks for your help.

Regards
Sid
Left by Sudhanshu Bhatnagar on Dec 16, 2009 3:12 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thank you
this statement help me to solved problem

Service1.PreAuthenticate = true;
Service1.Credentials = System.Net.CredentialCache.DefaultCredentials;
Left by KenG on Dec 27, 2009 10:00 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks you for the second aswer.
Muchas Gracias por la segunda opcion, gracias, gracias, gracias.
Left by Elder Nicolás Soto Sánchez on Feb 11, 2010 1:22 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
hi all, i have an application which needs windows integrated login facility as well as webservice need to be used. while inactivate the "Anonymous Access" its working fine for Automatic login the user but webservice throws error as "The request failed with HTTP status 401: Access Denied". please help me out for this issue, which has to be fix as soon as possible. Thanks in advance.
Left by Bell @Sierra on Mar 11, 2010 5:41 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi all,
I have the tried all the possible things. My app needs Windows authentication and it calls webservice. it throws me the "401: acesss denied " error and gets disappear once I refresh the page. It happens frequently. Please help me out.

Thanks in advance.
Left by Ritu R on Mar 16, 2010 3:36 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi all,
Try using these lines before calling any WeService Method

thank you
this statement help me to solved problem

Service1.PreAuthenticate = true;
Service1.Credentials = System.Net.CredentialCache.DefaultCredentials;

Left by Hameed on Apr 03, 2010 8:32 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I'm having the same problem. What should I do to fix this problem is.??
Left by vps server on May 17, 2010 10:25 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks you for the second aswer.
Muchas Gracias por la segunda opcion, gracias, gracias, gracias.
Left by young porn movies on May 25, 2010 6:20 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
meksika biber hapı
Left by meksika biberi zayiflama hapi on May 31, 2010 11:45 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
The 2nd soultion is fine for ASP .NET, but if you are using a proxy of a webservice in classic asp then the solution given by Ron cola is perfect. I was struggling for this from past two days.

by Ron Cola.

"do as in number 1. and if it still does not work, set the User to ASPNET and password to nothing...worked for me "
Left by Junaid Ameen on Jun 01, 2010 3:28 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Second solution is perfect!
Left by Ramya on Jun 15, 2010 7:04 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
it worked like charm..... thanks for ur solution.
Left by Murali on Jul 11, 2010 7:48 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
thanks for ur solution
Left by Hari on Aug 18, 2010 8:00 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi, Thanks a lot it worked for me(Approach 1)
Left by Pankaj Bahuguna on Aug 23, 2010 10:12 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
please, Descripton show image
thanks !
Left by TuanTH on Aug 31, 2010 1:35 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi All,

I'm getting the same error as above, but I have anonymous access enabled. I have one server that it is working and other that it is not, both with Windows 2003 Server.

I have tested one by one suggestion without success. This server worked for several time but now and I do not know why stopped to work. Both servers have a similar installation and have an equal site configuration.

What could be?

Thanks a lot! :)
Left by Rui Oliveira on Nov 02, 2010 10:27 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Great, thanks this helped me a lot.
Left by Abhishek on Dec 15, 2010 9:45 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Hi, Thanks for you answer. can you give an example for connecting using Syste.Net.NetworkCredential instead of using DefaultCredentials.
Left by Uday on Dec 24, 2010 2:46 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks a lot,
Setting Default credentials and enabling ASPNET roles in ASPNET tab worked for me.
Left by Rudra on Feb 23, 2011 8:59 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
You're a blessing.

It worked like a charm
Left by Okuboyejo Damilola on Apr 09, 2011 5:37 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
It was useful. For me works the following:
Annonimous access [Checked]
Username: ASPNET user
Allow IIS to control Password [Checked]
Integrated Windows Authentication [Disabled)
Thanks!!
Left by Nora Milisa on Apr 27, 2011 5:08 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
It was useful. For me works the following:
Annonimous access [Checked]
download priest
download pirates of the caribbean: on stranger tides
Left by Sirto on Apr 29, 2011 9:21 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
My app needs Windows authentication and it calls webservice. it throws me the "401: acesss denied " error and gets disappear once I refresh the page. It happens frequently.
Left by torrent files on May 06, 2011 5:08 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Great, thanks this helped me a lot.
Regards
Left by vps sunucu on May 11, 2011 3:37 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks you for the second aswer....
Muchas Gracias por la segunda opcion, gracias, gracias, gracias....
Left by free torrents download on May 16, 2011 2:52 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Good article and useful
Left by Pat on Jun 24, 2011 11:23 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thank you for the resolution. It did really help.
Left by How Do I Insulate Gable Wall on Jul 08, 2011 12:02 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thanks for all the suggestion guys
(^-^)
Best Regards

affiliate marketing
Left by Angel Lin Jones on Jul 17, 2011 1:22 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Cool
Thx
Left by cloud on Jul 27, 2011 8:01 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Thx Regards.
Left by vps on Oct 03, 2011 6:51 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
this solution is good
Left by Saba on Nov 14, 2011 2:52 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Great

thanks!!!
Left by squiel on Dec 29, 2011 11:30 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
You have created a very nice article. Thanks
Best Regards.
Left by vps on Jun 08, 2012 7:09 PM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
Saved my time, good on you:)
Left by TheDotNet on Sep 20, 2012 11:16 AM

# re: ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error

Requesting Gravatar...
I am new to asp.net. I am creating an intranet application which needs the windows loginname. I got the login name from System.Net.CredentialCache.DefaultNetworkCredentials. It worked fine in my localhost machine. But the problem is that when I am trying to access the site from Development server it is showing the error "The request failed with HTTP status 401: Access Denied" but the same code is working fine in Test Site. i am using windows Integrated authentication and Anonymous access disabled...Please help me to figure out this issue...
Left by Prasy on Jan 07, 2013 9:53 PM

Your comment:

 (will show your gravatar)