The request failed with HTTP status 401: Unauthorized.

K

Kevin Burton

I have a web service that has been working before but now I am getting:

The request failed with HTTP status 401: Unauthorized.

This is to the localhost and I am a member of the administrators group for
this machine so I am not sure what is unauthorized nor do I understand how to
find out why I am getting this error (exception). Any ideas?

Thank you.


Kevin Burton
 
B

Bruce Johnson

Does the virtual directory that hosts the web service allow anonymous
access? If not, then you have two choices. Configure the virtual
directory to allow anonymous access. Or assign the
System.Net.Credentials.DefaultCredentials to the Credentials property on
the proxy object that you're using the call the web service.

Hope that helps.

Bruce Johnson [.NET MVP]
http://www.objectsharp.com/blogs/bruce
 
M

Mohamed El Ashmawy

Does the webservice use imperonation?
If not, then the process for it would run under the identity of "ASPNet"
account. (Not your account as administrator).
Does the code of web service use resources (file access, database access,
etc.) on the machine? If it does so, then you need to give ASPNet account
the needed permissions on them (if you are not using impersonation).

Regards
Mohamed El Ashmawy
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top