EWS Получить публичные папки root для учетной записи Office 365, возвращающей ErrorTokenSerializationDenied - PullRequest
0 голосов
/ 16 марта 2020

Я протестировал две учетные записи с одинаковыми настройками почтового ящика и разрешений как в Office 365, так и в Exchange Admin Center. Можно получить публичные папки root успешно, но другой не удалось.

Я получаю публичные папки root следующим образом (пробовал со всеми значениями RequestServerVersion, но не работал):

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    <soap:Header>
        <t:RequestServerVersion Version="Exchange2010"/>
    </soap:Header>
    <soap:Body>
        <GetFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <FolderShape>
                <t:BaseShape>IdOnly</t:BaseShape>
                <t:AdditionalProperties>
                    <t:FieldURI FieldURI="folder:FolderId"/>
                    <t:FieldURI FieldURI="folder:ParentFolderId"/>
                    <t:FieldURI FieldURI="folder:FolderClass"/>
                    <t:FieldURI FieldURI="folder:DisplayName"/>
                    <t:FieldURI FieldURI="folder:EffectiveRights"/>
                    <t:FieldURI FieldURI="folder:DistinguishedFolderId"/>
                    <t:FieldURI FieldURI="folder:PolicyTag"/>
                    <t:FieldURI FieldURI="folder:ArchiveTag"/>
                    <t:FieldURI FieldURI="folder:TotalCount"/>
                    <t:FieldURI FieldURI="folder:ChildFolderCount"/>
                    <t:ExtendedFieldURI PropertyTag="0x3603" PropertyType="Integer"/>
                    <t:ExtendedFieldURI PropertyTag="0x3004" PropertyType="String"/>
                    <t:ExtendedFieldURI PropertyTag="0x0FFF" PropertyType="Binary"/>
                    <t:ExtendedFieldURI PropertyTag="0x3007" PropertyType="SystemTime"/>
                    <t:ExtendedFieldURI PropertyTag="0x3008" PropertyType="SystemTime"/>
                    <t:ExtendedFieldURI PropertyTag="0x0E08" PropertyType="Long"/>
                    <t:ExtendedFieldURI PropertyTag="0x10F4" PropertyType="Boolean"/>
                    <t:ExtendedFieldURI PropertyTag="0x10F6" PropertyType="Boolean"/>
                    <t:ExtendedFieldURI PropertyTag="0x10F5" PropertyType="Boolean"/>
                    <t:ExtendedFieldURI PropertyTag="0x360A" PropertyType="Boolean"/>
                    <t:ExtendedFieldURI PropertyTag="0x300B" PropertyType="Binary"/>
                </t:AdditionalProperties>
            </FolderShape>
            <FolderIds>
                <t:DistinguishedFolderId Id="publicfoldersroot"/>
            </FolderIds>
        </GetFolder>
    </soap:Body>
</soap:Envelope>

И ответ об ошибке выглядит следующим образом:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <s:Fault>
            <faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorTokenSerializationDenied</faultcode>
            <faultstring xml:lang="en-US">The requesting account does not have permission to serialize tokens.</faultstring>
            <detail>
                <e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorTokenSerializationDenied</e:ResponseCode>
                <e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The requesting account does not have permission to serialize tokens.</e:Message>
            </detail>
        </s:Fault>
    </s:Body>
</s:Envelope>

Я искал эту ошибку, но все решения связаны с Exchange Server, а не с Exchange Online.

Возможно ли исправить или настройки, которые я должен изучить? Заранее спасибо.

...