none
Character reference "&# -- EWS API error RRS feed

  • Question

  • Hi,

    We are using microsoft exchange web service to read emails and copy the metadata of the email into the database.  
    In case there is any encrypted data in the email body, the API to read the emails throws the XMLParse exception. 
    We had to manually find the email causing the exception in the mailbox and remove it from the mailbox so that the API which reads the emails from the inbox runs fine.
    We are using version: Exchange2007_SP1 to create the service object. 
    Could you please suggest how to get rid of the error? Will upgrading to upper version Exchange2010_SP1 solve the problem?


    Error details:
    ---------------------

    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[19,58] 
    Message: Character reference "&# 
        at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:598)
         at com.sun.xml.internal.stream.XMLEventReaderImpl.nextEvent(XMLEventReaderImpl.java:83)
         at microsoft.exchange.webservices.data.EwsXmlReader.read(EwsXmlReader.java:171)
         at microsoft.exchange.webservices.data.EwsXmlReader.readValue(EwsXmlReader.java:475)
         at microsoft.exchange.webservices.data.MessageBody.readTextValueFromXml(MessageBody.java:107)
         at microsoft.exchange.webservices.data.ComplexProperty.loadFromXml(ComplexProperty.java:187)
         at microsoft.exchange.webservices.data.ComplexProperty.loadFromXml(ComplexProperty.java:211)
         at microsoft.exchange.webservices.data.ComplexPropertyDefinitionBase.internalLoadFromXml(ComplexPropertyDefinitionBase.java:95)
         at microsoft.exchange.webservices.data.ComplexPropertyDefinitionBase.loadPropertyValueFromXml(ComplexPropertyDefinitionBase.java:118)
         at microsoft.exchange.webservices.data.PropertyBag.loadFromXml(PropertyBag.java:487)
         at microsoft.exchange.webservices.data.ServiceObject.loadFromXml(ServiceObject.java:268)
         at microsoft.exchange.webservices.data.EwsServiceXmlReader.readServiceObjectsCollectionFromXml(EwsServiceXmlReader.java:212)
         at microsoft.exchange.webservices.data.GetItemResponse.readElementsFromXml(GetItemResponse.java:56)
         at microsoft.exchange.webservices.data.ServiceResponse.loadFromXml(ServiceResponse.java:102)
         at microsoft.exchange.webservices.data.MultiResponseServiceRequest.parseResponse(MultiResponseServiceRequest.java:52)
         at microsoft.exchange.webservices.data.ServiceRequestBase.readResponse(ServiceRequestBase.java:459)
         at microsoft.exchange.webservices.data.SimpleServiceRequestBase.readResponse(SimpleServiceRequestBase.java:110)
         at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:38)


    encrypted content in the email body is like 6ЖФf√FVГF√ б √ФfÐ’&ж F√ЖЦ╡  .
     
    Friday, September 20, 2013 2:55 PM

All replies

  • Give a try  "JWebServices for Exchange"

    I had similar issue with EWS Java API (parse exception) and switched to the API.
    Monday, September 23, 2013 12:41 PM
  • We had evaluated "JWebServices for Exchange" and the Microsoft API for our project which needs to be integrated with outlook and we went ahead with the Microsoft API as its free source and other reasons. So, its actually not feasible for us to change the API/the jar which we are using for the exchange integration. Can this be fixed by microsoft ?

    Wednesday, September 25, 2013 12:14 PM