I have a ASP.NET application (.NET framework 3.5) which is deployed on IIS Server 5.1 trying to connect to Exchange web service 2007 using DefaultNetworkCredentials giving 401 unauthorized. I have set up windows auth in IIS and gave identity impersonate = true in web config
This is my code
service = new ExchangeService(ExchangeVersion.Exchange2010_SP1); service.UseDefaultCredentials = true;
service.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
service.Url = new Uri("https://xxxxxxxxx/EWS/Exchange.asmx");
I am getting 401 unauthorized, It is connecting if I hard code the userid, password and domain
Please help how to resolve this issue
Did anyone try to connect to Exchange Web Service using default credentials