【发布时间】:2014-09-23 17:48:18
【问题描述】:
尝试了我发现的所有内容,并在 EWS 服务上使用 AutodiscoverUrl 调用不断收到此错误。
已尝试提供 webcredentials、networkcredentials,但没有。 如果我自己设置 service.Url 属性,那么它可以工作。我可以访问 EWS 呼叫没有问题。
这是出错时的调用堆栈。
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'Microsoft.Exchange.WebServices.Dns.DnsException' occurred in Microsoft.Exchange.WebServices.dll
A first chance exception of type 'Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException' occurred in Microsoft.Exchange.WebServices.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'Microsoft.Exchange.WebServices.Dns.DnsException' occurred in Microsoft.Exchange.WebServices.dll
A first chance exception of type 'Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException' occurred in Microsoft.Exchange.WebServices.dll
An unhandled exception of type 'Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException' occurred in Microsoft.Exchange.WebServices.dll
Additional information: The Autodiscover service couldn't be located.
我还检查了我可以通过 dns 条目自动发现 ping Exchange 服务器。我已经检查了 SCP 的广告,它看起来没问题。 Outlook 可以发现自动发现没有问题。只有我的代码不能。
以防万一,我的所有机器都是虚拟子网上的 Azure vm。
我的代码:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
service.AutodiscoverUrl("Lyynx@ocean.lythixdesigns.com"); // Exception is thrown here
【问题讨论】:
-
您可以尝试的两件事是首先启用跟踪,这将提供更多信息,然后是堆栈跟踪。另一件事是使用 testconnectivity.microsoft.com 测试您的自动发现配置
-
我启用了跟踪,它甚至不调用跟踪器。我通过使用工作代码跟踪它来验证跟踪器是否正常工作。我查看了您共享的测试页面,但我需要弄清楚如何让它在 Internet 上运行,对吗?还是该页面在 Intranet 上工作?会再看一遍
-
不,这在 Intranet 上不起作用,您必须将自动发现暴露在外部,这对于大多数人来说通常是这种情况(否则 Activesync 等将不起作用)。另一个测试是尝试ewseditor.codeplex.com,这将允许您在代码之外测试托管 API 和 EWS。
-
方便的工具。我下载了它并在我的开发虚拟机上运行。 InternalEwsUrl:mantaray.ocean.lythixdesigns.com/EWS/Exchange.asmx 这是我输入的有效网址。
-
您尝试过自动发现查看器吗? (从“工具”菜单中)这将向您显示自动发现过程的更多调试版本
标签: exchangewebservices exchange-server-2013