Conneting to EWS using default windows credentials 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 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

    Sunday, May 26, 2013 3:55 PM

All replies