【问题标题】:Exchange Web Services - cannot get additional properties when calling "FindPeople" methodExchange Web 服务 - 调用“FindPeople”方法时无法获取其他属性
【发布时间】:2014-11-28 20:11:46
【问题描述】:

我正在向 Office365 发出原始SOAP 请求并尝试获取指定AddressListId 的联系人列表我成功获得了联系人列表,但它不包括我需要的所有其他信息。在我的请求中添加一些其他属性(例如 PhoneNumber)后,服务器会返回 Invalid shape 错误。

这是我的要求:

<?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"
               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
   <soap:Header>
    <t:RequestServerVersion Version="Exchange2013" />
   </soap:Header>
   <soap:Body >
    <m:FindPeople>
      <m:PersonaShape>
        <t:BaseShape>IdOnly</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="persona:DisplayName"/>
          <t:FieldURI FieldURI="persona:PhoneNumber"/>
        </t:AdditionalProperties>
      </m:PersonaShape>
      <m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="100" Offset="0"/>
      <m:ParentFolderId>
        <t:AddressListId Id="###-####-####-####"/>
      </m:ParentFolderId>
    </m:FindPeople>
  </soap:Body>
</soap:Envelope>

如何获取每个角色的所有其他信息?

【问题讨论】:

    标签: web-services soap exchangewebservices office365


    【解决方案1】:

    我使用的是 EWS 托管 API,因此您必须在 MSDN 上搜索原始 SOAP 调用,我只能稍微指导您的搜索:

    我遇到了类似的问题,因为同样适用于FindAppointments()。询问AppointmentSchema.RequiredAttendees 会提高Invalid Shape error,而AppointmentSchema.Organizer 将不包含电子邮件地址,仅包含组织者的名称,使用FindAppointments()

    解决方案是向 Exchange Server 发出两个请求。

    var appointments = calendarFolder.FindAppointments(BasePropertySet.FirstClassProperties);
    exchangeService.LoadPropertiesForItems(appointments, MyAdvancedProperties);
    

    认为FindPeople() 以及所有其他Find%Itemtype%() EWS 可能支持的“解决方法”是可能的,但我不确定。

    编辑:我刚刚找到http://social.technet.microsoft.com/Forums/exchange/en-US/e83abfb1-37a8-48fe-9579-4e120fb77746/ews-managed-api-loadpropertiesforitems-returns-unexpected-end-of-xml-document?forum=exchangesvrdevelopment,其中声明LoadPropertiesForItems 使用多个ItemID 调用生肥皂GetItem

    【讨论】:

    • 我不想做两个请求。我们有一个庞大的组织,需要花费大量时间来迭代每个角色。根据 Microsoft 文档,这个调用应该可以工作,但它没有,所以我想知道我做错了什么
    • 我不了解你,只是猜测而已,但我没有做错任何事情 - 从 FindAppointments 获取 Organizer 或 RequiredAttendees 是完全不可能的。但我的猜测是,类似的约束也适用于 FindPeople。顺便说一句,MS 有论坛,当他们的官方文档似乎有问题或不完整时,您可以在其中获得对此类深入问题的更好答案。
    猜你喜欢
    • 1970-01-01
    • 2011-07-02
    • 1970-01-01
    • 2016-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多