AddImGroup 操作AddImGroup operation

查找有关AddImGroup EWS 操作的信息。Find information about the AddImGroup EWS operation.

AddImGroup Exchange Web 服务(EWS)操作将新的即时消息(IM)组添加到邮箱。The AddImGroup Exchange Web Services (EWS) operation adds a new instant messaging (IM) group to a mailbox.

Exchange Server 2013 中引入了此操作。This operation was introduced in Exchange Server 2013.

使用 AddImGroup 操作Using the AddImGroup operation

AddImGroup操作仅采用一个显示名称参数。The AddImGroup operation only takes a single display name argument.

此操作返回新组的显示名称、组类型和 Exchange 存储标识符。This operation returns the display name, group type, and Exchange store identifier of the new group.

AddImGroup操作可以使用下表中列出的 SOAP 标头。The AddImGroup operation can use the SOAP headers that are listed in the following table.

表1。AddImGroup 操作 SOAP 标头Table 1. AddImGroup operation SOAP headers

标头名称Header name 元素Element 说明Description
模拟Impersonation
ExchangeImpersonationExchangeImpersonation
标识客户端应用程序模拟的用户。Identifies the user whom the client application is impersonating. 这适用于请求。This is applicable to a request.
MailboxCultureMailboxCulture
MailboxCultureMailboxCulture
确定用于访问邮箱的区域性(如 RFC 3066 中定义的用于标识语言的标记)。Identifies the culture, as defined in RFC 3066, "Tags for the Identification of Languages", to be used to access the mailbox. 这适用于请求。This is applicable to a request.
RequestVersionRequestVersion
RequestServerVersionRequestServerVersion
标识操作请求的架构版本。Identifies the schema version for the operation request. 这适用于请求。This is applicable to a request.
ServerVersionServerVersion
ServerVersionInfoServerVersionInfo
标识响应请求的服务器版本。Identifies the version of the server that responded to the request. 这适用于响应。This is applicable to a response.

AddImGroup 操作请求示例:创建新的 IM 组AddImGroup operation request example: Create a new IM group

下面的AddImGroup操作请求示例演示如何创建名为 MYCUSTOMERGROUP 的 IM 组。The following example of an AddImGroup operation request shows how to create an IM group named MyCustomerGroup.

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
               xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages">
   <soap:Header>
      <t:RequestServerVersion Version="Exchange2013" />
      <t:MailboxCulture>en-US</t:MailboxCulture>
   </soap:Header>
   <soap:Body >
      <m:AddImGroup>
         <m:DisplayName>MyCustomGroup</m:DisplayName>
      </m:AddImGroup>
   </soap:Body>
</soap:Envelope>

请求 SOAP 正文包含以下元素:The request SOAP body contains the following elements:

成功的 AddImGroup 操作响应Successful AddImGroup operation response

下面的示例演示对AddImGroup操作请求的成功响应。The following example shows a successful response to an AddImGroup operation request.

<?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="349"
                           MinorBuildNumber="0"
                           Version="Exchange2013"
                           xmlns:h="https://schemas.microsoft.com/exchange/services/2006/types"
                           xmlns="https://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">
      <AddImGroupResponse ResponseClass="Success"
                          xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
         <ResponseCode>NoError</ResponseCode>
         <ImGroup>
            <DisplayName xmlns="https://schemas.microsoft.com/exchange/services/2006/types">MyCustomGroup</DisplayName>
            <GroupType xmlns="https://schemas.microsoft.com/exchange/services/2006/types">IPM.DistList.MOC.UserGroup</GroupType>
            <ExchangeStoreId Id="AAMkAGQ1MjJjMTBkLTc4Y2UtNDA5Ny04ZjU5LWI3MAAA="
                             ChangeKey="EgAAAA=="
                             xmlns="https://schemas.microsoft.com/exchange/services/2006/types"/>
         </ImGroup>
      </AddImGroupResponse>
   </s:Body>
</s:Envelope>

响应 SOAP 正文包含以下元素:The response SOAP body contains the following elements:

AddImGroup 操作错误响应AddImGroup operation error response

下面的示例演示对AddImGroup操作请求的错误响应。The following example shows an error response to an AddImGroup operation request. 这是对包含无法在显示名称中使用的字符的请求的响应。This is a response to a request that contains a character that cannot be used in a display name. 请注意,这是一个 SOAP 错误,而不是基于架构的错误消息。Note that this is a SOAP fault and not a schema-based error message. 在请求中提交的显示名称为 ~! @ # $% ^ & ,并在字符上发生错误 & 。The display name submitted in the request is ~!@#$%^&, and the error occurs on the & character. &字符出现在第11行和第百分位数字符的请求负载中。The & character occurred on the 11th line and 33rd character in the request payload. 响应是使用 HTTP 500 代码返回的。The response was returned with an HTTP 500 code.

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <s:Fault>
         <faultcode xmlns:a="https://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation</faultcode>
         <faultstring xml:lang="en-US">The request failed schema validation: An error occurred while parsing EntityName. Line 11, position 33.</faultstring>
         <detail>
            <e:ResponseCode xmlns:e="https://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode>
            <e:Message xmlns:e="https://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.</e:Message>
            <t:MessageXml xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
               <t:LineNumber>11</t:LineNumber>
               <t:LinePosition>33</t:LinePosition>
               <t:Violation>An error occurred while parsing EntityName. Line 11, position 33.</t:Violation>
            </t:MessageXml>
         </detail>
      </s:Fault>
   </s:Body>
</s:Envelope>

另请参阅See also