File Attachments

Let’s assume that you have an item in your Mailbox that already has a visible file attachment on it. Call GetItem on this item and see what data is returned. Although you could just use the Default base shape, you should always request only the information that you need. So instead, use the IdOnly base shape and request both the item:Attachments and item:HasAttachments property paths via the AdditionalProperties element. This is shown in Example 12-1.

Example 12-1. GetItem with attachments

<GetItem xmlns=".../messages"
         xmlns:t=".../types">
  <ItemShape>
    <t:BaseShape>IdOnly</t:BaseShape>
    <t:AdditionalProperties>
      <t:FieldURI FieldURI="item:Attachments"/>
      <t:FieldURI FieldURI="item:HasAttachments"/>
    </t:AdditionalProperties> </ItemShape> ...

Get Inside Microsoft® Exchange Server 2007 Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.