c# - EWS 流订阅 System.Xml.XmlException

标签 c# xml exception exchangewebservices exchange-server

我有一个 EWS 流订阅,我想持续运行。它等待特定收件箱中的新邮件事件,当该事件触发时,它会读取电子邮件并将内容发布到不同的 Web 服务。在大多数情况下,这非常有效,但是每次都会抛出此 System.Xml.XmlException:

Unhandled Exception: System.Xml.XmlException: '▼', hexadecimal value 0
invalid character. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& e
32& outOrChars)
at System.Xml.XmlTextReaderImpl.ParseText()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read()
at Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read(XmlNodeTyp
)
at Microsoft.Exchange.WebServices.Data.EwsXmlReader.InternalReadEle
mespace xmlNamespace, String localName, XmlNodeType nodeType)
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadRespo
viceXmlReader ewsXmlReader)
at Microsoft.Exchange.WebServices.Data.HangingServiceRequestBase.Pa
es(Object state)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(
te)
at System.Threading.ExecutionContext.Run(ExecutionContext execution
ontextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThr
kItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

我看过有关此异常的其他帖子,但似乎没有一个有解决方案。我怎样才能阻止它被抛出?

更新:

以防万一有人遇到同样的问题。我们将服务器升级到 2010 sp2,问题似乎已得到解决。

最佳答案

这是您无法控制的内部错误。

如果服务器是 2007 sp1,则将其升级到 2010。如果是 2010,请验证其是否使用最新的服务版本补丁运行。

如果完成所有操作后问题仍然发生,请使用您的 MSDN 订阅(或该软件的当前支持契约(Contract))并联系 Microsoft 支持并让他们与您一起调查。他们可能有一个未发布的服务版本,可以解决此问题。

关于c# - EWS 流订阅 System.Xml.XmlException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9946081/

相关文章:

ruby-on-rails - rails 3 : Detecting types when parsing XML

javascript - 添加自动广告后,移动设备上的链接不起作用

java - try catch 异常总是返回 null

python - 如何在 Python 3 中根据字符串参数捕获一般异常?

c# - 将字符串列表放入 Bson 数组

c# - 使用自定义注册表单时 DNN 损坏的用户名

xml - 如何仅使用 Parser 实例将 XML 写入文件?

java - 在 Java 中,什么时候应该创建检查异常,什么时候应该创建运行时异常?

c# - 包含/加入问题的 Entity Framework

c# - 使用 TPL 时如何确定方法将在哪个线程上执行?