查找有关 InstallApp EWS 操作的信息。
InstallApp 操作在邮箱中安装 Outlook 的邮件应用。
Exchange Server 2013 中引入了此操作。
使用 InstallApp 操作
InstallApp 操作采用一个参数,用于标识要安装的邮件应用。 参数包含邮件应用的 base64 编码清单。
InstallApp 操作 SOAP 标头
InstallApp 操作可以使用下表中列出的 SOAP 标头。
| 标头名称 | 元素 | 说明 | 
|---|---|---|
| RequestVersion  | 
RequestServerVersion  | 
标识操作请求的架构版本。 此标头适用于请求。   | 
| ServerVersion  | 
ServerVersionInfo  | 
标识响应请求的服务器版本。 此标头适用于响应。   | 
InstallApp 操作请求示例:在邮箱中安装邮件应用
以下 InstallApp 操作请求示例演示如何安装 Outlook 的邮件应用。 可以使用 GetAppManifests 操作找到应用清单。
注意
已任意截断 base64 编码的应用清单以保持可读性,并且不表示有效的清单。
<?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"
               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
   <soap:Header>
      <t:RequestServerVersion Version="Exchange2013" />
   </soap:Header>
   <soap:Body >
      <m:InstallApp>
         <m:Manifest>TUwiIC8+CiAgPC9SdWxlPgo8L09mZmljZUFwcD4=</m:Manifest>
      </m:InstallApp>
   </soap:Body>
</soap:Envelope>
请求 SOAP 正文包含以下元素:
成功的 InstallApp 操作响应
以下示例显示了对安装邮件应用的 InstallApp 操作请求的成功响应。
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="15" 
                           MinorVersion="0" 
                           MajorBuildNumber="556" 
                           MinorBuildNumber="14" 
                           Version="Exchange2013" 
                           xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" 
                           xmlns="http://schemas.microsoft.com/exchange/services/2006/types" 
                           xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <InstallAppResponse ResponseClass="Success" 
                          xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
         <ResponseCode>NoError</ResponseCode>
      </InstallAppResponse>
   </s:Body>
</s:Envelope>
响应 SOAP 正文包含以下元素:
InstallApp 操作错误响应
以下示例显示了 对 InstallApp 操作请求的错误响应。 这是对包含无效清单的请求的响应。
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="15" 
                           MinorVersion="0" 
                           MajorBuildNumber="556" 
                           MinorBuildNumber="14" 
                           Version="Exchange2013" 
                           xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" 
                           xmlns="http://schemas.microsoft.com/exchange/services/2006/types" 
                           xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <InstallAppResponse ResponseClass="Error" 
                          xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
         <MessageText>This app can't be installed. Missing OfficeApp element.</MessageText>
         <ResponseCode>ErrorInternalServerError</ResponseCode>
         <DescriptiveLinkKey>0</DescriptiveLinkKey>
      </InstallAppResponse>
   </s:Body>
</s:Envelope>
错误响应 SOAP 正文包含以下元素: