CreateAttachment

CreateAttachment 元素定义在 Exchange 存储区中创建项目附件的请求。

<CreateAttachment>
   <ParentItemId/>
   <Attachments/>
</CreateAttachment>

CreateAttachmentType

属性和元素

下面各部分介绍了属性、子元素和父元素。

Attributes

无。

子元素

元素 说明
ParentItemId
标识包含已创建附件的父 Exchange 存储项。 ParentItemId 元素必须提供真实 Exchange 存储项的 ID。 可以使用 GetItem 操作检索实际存储项;使用 GetAttachment 操作检索附件。 如果 向 ParentItemId 传递了文件附件的 ID,则会发生错误。 如果 ParentItemId 表示现有项目附件的 ID,则 CreateAttachment 操作 会将新附件添加到现有附件。
CreateAttachment 操作需要此元素。
附件
包含要附加到 Exchange 存储中的项的项目或文件。

父元素

无。

说明

项目附件不作为存储项存在。 它仅作为项目或其他附件的附件存在。 只能通过使用 GetAttachment 请求检索项附件。

可以创建以下项目附件:

  • 项目

  • 邮件

  • CalendarItem

  • 联系人

  • 任务

  • MeetingMessage

  • MeetingRequest

描述此元素的架构位于正在运行 MicrosoftExchange Server 2007 的计算机(已安装客户端访问服务器角色)的 EWS 虚拟目录中。

示例

以下示例演示如何创建项目并将其附加到 Exchange 存储中的另一项。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Body>
    <CreateAttachment xmlns="https://schemas.microsoft.com/exchange/services/2006/messages" 
                  xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
      <ParentItemId Id="ASkAS"/>
      <Attachments>
        <t:ItemAttachment>
          <t:Name>MyAttachment</t:Name>
          <t:Message>
            <t:ItemClass>IPM>Note</t:ItemClass>
            <t:Subject>My attachment subject</t:Subject>
            <t:Body BodyType="Text">My attachment body</t:Body>
          </t:Message>
        </t:ItemAttachment>
      </Attachments>
    </CreateAttachment>
  </soap:Body>
</soap:Envelope>

元素信息

元素 示例
命名空间
https://schemas.microsoft.com/exchange/services/2006/messages
架构名称
消息架构
验证文件
Messages.xsd
可以为空
False

另请参阅

CreateAttachment 操作

DeleteAttachment 操作

GetAttachment 操作