none
[EWS JAVA API 1.2] Receiving answer in SOAP 1.2, however request in SOAP 1.2. Getting exception ServiceXmlDeserializationException. RRS feed

  • Question

  • Hi 

    I am using EWS JAVA API 1.2 to connect to Exchange 2007 SP3 and I am getting ServiceXmlDeserializationException with message An element node 'soap:Envelope' of the type START_ELEMENT was expected, but node '{http://www.w3.org/2003/05/soap-envelope}Envelope' of type START_ELEMENT was found.

    And for some reason I am getting response in SOAP 1.2 format.

    Request text:

    <?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:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><soap:Header><t:RequestServerVersion Version="Exchange2010_SP2" /></soap:Header><soap:Body><m:GetFolder><m:FolderShape><t:BaseShape>AllProperties</t:BaseShape></m:FolderShape><m:FolderIds><t:DistinguishedFolderId Id="inbox" /></m:FolderIds></m:GetFolder></soap:Body></soap:Envelope>

    Response text:

    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><t:ServerVersionInfo MajorVersion="8" MinorVersion="3" MajorBuildNumber="83" MinorBuildNumber="4" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" /></soap:Header><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value><soap:Subcode><soap:Value xmlns:q0="http://schemas.microsoft.com/exchange/services/2006/errors">q0:ErrorInvalidServerVersion</soap:Value></soap:Subcode></soap:Code><soap:Reason><soap:Text xml:lang="en">The specified server version is invalid.</soap:Text></soap:Reason><detail><e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInvalidServerVersion</e:ResponseCode><e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The specified server version is invalid.</e:Message></detail></soap:Fault></soap:Body></soap:Envelope> 

     
    Monday, January 27, 2014 11:39 AM

All replies

  • >>I am using EWS JAVA API 1.2 to connect to Exchange 2007 SP3

    In your request you have set the server version to Exchange2010 eg

    ><t:RequestServerVersion Version="Exchange2010_SP2" /></soap:Header><soap:Body><m:GetFolder>

    So the server is reporting

    >>The specified server version is invalid.

    Which is correct for Exchange 2007 you need to set the server version to

    ><t:RequestServerVersion Version="Exchange2007_SP1" />

    (there are no EWS schema updates in 2007 SP2 or SP2 so this didn't change)

    Cheers
    Glen

    Tuesday, January 28, 2014 4:42 AM