Web Service + Anon Access, but getting 401 Access Denied Error

  • Thread starter Alex Washtell via .NET 247
  • Start date
A

Alex Washtell via .NET 247

I have a simple webservice that just returns a string. The security for this is set to windows authentication in IIS (XP Professional) and anonymous access is also turned on.

When I access the webservice from IE there is no problem, it returns the string fine. However, when I create a simple console application to use this service and output the string, I get a 401 Access Denied error.

I have tried the method of setting the default credentials, but this isn't suitable (I can explain why but is not relevant), and the key issue here is that anonymos access IS enabled, so I shouldn't have to set the credentials anyway, surely?

This was working fine until I came back to it after a couple of weeks, and I am unsure what I could have changed in my settings in Windows. As far as I can see this appears to be an IIS problem, rather than an application one.

Any help is greatly appreciated, thanks,

Alex
 
M

Mauro Ottaviani [MSFT]

The 401 you're getting is probably due to the fact that the anonymous user
does not have access to the resource. Check the file ACLs and make sure that
IUSR_%computername% has access to it.

IE is probably performing the authentication using default credentials in
this case (you can check the IIS logs to verify that it starts by sending a
401).
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top