나는 지속적으로 실행하려는 EWS 스트리밍 구독이 있습니다. 특정받은 편지함에서 새 메일 이벤트를 기다리고 이벤트가 발생하면 전자 메일을 읽고 POST의 내용을 다른 웹 서비스에 보냅니다. 대부분의 경우이 큰이, 그러나 가끔이 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로 서버를 업그레이드했으며 문제가 해결 된 것으로 보입니다.
XML을 추가합니다. –
에 있습니다. 그렇지만 디버깅 중에는 예외를 다시 만들 수는 없습니다. 따라서 XML이 전자 메일 본문에있는 경우에는 그렇지 않습니다. POST 서버의 응답 인 경우, 다시 연결할 때 Exchange 서버의 응답 인 경우 –
예외 처리에 로깅을 추가해야합니다. 일명'try {} 잡기 {Log. ("현재 이메일/xml")} 종류의 것을 재현하거나 고칠 수 있다면. –