我正在ASP.NET MVC上开发Exchange Web服务托管API客户端。一切正常,直到我们昨天安装了最新的Exchange CU更新。然后,当我连接到EWS时,我在Web服务器上一段时间后定期得到“目标主体名称不正确”错误。通过重新启动Web服务器可以暂时修复这些问题。
然后我使用这篇文章正确配置了Kerberos:Set up Kerberos Authentication with Delegation on IIS 7 w/ Windows Server 2008
现在我遇到了以前从未遇到过的错误:
Exception Details: System.Xml.XmlException: Root element is missing.
[XmlException: Root element is missing.]
System.Xml.XmlTextReaderImpl.Throw(Exception e) +88
System.Xml.XmlTextReaderImpl.ParseDocumentContent() +1383
System.Xml.XmlCharCheckingReader.Read() +153
Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read() +63
Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read(XmlNodeType nodeType) +44
Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadXmlDeclaration(EwsServiceXmlReader reader) +54
[ServiceRequestException: The response received from the service didn't contain valid XML.]
Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadXmlDeclaration(EwsServiceXmlReader reader) +165
Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadSoapFault(EwsServiceXmlReader reader) +43
Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException) +413
Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request) +139
Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request) +573
Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute() +42
Microsoft.Exchange.WebServices.Data.ExchangeService.FindAppointments(FolderId parentFolderId, CalendarView calendarView) +104
因为这是Exchange Web Services API的托管版本,所以我直接与XML请求和响应无关。它对我来说基本上是一个黑盒子。从错误中可以看出,它是在从EWS调用数据时发生的。