Register  ::  Login

February 06, 2012

Forums
 
Subject: 401 Authorization error trying to access a web service.
Prev Next
You are not authorized to post a reply.

Author Messages
DonUser is Offline
New Member
New Member
Posts:20


05/27/2005 8:16 PM  
Created a webservice on my laptop with Microsoft Visual Studio. Created
a proxy with WSDL. Created an ASP.NET web app that uses the proxy to
access the webservice. Worked fine on the laptop running WinXP Pro and
on my development desktop running Win2k. Installed it on a Win3k server
and every time the it tried to access the web service, I got a 401
authorization error. Verified that IIS and file privileges were set up
the same as on all machines, and experimented for 12 hours before I
finally found the answer. All anonymous access. When creating the web
service proxy, you need to set the following:





MyWebServiceProxy.Credentials =
System.Net.CredentialCache.DefaultCredentials;





The odd thing is that another similar setup was running on the Win3k
server fine the last time I looked. I know that an automatic upgrade
installed a .NET 'upgrade' which may have caused this new behaviour.

You are not authorized to post a reply.
Forums > Programming - Dotnet / Delphi > ASP.NET Tips and Snippets > 401 Authorization error trying to access a web service.