我目前正尝试访问不同服务器(A)上的功能邮箱(Exchange),而不是托管我的应用程序(B)。
出于某种原因,我无法访问功能邮箱,因为它一直让我回复AutodiscoverLocalException
。
string url = "https://cas.mailnp.shared.website/EWS/Exchange.asmx";
ServicePointManager.ServerCertificateValidationCallback = delegate(
Object obj,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors errors ) {
return true;
};
service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Url = new Uri(url);
service.UseDefaultCredentials = true;
service.AutodiscoverUrl("tool@qa.website.com");
当我尝试访问它时,会抛出以下错误:
Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException:The 无法找到自动发现服务 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings [TSettings](String emailAddress,List`1 redirectionEmailAddresses,Int32& currentHop)in \ REDMOND \ EXCHANGE \ BUILD \ E15 \ 15.00.0913.015 \ SOURCES \源\ dev的\ EwsManagedApi \ SRC \ EwsManagedApi \自动发现\ AutodiscoverService.cs:线 626
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetLegacyUserSettings [TSettings](String emailAddress)in \ REDMOND \ EXCHANGE \ BUILD \ E15 \ 15.00.0913.015 \ SOURCES \源\ dev的\ EwsManagedApi \ SRC \ EwsManagedApi \自动发现\ AutodiscoverService.cs:线 409
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings(String emailAddress,List1 requestedSettings)in \ REDMOND \ EXCHANGE \ BUILD \ E15 \ 15.00.0913.015 \ SOURCES \源\ dev的\ EwsManagedApi \ SRC \ EwsManagedApi \自动发现\ AutodiscoverService.cs:线 805
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String userSmtpAddress,UserSettingName [] userSettingNames)in \ REDMOND \ EXCHANGE \ BUILD \ E15 \ 15.00.0913.015 \ SOURCES \源\ dev的\ EwsManagedApi \ SRC \ EwsManagedApi \自动发现\ AutodiscoverService.cs:线 1663
at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAutodiscoverUrl(String emailAddress,ExchangeVersion requestedServerVersion, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)in \ REDMOND \ EXCHANGE \ BUILD \ E15 \ 15.00.0913.015 \ SOURCES \源\ dev的\ EwsManagedApi \ SRC \ EwsManagedApi \核心\ ExchangeService.cs:线 4458
at Microsoft.Exchange.WebServices.Data.ExchangeService.AutodiscoverUrl(String emailAddress,AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)in \ REDMOND \ EXCHANGE \ BUILD \ E15 \ 15.00.0913.015 \ SOURCES \源\ dev的\ EwsManagedApi \ SRC \ EwsManagedApi \核心\ ExchangeService.cs:线 4416
at Website.App.Factory.Helper.ExchangeWebServiceHelper.CreateConnection() 在c:\ Users \ Joris \ Visual中 工作室\项目\ Website.App \厂\辅助\ ExchangeWebServiceHelper.cs:行 39
另外,我还没有尝试过Trace功能,因为我无法启动并运行它。这里的步骤指南非常受欢迎,但如果您还考虑过原始解决方案,我也会喜欢它。