Exchange EWS not returning message body for calendar

南笙酒味 提交于 2019-12-09 19:18:42

问题


So i'm trying to fetch all the calendar event from office360.com . I am using ews to get the data. I sent a request of

    <?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">
  <soap:Body>
    <FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
              Traversal="Shallow">
      <ItemShape>
        <t:BaseShape>AllProperties</t:BaseShape>
        <t:BodyType>HTML</t:BodyType>
      </ItemShape>
      <ParentFolderIds>
        <t:DistinguishedFolderId Id="calendar"/>
      </ParentFolderIds>
    </FindItem>
  </soap:Body>
</soap:Envelope>

This soap request xml is not returning me the calendar message body but i get the subject and other data . What am i doing wrong here ? any help is appreciated.


回答1:


The body needs to be retrieved in a separate call.

http://weblogs.asp.net/psperanza/archive/2008/03/18/getting-calendar-items-using-exchange-web-services.aspx

Or you can load the property first.

http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx

The second is easier but you need to define all properties you want back and if it is a lot, it can be a pain.



来源:https://stackoverflow.com/questions/15904649/exchange-ews-not-returning-message-body-for-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!