Exchange Web Services catalog items in a folder

I am getting this error message from MS Exchange:

The EWS ID is in the EwsLegacyId format, which is not supported by the version of Exchange that you requested. Please use the ConvertId method to convert the identifier from EwsId to EwsLegacyId format.

in response to the following request for soap:

<?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/">
<soap:Header>

</soap:Header>
<soap:Body>
    <m:FindItem Traversal="Shallow">
        <m:ItemShape>
            <t:BaseShape>Default</t:BaseShape>
           <!-- 
            <t:AdditionalProperties>
                <t:FieldURI FieldURI="item:TextBody" />
                <t:FieldURI FieldURI="item:Body" />

            </t:AdditionalProperties>
            -->
        </m:ItemShape>
        <m:IndexedPageItemView MaxEntriesReturned="100" Offset="0" BasePoint="Beginning" />
        <m:ParentFolderIds>
            <t:FolderId Id="AQMkAGEzZTIzOWNmLWFiMGUtNDg5NC05NzNlLTUxN2FmNGQ3ZjIxMQAALgAAA95uXloT2IJPlNaCGuwj8ycBAObfRJ+1FF9PkWpl8+aNmhoAAAIBDAAAAA==" ChangeKey="AQAAABYAAADm30SftRRfT5FqZfPmjZoaAAAPjzNZ" />
        </m:ParentFolderIds>
    </m:FindItem>
</soap:Body>

      

I got the folder ID from a previous FindFolder operation that lists the folder hierarchy.

How to solve this problem?

+3


source to share


2 answers


I had the same problem too.

Added RequestServerVersion in the header. This fixed the problem.



    '  <soap:Header>' +
    '    <RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />' +
    '  </soap:Header>' +

      

+2


source


You need to add

<t:RequestServerVersion Version="Exchange2007_SP1" /> 

      

between your tags. The version can be any of the following: EWS schema versions in Exchange .



However, once you get this past error, you get another attempt to query for element: TextBody and item: Body. To get the body of the message, you will need to send a GetItem operation that includes the ItemId of the item to bind (i.e. get).

See this page for more information: How to Guide. Working with Exchange mailbox items using EWS .

0


source







All Articles