Unexpected end of XML document

May 28, 2014 at 2:50 PM
Hi all

Having an issues with EWS which I initially thought was in my code, but was able to reproduce using the EWS editor. Basically, I can log in (Server Exchange 2007 SP3), but when I try to access the Inbox or Sent Items, I get the above error (see full details below).

My hunch is that it is to do with how the client has set up their server (SBS) or Exchange but it is proving it which is the issue (the code does work else where against other exchanges). It may also be one property of the emails is causing an issue, but short of going through them one-by-one I don't know how to pin point it. Any help would be appreciated (or if not relevant here, if I could be pointed to the right forum?)



Full error is:
Microsoft.Exchange.WebServices.Data.ServiceXmlDeserializationException: Unexpected end of XML document.
   at Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read()
   at Microsoft.Exchange.WebServices.Data.SoapFaultDetails.ParseDetailNode(EwsXmlReader reader)
   at Microsoft.Exchange.WebServices.Data.SoapFaultDetails.Parse(EwsXmlReader reader, XmlNamespace soapNamespace)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadSoapFault(EwsServiceXmlReader reader)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.InternalExecute()
   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
   at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalLoadPropertiesForItems(IEnumerable`1 items, PropertySet propertySet, ServiceErrorHandling errorHandling)
   at Microsoft.Exchange.WebServices.Data.Item.InternalLoad(PropertySet propertySet)
The last response received by the EWS editor is:
<Trace Tag="EwsResponse" Tid="1" Time="2014-05-20 09:33:39Z" Version="15.00.0847.030">
  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <t:ServerVersionInfo MajorVersion="8" MinorVersion="3" MajorBuildNumber="327" MinorBuildNumber="1" Version="Exchange2007_SP1" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
        <faultstring>An internal server error occurred.</faultstring>
        <detail />
This was in response to the request: (all from the EWS Editor's log)
<Trace Tag="EwsRequest" Tid="1" Time="2014-05-28 13:45:10Z" Version="15.00.0847.030">
  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <t:RequestServerVersion Version="Exchange2007_SP1" />
        <t:TimeZoneDefinition Id="GMT Standard Time" />
          <t:ItemId Id="AAMkAGIwMGI1ZDFiLWUxYjEtNDE0Zi04MjViLWEwYzY3NWEyYmZjOABGAAAAAACtn/MSmDU6QY39oe8iF8WLBwCeoiIfJkjsRa8jzP7F7IOMAFwf6BvIAACeoiIfJkjsRa8jzP7F7IOMAFwf6B4ZAAA=" />
Nov 7, 2014 at 5:23 PM
Get the latest release of EWSEditor and point it at Fiddler, take a trace of the call with Fiddler and inspect the traffic. Note that you will need to be sure to have Fiddler SSL Decrypting the traffic. There could be an issue with the server response being chopped by something.