locked
EWS call sometimes returns "401 - Unauthorized". RRS feed

  • Question

  • My application periodically calls EWS, and by far most calls are completed with no problems.

    But sometimes they fail.

    I wrote a small test application and basically let it run overnight, calling EWS every two seconds, asking for the server's Exchange version number. In the attached screenshot, you can see the results.

    Source (stripped down version):

    ExchangeService m_service;
    m_service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
    m_service.UseDefaultCredentials = true;
    String m_myEmailAddress = "<my@email.com>";
    m_service.AutodiscoverUrl(m_myEmailAddress);
    String m_version = m_service.ServerInfo.VersionString;

    Any ideas?

    Thanks,
    Jeppe


    -Jeppe

    Wednesday, August 29, 2018 7:05 AM

All replies

  • I have had issues like these before. on several occasions.

    Somethimes they had to do with the firewalls in between and other times it had to do with the authentication method itself (kerberos tickets).

    If you really want an extensive awnsers it is best to describe your exchange topology, how you connect, what IIS authentication settings you use, etc.

    that way we can get more indept in resolving the issue at hand.

    Monday, September 24, 2018 11:27 AM