【问题标题】:Get Contacts folder items using ews in office 365在 Office 365 中使用 ews 获取联系人文件夹项目
【发布时间】:2015-08-18 12:53:41
【问题描述】:

我正在使用以下 SOAP 请求来检索 office 365 邮件插件中联系人文件夹中的项目

'<?xml version="1.0" encoding="UTF-8"?>'+
    ' <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' +
     ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"' +
            ' 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="Exchange2013" />' +
    ' </soap:Header>'+
    ' <soap:Body >'+
       ' <m:FindPeople>'+
          ' <m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="100" Offset="0"/>'+
          ' <m:ParentFolderId>'+
             ' <t:DistinguishedFolderId Id="contacts"/>'+
          ' </m:ParentFolderId>'+
      ' </m:FindPeople>'+
    ' </soap:Body>'+
    ' </soap:Envelope>';

但出现以下错误。

我已经为日历文件夹使用了 FindItem 、 GetFolder 方法,这些方法正在工作。

有没有办法通过使用名称作为搜索值来查找人们的电子邮件地址。

【问题讨论】:

    标签: soap office365 exchangewebservices outlook-web-app


    【解决方案1】:

    邮件应用程序中的 makeEwsRequestAsync 仅支持 FindPeople 不属于其中的 EWS 操作的子集。您可以在 https://msdn.microsoft.com/en-us/library/office/fp160952.aspx 上查看支持的操作的完整列表。

    有没有办法通过使用名称作为搜索值来查找人们的电子邮件地址。

    当然只使用对 DisplayName 有限制的 FindItem,例如

    <?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://sc
    hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
    soap.org/soap/envelope/">
      <soap:Header>
        <t:RequestServerVersion Version="Exchange2013_SP1" />
      </soap:Header>
      <soap:Body>
        <m:FindItem Traversal="Shallow">
          <m:ItemShape>
            <t:BaseShape>AllProperties</t:BaseShape>
          </m:ItemShape>
          <m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning" />
          <m:Restriction>
            <t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
              <t:FieldURI FieldURI="contacts:DisplayName" />
              <t:Constant Value="Blah blah" />
            </t:Contains>
          </m:Restriction>
          <m:ParentFolderIds>
            <t:DistinguishedFolderId Id="contacts" />
          </m:ParentFolderIds>
        </m:FindItem>
      </soap:Body>
    </soap:Envelope>

    干杯 格伦

    【讨论】:

    • 响应总是空的。我尝试使用我的联系人文件夹中的确切名称。 :(
    • 如果您在没有限制的情况下进行相同的查询,如果您没有查询正确的文件夹,您应该只获取联系人文件夹中的所有联系人项目
    • 是的。没有限制,响应仍然是空的。但是人员数据将驻留在联系人文件夹中,对吧?
    • 另外,我们可以在哪种情况下使用 FindPeople ?我的意思是如果它在 MailApps 中受到限制,我该如何使用 FindPeople 方法。
    • 在 MailApps 中你不能使用 FindPeople
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-11-08
    • 1970-01-01
    • 2018-09-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-01
    相关资源
    最近更新 更多