Office 365上的EWS GetFolder错误

时间:2017-09-14 12:56:25

标签: calendar office365 exchangewebservices

我有一个办公室365帐户,其中包含以下帐户:

  • 一位主要用户:mainuser@company.onmicrosoft.com
  • 另一位用户:someuser@company.onmicrosoft.com

someuser@company.onmicrosoft.com mainuser@company.onmicrosoft.com 分享了他的日历

然后我执行以下EWS操作(通过mainuser@company.onmicrosoft.com)以获取为someuser@company.onmicrosoft.com设置的日历权限。

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010"/>
  </soap:Header>
  <soap:Body>
    <GetFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">

      <FolderShape>
        <t:BaseShape>Default</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="folder:PermissionSet"/>
        </t:AdditionalProperties>
      </FolderShape>

      <m:FolderIds>
        <t:DistinguishedFolderId Id="calendar">
          <t:Mailbox>
            <t:EmailAddress>someuser@company.onmicrosoft.com</t:EmailAddress>
          </t:Mailbox>
        </t:DistinguishedFolderId>
      </m:FolderIds>

    </GetFolder>
  </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 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" MajorVersion="15" MinorVersion="20" MajorBuildNumber="56" MinorBuildNumber="13" Version="V2017_07_11"/>
  </s:Header>
  <s:Body>
    <m:GetFolderResponse 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:GetFolderResponseMessage ResponseClass="Success">
    <m:ResponseCode>NoError</m:ResponseCode>
    <m:Folders>
      <t:CalendarFolder>
        <t:FolderId Id="some-folder-id"/>
        <t:DisplayName>Calendar</t:DisplayName>
        <t:TotalCount>67</t:TotalCount>
        <t:ChildFolderCount>2</t:ChildFolderCount>
        <t:PermissionSet>
          ...    
        </t:PermissionSet>
      </t:CalendarFolder>
    </m:Folders>
  </m:GetFolderResponseMessage>
</m:ResponseMessages>
    </m:GetFolderResponse>
  </s:Body>
</s:Envelope>

除非 someuser@company.onmicrosoft.com 外部联系人共享他的日历,然后当我执行相同的请求时,我突然收到此响应错误

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo 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" MajorVersion="15" MinorVersion="20" MajorBuildNumber="56" MinorBuildNumber="13" Version="V2017_07_11"/>
  </s:Header>
  <s:Body>
    <m:GetFolderResponse 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:GetFolderResponseMessage ResponseClass="Error">
    <m:MessageText>Access is denied. Check credentials and try again., Can't look up the requested Entry ID.</m:MessageText>
    <m:ResponseCode>ErrorAccessDenied</m:ResponseCode>
    <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
    <m:Folders/>
  </m:GetFolderResponseMessage>
</m:ResponseMessages>
    </m:GetFolderResponse>
  </s:Body>
</s:Envelope>

我不明白为什么Office 365会返回EWS错误而不是过滤我们无法访问的数据...我们应该能够获得有关内部组织的日历权限,而不管任何外部日历共享

任何人有关于预定解决方案的相同问题或信息?

0 个答案:

没有答案