Операция GetItem (контакт)
Операция GetItem используется для получения элементов контактов из хранилища Exchange.
Пример запроса GetItem (Contact)
Описание
В следующем примере показано, как получить элемент из хранилища Exchange.
Код
<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="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<GetItem xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'>
<ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</ItemShape>
<ItemIds>
<t:ItemId Id="AAAtAE=" ChangeKey="EQAAABY" />
</ItemIds>
</GetItem>
</soap:Body>
</soap:Envelope>
Comments
Запрос на получение элемента из хранилища Exchange принимает одинаковую форму для всех типов элементов. Ответы на запросы для разных элементов будут разными, так как разные элементы возвращают разные сведения в зависимости от форм ответа.
Примечание.
Идентификатор элемента сокращен для сохранения удобочитаемости.
Элементы запроса
В запросе используются следующие элементы:
Успешный ответ GetItem (Contact)
Описание
В следующем примере кода показан успешный ответ GetItem для AllPropertiesBaseShape.
Код
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="602" MinorBuildNumber="0"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Contact>
<t:ItemId Id="AAAtAEA=" ChangeKey="EQAAABYq" />
<t:ParentFolderId Id="AQAtAEFk==" ChangeKey="AQAAAA==" />
<t:ItemClass>IPM.Contact</t:ItemClass>
<t:Sensitivity>Normal</t:Sensitivity>
<t:Body BodyType="Text" />
<t:DateTimeReceived>2006-08-18T17:31:18Z</t:DateTimeReceived>
<t:Size>382</t:Size>
<t:Importance>Normal</t:Importance>
<t:IsSubmitted>false</t:IsSubmitted>
<t:IsDraft>true</t:IsDraft>
<t:IsFromMe>false</t:IsFromMe>
<t:IsResend>false</t:IsResend>
<t:IsUnmodified>false</t:IsUnmodified>
<t:DateTimeSent>2006-08-18T17:31:18Z</t:DateTimeSent>
<t:DateTimeCreated>2006-08-18T17:31:18Z</t:DateTimeCreated>
<t:HasAttachments>false</t:HasAttachments>
<t:Culture>en</t:Culture>
<t:FileAs>SampleContact</t:FileAs>
<t:FileAsMapping>None</t:FileAsMapping>
<t:DisplayName>Tanja Plate</t:DisplayName>
<t:GivenName>Tanja</t:GivenName>
<t:Initials>T.P.</t:Initials>
<t:CompleteName>
<t:FirstName>Tanja</t:FirstName>
<t:LastName>Plate</t:LastName>
<t:Initials>T.P.</t:Initials>
<t:FullName>Tanja Plate</t:FullName>
</t:CompleteName>
<t:CompanyName>Northwind Traders</t:CompanyName>
<t:EmailAddresses>
<t:Entry Key="EmailAddress1">tplate@example.com</t:Entry>
<t:Entry Key="EmailAddress2">tplate@example.com</t:Entry>
</t:EmailAddresses>
<t:PhysicalAddresses>
<t:Entry Key="Business">
<t:Street>12345 67th Ave</t:Street>
<t:City>Whittier</t:City>
<t:State>CA</t:State>
<t:Country>USA</t:Country>
</t:Entry>
</t:PhysicalAddresses>
<t:PhoneNumbers>
<t:Entry Key="BusinessPhone">5625550199</t:Entry>
</t:PhoneNumbers>
<t:JobTitle>Project Manager</t:JobTitle>
<t:Surname>Plate</t:Surname>
</t:Contact>
</m:Items>
</m:GetItemResponseMessage>
</m:ResponseMessages>
</GetItemResponse>
</soap:Body>
</soap:Envelope>
Comments
Идентификатор элемента сокращен для сохранения удобочитаемости.
Элементы успешного отклика
Следующие элементы используются в ответе на запрос GetItem с формой ответа AllProperties для элемента контакта.
Пример недопустимого запроса GetItem (Contact)
Описание
В следующем примере кода показан недопустимый запрос.
Код
<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="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<GetItem xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'>
<ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
<t:IncludeMimeContent>true</t:IncludeMimeContent>
</ItemShape>
<ItemIds>
<t:ItemId Id="AAAtAEF=" ChangeKey="EQAAABq" />
</ItemIds>
</GetItem>
</soap:Body>
</soap:Envelope>
Comments
Идентификаторы элементов сокращены для сохранения удобочитаемости.
Ответ на ошибку GetItem (Contact)
Описание
В следующем примере кода показан ответ на ошибку на запрос GetItem (Contact).
Код
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="602" MinorBuildNumber="0"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Error">
<m:MessageText>Mime conversion is not supported for this item type.</m:MessageText>
<m:ResponseCode>ErrorUnsupportedMimeConversion</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Items />
</m:GetItemResponseMessage>
</m:ResponseMessages>
</GetItemResponse>
</soap:Body>
</soap:Envelope>
Элементы ответа на ошибку
В ответе на ошибку используются следующие элементы: