Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2005

Tip: Looking for answers? Try searching our database.

Web Service HTTP 401: Access Denied Problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Palau - 23 Sep 2005 22:14 GMT
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
RedmondScorpio - 07 Oct 2005 09:20 GMT
Hi,

We had the same problem.  After setting PreAuthenticate=false, we wer
able to call web service methods without any issues.

By doing so, every request to the web service reauthenticates.

Hope that helps.

Mik

--
RedmondScorpi
David Palau - 11 Oct 2005 16:31 GMT
Yes, that was the problem.  Thanks for your suggestion.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.