3.2 Retrieving Extended Properties

The following example gets a message and retrieves the three specified extended properties.

The client constructs the request XML and sends it to the server. The client is requesting the specified message with the three named extended properties — Expiration Date, Employee Type, and MyFlag. The PropertySetId attribute values are GUIDs, and are shown in the following examples. Note that the ItemId and ChangeKey attributes have been shortened to preserve readability.

   <?xml version="1.0" encoding="utf-8"?>
   <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" 
         xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
     <soap:Header>
       <t:RequestServerVersion Version="Exchange2013" />
     </soap:Header>
     <soap:Body>
       <m:GetItem>
         <m:ItemShape>
           <t:BaseShape>IdOnly</t:BaseShape>
           <t:AdditionalProperties>
             <t:ExtendedFieldURI PropertySetId="c11ff724-aa03-4555-9952-8fa248a11c3e" PropertyName="Expiration Date" PropertyType="String" />
             <t:ExtendedFieldURI PropertySetId="24a3075f-a8b7-4181-a9ed-708a947b8765" PropertyName="Employee Type" PropertyType="String" />
             <t:ExtendedFieldURI PropertySetId="75a5486f-9267-49ca-9b4e-3d04ca9ec179" PropertyName="MyFlag" PropertyType="Integer" />
           </t:AdditionalProperties>
         </m:ItemShape>
         <m:ItemIds>
           <t:ItemId Id="AAMkAGIwODEy" ChangeKey="CQAAABYAAA" />
         </m:ItemIds>
       </m:GetItem>
     </soap:Body>
   </soap:Envelope>

The server constructs the response XML and sends it to the client. In this example, three extended properties are returned; these are the custom properties that were generated when the message was created. The PropertySetId, PropertyName, and PropertyType attributes are included in the response.

   <?xml version="1.0" encoding="utf-8"?>
   <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
     <s:Header>
       <h:ServerVersionInfo MajorVersion="14" MinorVersion="1" MajorBuildNumber="63" MinorBuildNumber="0" 
           Version="Exchange2013" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" 
           xmlns="http://schemas.microsoft.com/exchange/services/2006/types" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
     </s:Header>
     <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" 
           xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
           <m:GetItemResponseMessage ResponseClass="Success">
             <m:ResponseCode>NoError</m:ResponseCode>
             <m:Items>
               <t:Message>
                 <t:ItemId Id="AAMkAGIwODEy" ChangeKey="CQAAABYAAA" />
                 <t:ExtendedProperty>
                   <t:ExtendedFieldURI PropertySetId="c11ff724-aa03-4555-9952-8fa248a11c3e" 
                      PropertyName="Expiration Date" PropertyType="String" />
                   <t:Value>12/25/2009 3:25:15 PM </t:Value>
                 </t:ExtendedProperty>
                 <t:ExtendedProperty>
                   <t:ExtendedFieldURI PropertySetId="24a3075f-a8b7-4181-a9ed-708a947b8765" 
                      PropertyName="Employee Type" PropertyType="String" />
                   <t:Value>Part Time</t:Value>
                 </t:ExtendedProperty>
                 <t:ExtendedProperty>
                   <t:ExtendedFieldURI PropertySetId="75a5486f-9267-49ca-9b4e-3d04ca9ec179" 
                      PropertyName="MyFlag" PropertyType="Integer" />
                   <t:Value>4</t:Value>
                 </t:ExtendedProperty>
               </t:Message>
             </m:Items>
           </m:GetItemResponseMessage>
         </m:ResponseMessages>
       </m:GetItemResponse>
     </s:Body>
   </s:Envelope>
Show: