blog community

Welcome to blog community Sign in | Join | Help
in Search

Marcel de Vries, MVP Team System

.NET Technologies, Architecture and Web Development

ASP.NET 2.0 Receiving 401: unauthorized on local webs service call from website

At this moment I am teaching a class on team system. This is a three day training where we touch all the aspects of team system. During the course we use a web application that calls a web service to get a list of information. Perhaps you have heard of the sample application I am using, it is called Camino.

I am running this on a single server setup of team system. Because I wanted to try if all works fine on the latest service packs I installed Team System on a Windows 2003 server with SP1 applied. (See my previous posts on fixing other problems with this install)

When I tried to fire up the website I noticed I got an exception when the generated proxy from the web reference is called. I always get the error 401: unauthorized.

After spending several hours and consulting a few colleagues of mine I almost gave up, but then I found this nifty check box that helps you tweak the security settings of the Casini server that is used in visual studio 2005. In the properties of the web service project you will find under the Start Options the NTLM Authentication check box.

The problem is caused by the fact that the casini webserver that serves the requests uses NTLM to validat the user. Generated proxies (e.g. from a webreference) don't use the default credentials of the process to satisfy the NTLM handshake. The way to fix this is to set the property UseDefaultCredentials=true;. This makes the proxy using the credentials of the process. You can also turn the NTLM check box of, that will work as well.

Published Monday, May 02, 2005 9:17 PM by marcelv

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Michael Shorten said:

Thanks for the link to this article from Microsoft forums. It worked, but I did find a further issue - this still breaks if you are running VS05 under a user context from "runas".
May 16, 2005 8:30 PM
 

TrackBack said:

Marcel de Vries writes in his blog about the above mentioned 401 bug on http://blogs.infosupport.com/marcelv/archive/2005/05/02/220.aspx....
August 9, 2005 7:53 PM
 

TrackBack said:

One of the neat new features of ASP.NET 2.0 is the ability to develop web sites that exist simply as...
September 2, 2005 3:18 AM
 

B said:

Thanks man I owe you one.

March 23, 2007 5:19 PM
 

oyun said:

Thanks man I owe you one. :))

November 29, 2007 8:05 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems