查找有关 GetImItems EWS 操作的信息。
GetImItems 操作检索有关即时消息 (即时消息) 组和 IM 联系人角色的信息。
Exchange Server 2013 中引入了此操作。
使用 GetImItems 操作
GetImItems 操作接受组和联系人项标识符,并返回一组有关组和联系人的信息。 响应中返回的属性集由扩展属性、多个联系人标识符、组标识符和扩展属性定义标识为参数。
GetImItems 操作 SOAP 标头
GetImItems 操作可以使用下表中列出的 SOAP 标头。
标头名称 | 元素 | 说明 |
---|---|---|
模拟 |
ExchangeImpersonation |
标识客户端应用程序正在模拟的用户。 此标头适用于请求。 |
MailboxCulture |
MailboxCulture |
标识要用于访问邮箱的区域性,如 RFC 3066“标识语言标记”中所述。 此标头适用于请求。 |
RequestVersion |
RequestServerVersion |
标识操作请求的架构版本。 此标头适用于请求。 |
ServerVersion |
ServerVersionInfo |
标识响应请求的服务器版本。 此标头适用于响应。 |
GetImItems 操作请求示例:获取有关 IM 联系人和组的详细信息
下面的 GetImItems 操作请求示例演示如何请求有关 IM 联系人和组的详细信息。 GetImItems 操作可以请求一个或多个联系人或组详细信息。 还可以使用扩展属性获取组和联系人的自定义属性。 如果某个项上不存在请求的扩展属性,则响应将忽略请求的属性,并返回默认属性集的响应。 此示例演示如何使用扩展属性获取显示名称。
注意
为了保持可读性,本文中的所有项标识符和更改键都已缩短。 请注意,对于此操作,服务会忽略更改密钥。
<?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" />
<t:MailboxCulture>en-US</t:MailboxCulture>
</soap:Header>
<soap:Body >
<m:GetImItems>
<m:ContactIds>
<t:ItemId Id="AAMkADEzOTExYACABmEhpSAAA=" ChangeKey="EQAAABBmNDjF"/>
</m:ContactIds>
<m:GroupIds>
<t:ItemId Id="AAMkADEzOTExYjJkBY7+0EAAA=" ChangeKey="EgAAAA=="/>
</m:GroupIds>
<m:ExtendedProperties>
<t:ExtendedProperty PropertyTag="0x3001" PropertyType="String"/>
</m:ExtendedProperties>
</m:GetImItems>
</soap:Body>
</soap:Envelope>
请求 SOAP 正文包含以下元素:
成功的 GetImItems 操作响应
以下示例演示了成功响应 GetImItems 请求以获取 IM 联系人和组。 在扩展属性中请求显示名称。 IM 联系人以角色的形式返回。
<?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="8"
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">
<GetImItemsResponse ResponseClass="Success"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<ImItemList>
<Groups xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<ImGroup>
<DisplayName>Exchange SDK Team</DisplayName>
<GroupType>IPM.DistList.MOC.UserGroup</GroupType>
<ExchangeStoreId Id="AAMkADEzQrAABY7+0EAAA=" ChangeKey="EgAAAA=="/>
<MemberCorrelationKey>
<ItemId Id="AAMkADEzOTExYjeGgGqm4QrAABmEhpSAAA=" ChangeKey="EQAAAA=="/>
</MemberCorrelationKey>
<ExtendedProperties>
<ExtendedProperty>
<ExtendedFieldURI PropertyTag="0x3001" PropertyType="String"/>
<Value>Exchange SDK Team</Value>
</ExtendedProperty>
</ExtendedProperties>
</ImGroup>
</Groups>
<Personas xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Persona>
<PersonaId Id="AAQkADEzOTBZImBzN5J/uHXc="/>
<PersonaType>Person</PersonaType>
<CreationTime>2012-11-07T00:10:35Z</CreationTime>
<DisplayName>Tony Smith</DisplayName>
<DisplayNameFirstLast>Tony Smith</DisplayNameFirstLast>
<DisplayNameLastFirst>Tony Smith</DisplayNameLastFirst>
<FileAs/>
<FileAsId>None</FileAsId>
<ImAddress>tsmith@contoso.com</ImAddress>
<RelevanceScore>2147483647</RelevanceScore>
<Attributions>
<Attribution>
<Id>0</Id>
<SourceId Id="AAMkADEzhQaoeGgGqm4QrAABmEhpSAAA=" ChangeKey="EQArAABmNDjF"/>
<DisplayName>Lync Contacts</DisplayName>
<IsWritable>false</IsWritable>
<IsQuickContact>true</IsQuickContact>
<IsHidden>false</IsHidden>
</Attribution>
</Attributions>
<DisplayNames>
<StringAttributedValue>
<Value>Tony Smith</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</StringAttributedValue>
</DisplayNames>
<FileAsIds>
<StringAttributedValue>
<Value>None</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</StringAttributedValue>
</FileAsIds>
<ImAddresses>
<StringAttributedValue>
<Value>tsmith@contoso.com</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</StringAttributedValue>
</ImAddresses>
<ExtendedProperties>
<ExtendedPropertyAttributedValue>
<Value>
<ExtendedFieldURI PropertyTag="0x3001" PropertyType="String"/>
<Value>Tony Smith</Value>
</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</ExtendedPropertyAttributedValue>
</ExtendedProperties>
</Persona>
</Personas>
</ImItemList>
</GetImItemsResponse>
</s:Body>
</s:Envelope>
响应 SOAP 正文包含以下元素:
FileAsId FileAsId
GetImItems 操作错误响应
GetImItems 操作不会验证标识符,如果向服务提供了无效的联系人或组标识符,则不会返回预期的 ErrorInvalidImContactId 或 ErrorInvalidImGroupId 错误响应。