4 Protocol Examples

Clients use the GetServerTimeZones operation, as described in section 3.1.4.1, to request the list of time zones for which the server has definitions and then use this information when making requests to other web service protocols or to present time-based information to the user.

The following XML shows a request to retrieve time zones for Alaska Standard Time. The value of the ReturnFullTimeZoneData attribute indicates that all data is to be returned, as described in section 3.1.4.1.3.3.

 <?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">
   <soap:Header>
     <t:RequestServerVersion Version="Exchange2013"/>
   </soap:Header>
   <soap:Body
       xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
     <GetServerTimeZones ReturnFullTimeZoneData="true" >
       <Ids>
         <Id xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
             Alaskan Standard Time</Id> 
       </Ids>
     </GetServerTimeZones>
   </soap:Body>
 </soap:Envelope>

The following XML shows a successful response to the preceding GetServerTimeZones 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="698"
         MinorBuildNumber="10" 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">
     <m:GetServerTimeZonesResponse
         xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
         xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
       <m:ResponseMessages>
         <m:GetServerTimeZonesResponseMessage ResponseClass="Success">
           <m:ResponseCode>NoError</m:ResponseCode>
           <m:TimeZoneDefinitions>
             <t:TimeZoneDefinition Name="(UTC-09:00) Alaska"
                 Id="Alaskan Standard Time">
               <t:Periods>
                 <t:Period Bias="PT9H" Name="Standard"
                     Id="trule:Microsoft/Registry/Alaskan Standard Time/2006-Standard"/>
                 <t:Period Bias="PT8H" Name="Daylight"
                     Id="trule:Microsoft/Registry/Alaskan Standard Time/2006-Daylight"/>
                 <t:Period Bias="PT9H" Name="Standard"
                     Id="trule:Microsoft/Registry/Alaskan Standard Time/2007-Standard"/>
                 <t:Period Bias="PT8H" Name="Daylight"
                     Id="trule:Microsoft/Registry/Alaskan Standard Time/2007-Daylight"/>
               </t:Periods>
               <t:TransitionsGroups>
                 <t:TransitionsGroup Id="0">
                   <t:RecurringDayTransition>
                     <t:To Kind="Period">trule:Microsoft/Registry/
                         Alaskan Standard Time/2006-Daylight</t:To>
                     <t:TimeOffset>PT2H</t:TimeOffset>
                     <t:Month>4</t:Month>
                     <t:DayOfWeek>Sunday</t:DayOfWeek>
                     <t:Occurrence>1</t:Occurrence>
                   </t:RecurringDayTransition>
                   <t:RecurringDayTransition>
                     <t:To Kind="Period">trule:Microsoft/Registry/
                         Alaskan Standard Time/2006-Standard</t:To>
                     <t:TimeOffset>PT2H</t:TimeOffset>
                     <t:Month>10</t:Month>
                     <t:DayOfWeek>Sunday</t:DayOfWeek>
                     <t:Occurrence>-1</t:Occurrence>
                   </t:RecurringDayTransition>
                 </t:TransitionsGroup>
                 <t:TransitionsGroup Id="1">
                   <t:RecurringDayTransition>
                     <t:To Kind="Period">trule:Microsoft/Registry/
                         Alaskan Standard Time/2007-Daylight</t:To>
                     <t:TimeOffset>PT2H</t:TimeOffset>
                     <t:Month>3</t:Month>
                     <t:DayOfWeek>Sunday</t:DayOfWeek>
                     <t:Occurrence>2</t:Occurrence>
                   </t:RecurringDayTransition>
                   <t:RecurringDayTransition>
                     <t:To Kind="Period">trule:Microsoft/Registry/
                         Alaskan Standard Time/2007-Standard</t:To>
                     <t:TimeOffset>PT2H</t:TimeOffset>
                     <t:Month>11</t:Month>
                     <t:DayOfWeek>Sunday</t:DayOfWeek>
                     <t:Occurrence>1</t:Occurrence>
                   </t:RecurringDayTransition>
                 </t:TransitionsGroup>
               </t:TransitionsGroups>
               <t:Transitions>
                 <t:Transition>
                   <t:To Kind="Group">0</t:To>
                 </t:Transition>
                 <t:AbsoluteDateTransition>
                   <t:To Kind="Group">1</t:To>
                   <t:DateTime>2007-01-01T00:00:00</t:DateTime>
                 </t:AbsoluteDateTransition>
               </t:Transitions>
             </t:TimeZoneDefinition>
           </m:TimeZoneDefinitions>
         </m:GetServerTimeZonesResponseMessage>
       </m:ResponseMessages>
     </m:GetServerTimeZonesResponse>
   </s:Body>
 </s:Envelope>