在 Microsoft Dynamics 365 中使用服务器端同步时,Http 服务器返回了 404 NotFound 异常

本文提供了解决方法,用于解决尝试在 Microsoft dynamics 365 中测试和启用邮箱时可能发生的错误消息。

适用于: Microsoft Dynamics C5 2016
原始 KB 数: 3214661

现象

在 Microsoft Dynamics 365 中测试和启用邮箱(以前称为 Microsoft Dynamics CRM Online)时,在“警报”区域中遇到以下错误之一:

  • 邮箱 <邮箱名称> 未同步,因为连接到电子邮件服务器时出错。 已通知相关电子邮件服务器配置文件<电子邮件服务器配置文件名称>的所有者。
  • 邮箱 <邮箱名称> 未同步约会、联系人和任务,因为连接到 Microsoft Exchange 服务器时出错。 已通知相关电子邮件服务器配置文件<电子邮件服务器配置文件名称>的所有者。
  • 无法发送电子邮件 测试消息 ,因为连接到电子邮件服务器时出错。 邮箱 <邮箱名称> 无法同步。 已通知相关电子邮件服务器配置文件<电子邮件服务器配置文件名称>的所有者。

上述每个错误还包括以下错误代码:

电子邮件服务器错误代码:Http 服务器返回 404 NotFound 异常。

原因

存在以下任一原因时,可能出现此错误:

  1. 找不到用户的邮箱,因为电子邮件地址不正确或邮箱当前不可用。
  2. 未正确配置关联的电子邮件服务器配置文件,因此无法找到邮箱。

决议

若要解决此问题,请使用以下步骤:

  1. 验证 Microsoft Dynamics 365 中邮箱记录的电子邮件地址是否与 Exchange 中的电子邮件地址匹配。 此错误包括指向 Microsoft Dynamics 365 中的邮箱记录的链接。 可以使用此链接快速验证 电子邮件地址 字段。 如果电子邮件地址正确,请使用电子邮件应用程序(如Microsoft Outlook 或 Outlook Web Access)来验证邮箱是否可用。
  2. 验证关联的电子邮件服务器配置文件的配置。 如果将 Microsoft Dynamics 365(联机)与本地 Exchange 配合使用,请确保使用的是 Exchange Server(混合)电子邮件服务器配置文件。 仅在用户的邮箱位于 Exchange Online 时使用 Exchange Online 配置文件。

详细信息

选择“查看详细信息时,会看到如下所示的错误详细信息:

ActivityId: <GUID>
错误:System.Net.WebException:请求失败,HTTP 状态为 404:找不到。
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.EndInvoke(IAsyncResult asyncResult)
at Microsoft.Crm.Async.EmailConnector.ExchangeServiceBinding.EndFindItem(IAsyncResult asyncResult)
at Microsoft.Crm.Asynchronous.EmailConnector.FindItemsStep.EndCall()
at Microsoft.Crm.Sync.EmailConnector.ExchangeIncomingEmailProviderStep.EndOperation()

ActivityId: <GUID>
错误:System.Net.WebException:请求失败,HTTP 状态为 404:找不到。
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.EndInvoke(IAsyncResult asyncResult)
at Microsoft.Crm.Sync.EmailConnector.ExchangeServiceBinding.EndCreateItem(IAsyncResult asyncResult)
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeOutgoingEmailProvider.EndCreateItem()

T:593
ActivityId: <GUID>
异常:未经处理的异常:Microsoft.Exchange.WebServices.Data.ServiceRequestException:请求失败。 远程服务器返回错误:(404) 找不到。
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.EndGetEwsHttpWebResponse(IEwsHttpWebRequest request, IAsyncResult asyncResult)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.EndInternalExecute(IAsyncResult asyncResult)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest'1.EndExecute(IAsyncResult asyncResult)
at Microsoft.Exchange.WebServices.Data.ExchangeService.EndSyncFolderHierarchy(IAsyncResult asyncResult)
在 Microsoft.Crm.Asynchronous.EmailConnector.MonitoredExchangeService.EndSyncFolderHierarchy(IAsyncResult asyncResult)
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncSteps.ExchangeSyncAsyncRemoteStep`2.AfterCall()
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncSteps.ExchangeSyncAsyncRemoteStep`2.E...