O'Reilly logo

Inside Microsoft® Exchange Server 2007 Web Services by Huw Upshall, Mark Taylor, Ben Spain, Michael Mainer, David Sterling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required