C# – “HTTP status 401: Access Denied” error for web service even when the virtual directory allows Anonymous access

asp.netciisnetweb services

i have a web service hosted on another server with the Anonymous Access CheckBox in IIS is already checked. when my local web application is trying to access the web service, i still get the "The request failed with HTTP status 401: Access Denied." error. my web application is calling the web
service like the following:

MyObject.WebService ws = new MyObject.WebService ();
ws.Retrieve(someParams);

what am i missing here?

Best Answer

Here is a good reference on diagnosing 401 errors.

From that, one place to start is looking at the credentials you configure for the anonymous user. If they are incorrect (if perhaps the user password was changed elsewhere) you will get an HTTP 401.