ASP.NET App deployed on IIS Server unable to connect to Exchange web services 2007 - 401 unauthorized RRS feed

  • Question

  • 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. 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

    Thursday, May 23, 2013 11:05 AM