EWS and XML document error
I'm working with EWS to read emails from Exchange 2007. It basically
works fine, except for some emails that contain certain hex
characters.
For those I get this Exception on the Getitem:
There is an error in XML document (61, -2658).
' ', hexadecimal value 0x0C, is an invalid character. Line 61,
position -2658.
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at ExchangeServiceBinding.GetItem(GetItemType GetItem1)
I found a couple of messages taking about a similar problem when
reading XML docs. The suggestion there always was to check the
document that was read, but I guess I can't change the way the email
is constructed or delivered.
Is there anyway I can read those emails? I tried changing the
MailboxCulture and the RequestEncodind on the binding but with no
success.
Any idea how I can get rid of the Exception and succesfully read the
email?
Actually I can get to the MimeContent just fine, but that's not an
option in this case.
thanks
-Dieter
date: Thu, 17 Jan 2008 12:56:16 -0800 (PST)
author: unknown