如何通过EWS从根公用文件夹中检索所有更改的文件夹?

时间:2018-10-12 14:01:38

标签: outlook office365 exchangewebservices

当用户更改权限或文件夹中的项目时,我需要获取所有公用文件夹。怎么做?我在文档中找不到正确的答案。 我只发现了这个:

POST outlook.office365.com/EWS/Exchange.asmx

?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    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="Exchange2013" />
            <t:ExchangeImpersonation>
                <t:ConnectingSID>
                    <t:PrimarySmtpAddress>test@test_test.onmicrosoft.com</t:PrimarySmtpAddress>
                </t:ConnectingSID>
            </t:ExchangeImpersonation>
        </soap:Header>
  <soap:Body>
    <m:SyncFolderHierarchy>
      <m:FolderShape>
        <t:BaseShape>IdOnly</t:BaseShape>
      </m:FolderShape>
      <m:SyncFolderId>
        <t:DistinguishedFolderId Id="publicfoldersroot" />
      </m:SyncFolderId>
    </m:SyncFolderHierarchy>
  </soap:Body>
</soap:Envelope>

,响应为:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
        <h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1207" MinorBuildNumber="28" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    </s:Header>
    <s:Body>
        <m:SyncFolderHierarchyResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:ResponseMessages>
                <m:SyncFolderHierarchyResponseMessage ResponseClass="Error">
                    <m:MessageText>The root of a folder hierarchy synchronization cannot be set to the id of a public folder. Use FindFolder to synchronize the public folder hierarchy.</m:MessageText>
                    <m:ResponseCode>ErrorInvalidOperation</m:ResponseCode>
                    <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
                    <m:SyncState/>
                    <m:IncludesLastFolderInRange>true</m:IncludesLastFolderInRange>
                </m:SyncFolderHierarchyResponseMessage>
            </m:ResponseMessages>
        </m:SyncFolderHierarchyResponse>
    </s:Body>
</s:Envelope>

如您所见,它不起作用。

0 个答案:

没有答案