Web Service HTTP 401: Access Denied Problems

D

David Palau

We have an internal company WinForms application that makes some calls
out to a intranet web service (once at application start-up for some
configuration info and then periodically during the life of the
application for specific functional requests).


We are getting System.Net.WebException with HTTP 401: Access Denied
errors periodically when we are attempting some functional web service
calls. However, immediately trying the web service call again works as
expected.


I hesitate to call it random since it seems these errors occur only
after periods of inactivity, which lead me to believe we are seeing
this only after the IIS worker process gets recycled. Although I am
definitely not sure of that. Microsoft seems to have a KB article
about this (902160):

http://support.microsoft.com/default.aspx?scid=kb;en-us;902160

I really don't want to change the recycle period if I can help it and
would rather determine if there is another way around the problem (if
this is really the culprit even).

We receive these errors running against both IIS 5.1 (development
machine) and IIS 6.0.

The details:

WinForm Client

- .Net 1.1 SP 1, VB.Net
- Client web service call code:

service = New MyService
service.Credentials = System.Net.CredentialCache.DefaultCredentials
service.PreAuthenticate = True

service.DoSomething


IIS 5.1/6.0

- Anonymous Access On
- Integrated Windows Authentication On
- Defaults for all time-outs for session, scripts, worker processes,
etc.


Web Service

- .Net 1.1 SP 1, VB.Net
- Web.config: deny anonymous users, Windows authentication mode


Do our IIS and web.config file settings make sense? Is the
PreAuthenticate property an issue (does it even do anything)?


Also confusing is the fact that after the initial error, attempting the
same call will work.


Does any one have any answers or leads? Thanks in advance for any
help.


-David
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top