使用 SOAP 在 EWS 中按文件夹路径搜索文件夹



是否可以按PR_FOLDER_PATH进行SOAP搜索? 简单搜索路径中带有"收件箱"的任何文件夹都会显示为空:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <FindFolder Traversal="Deep" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
      <FolderShape>
        <t:BaseShape>Default</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="folder:FolderClass" />
          <t:ExtendedFieldURI PropertyTag="4340" PropertyType="Boolean" />
          <t:ExtendedFieldURI PropertyTag="26293" PropertyType="String" />
        </t:AdditionalProperties>
      </FolderShape>
      <Restriction>
        <t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
          <t:ExtendedFieldURI PropertyTag="26293" PropertyType="String" />
          <t:Constant Value="Inbox" />
        </t:Contains>
      </Restriction>
      <ParentFolderIds>
        <t:DistinguishedFolderId Id="msgfolderroot" />
      </ParentFolderIds>
    </FindFolder>
  </soap:Body>
</soap:Envelope>

事实上,PR_FOLDER_PATH似乎有点神秘。 我知道它的属性标签是 26293,我可以在其他搜索结果中看到输出的文件夹路径值。 但是我似乎找不到一种方法来获取 EWS 编辑器中列出的此属性的值,更不用说让它与搜索过滤器一起使用了。 PID 名称等效于什么?PR_FOLDER_PATH甚至没有列在MS-OXPROPS中!

我很确定它是一个计算属性,并且仅在 FindFolder 操作的 EWS 中有效,因为底层 Exchange 操作返回此属性(例如,它在 2013 年的 GetFolder 操作中不起作用)。

实现您想要的目标的一种简单方法是在收件箱上制作 FindFolder,这将为您提供路径中带有收件箱的所有文件夹。对于用户创建的文件夹,您需要找到用户创建的文件夹的 ID,但它的工作方式类似。

干杯幽谷

最新更新