gpt4 book ai didi

c# - Exchange 托管 API 的自动发现问题

转载 作者:行者123 更新时间:2023-11-30 17:57:40 27 4
gpt4 key购买 nike

我在 C# 中使用 Exchange Managed API 访问 Exchange 2010。我在使用 Autodiscoverurl 函数时遇到问题。我尝试了多种不同的方法,但出现了各种不同的错误:

代码:

var service = new ExchangeService(ExchangeVersion.Exchange2010);
service.Autodiscoverurl("email@domain.com", delegate { return true; });

错误:

The Autodiscover service couldn't be located.

代码:

var service = new ExchangeService(ExchangeVersion.Exchange2010);
service.Autodiscoverurl("email@domain.com");

错误:

Autodiscover blocked a potentially insecure redirection to https:// servername /autodiscover/autodiscover.xml. To allow Autodiscover to follow the redirection, use the AutodiscoverUlr(string, AutodiscoverRedirectionUrlValidationCallback) overload.

代码:

var service = new ExchangeService(ExchangeVersion.Exchange2010);
service.Url = new Uri("https://servername/EWS/Exchange.asmx");

错误:

The request failed. The remote server returned an error: (401) Unauthorized.

我尝试了多种提供凭据的方法,结果都与上述相同。

service.UseDefaultCredentials = true;
service.Credentials = CredentialCache.DefaultNetworkCredentials;
etc.

有什么想法吗?

最佳答案

据我了解,自动发现 xml 需要凭据,如果 Basic 不起作用,NTLM 通常更可靠。

关于c# - Exchange 托管 API 的自动发现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13039031/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com