BodyType

BodyType 元素标识响应中正文文本的格式设置方式。

<BodyType>Best or HTML or Text</BodyType>

BodyTypeResponseType

属性和元素

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

Attributes

无。

子元素

无。

父元素

元素 说明
ItemShape
标识要包含在 GetItem、FindItem 或 SyncFolderItems 响应中的项属性和内容。

下面是此元素的 XPath 表达式:

/GetItem/ItemShape

/FindItem/ItemShape

/SyncFolderItems/ItemShape
AttachmentShape
标识在 响应 GetAttachment 请求时要返回的其他扩展项属性。

下面是此元素的 XPath 表达式:

/GetAttachment/AttachmentShape

文本值

下表列出了 BodyType 元素的可能值。

说明
最好
响应将返回最丰富的正文文本可用内容。 如果未知内容是文本还是 HTML,这很有用。

如果存储的正文是纯文本,则返回的正文将为文本。 否则,如果存储的正文采用 HTML 或 RTF 格式,则响应将返回 HTML。

此值为默认值。
HTML
响应将返回 HTML 格式的项目正文。
Text
响应将以纯文本形式返回项正文。

备注

可以通过检查 Body 元素的 BodyType 属性来标识响应中返回的 正文 类型。 BodyType 属性会将正文标识为 HTML 或文本。

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

示例

以下请求示例显示了 使用 BodyType 元素的位置。

<?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>
    <GetAttachment xmlns="https://schemas.microsoft.com/exchange/services/2006/messages" 
                      xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
      <AttachmentShape>
        <t:BodyType>Best</t:BodyType>
      </AttachmentShape>
      <AttachmentIds>
        <t:AttachmentId Id="ASkAS="/>
      </AttachmentIds>
    </GetAttachment>
  </soap:Body>
</soap:Envelope>

Id 属性已缩短,以保持可读性。

元素信息

元素 说明
命名空间
https://schemas.microsoft.com/exchange/services/2006/types
架构名称
类型架构
验证文件
Types.xsd
可以为空
False