简体   繁体   English

Exchange托管API的自动发现问题

[英]Autodiscover Issues with Exchange Managed API

I am using the Exchange Managed API in C# to access Exchange 2010. I am having issues with using the Autodiscoverurl function. 我在C#中使用Exchange托管API来访问Exchange 2010.我在使用Autodiscoverurl函数时遇到问题。 I have tried a number of different methods with various different errors: 我尝试了许多不同的方法,有各种不同的错误:

Code: 码:

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

Error: 错误:

The Autodiscover service couldn't be located. 无法找到自动发现服务。

Code: 码:

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

Error: 错误:

Autodiscover blocked a potentially insecure redirection to https:// servername /autodiscover/autodiscover.xml. 自动发现阻止了可能不安全的重定向到https:// servername /autodiscover/autodiscover.xml。 To allow Autodiscover to follow the redirection, use the AutodiscoverUlr(string, AutodiscoverRedirectionUrlValidationCallback) overload. 要允许自动发现遵循重定向,请使用AutodiscoverUlr(字符串,AutodiscoverRedirectionUrlValidationCallback)重载。

Code: 码:

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

Error: 错误:

The request failed. 请求失败。 The remote server returned an error: (401) Unauthorized. 远程服务器返回错误:(401)未经授权。

I have tried various ways of providing credentials, all with the same results as above. 我尝试了各种提供凭据的方法,所有方法都具有与上述相同的结果。

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

Any ideas? 有任何想法吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM