2

我有一个EWS流订阅,我想不断运行。它在特定的收件箱中等待新邮件事件,当事件触发时,它会将电子邮件和POST的内容读取到其他Web服务中。在大多数情况下这个伟大的工程,但是每一次这个System.Xml.XmlException抛出:EWS流订阅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,问题似乎得到解决。

+0

添加它正在死的xml – 2012-03-30 15:50:50

+0

我很想,但我不能在调试时重新创建异常,所以如果xml位于邮件正文中,并且它不是来自POST服务器的响应,如果它在重新连接期间来自Exchange服务器的响应 – 2012-03-30 15:53:59

+0

您需要将日志记录添加到异常处理中。如果你曾经重现/修复它,也可以是'try {} catch {Log。(“current email/xml”)}'。 – 2012-03-30 21:13:48

回答

2

这是一个超出你的控制的内部错误。

如果服务器是2007 sp1,则将其升级到2010。如果它的2010验证其运行的是最新的服务版本修补程序。

如果所有工作都完成并且仍然存在,请使用MSDN订阅(或软件的当前支持合同)并与Microsoft支持部门联系,并让他们与您一起调查。他们可能有一个未发布的服务版本可以解决这个问题。