Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call Exchange Web Services GetUserAvailabilityRequest when current timezone does not observe daylight savings time?

I am attempting to call GetUserAvailabilityRequest from South Africa Standard Time which does not observe daylight savings time, however, the TimeZone element requires StandardTime and DaylightTime sub-elements which require details about the cutover to or from DST. Omitting these elements results in an error, as does submitting arbitrary data. Does anyone know the proper way to make this call?

More detail based on comments from @jan-doggen. In this example, user is based in South Africa Standard Time

request (with arbitrary ST and DST change date of January 1)

<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>
    <GetUserAvailabilityRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
        <t:TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
            <Bias>-120</Bias>
            <StandardTime>
                <Bias>0</Bias>
                <Time>00:00:00</Time>
                <DayOrder>1</DayOrder>
                <Month>1</Month>
                <DayOfWeek>Wednesday</DayOfWeek>
            </StandardTime>
            <DaylightTime>
                <Bias>0</Bias>
                <Time>00:00:00</Time>
                <DayOrder>1</DayOrder>
                <Month>1</Month>
                <DayOfWeek>Wednesday</DayOfWeek>
            </DaylightTime>
        </t:TimeZone>
        <MailboxDataArray>
            <t:MailboxData>
                <t:Email>
                    <t:Address>[email protected]</t:Address>
                </t:Email>
                <t:AttendeeType>Organizer</t:AttendeeType>
                <t:ExcludeConflicts>false</t:ExcludeConflicts>
            </t:MailboxData>
            <t:MailboxData>
                <t:Email>
                    <t:Address>[email protected]</t:Address>
                </t:Email>
                <t:AttendeeType>Required</t:AttendeeType>
                <t:ExcludeConflicts>false</t:ExcludeConflicts>
            </t:MailboxData>
        </MailboxDataArray>
        <t:FreeBusyViewOptions>
            <t:TimeWindow>
                <t:StartTime>2013-05-13T00:55:11</t:StartTime>
                <t:EndTime>2013-05-27T00:55:11</t:EndTime>
            </t:TimeWindow>
            <t:MergedFreeBusyIntervalInMinutes>15</t:MergedFreeBusyIntervalInMinutes>
            <t:RequestedView>FreeBusyMerged</t:RequestedView>
        </t:FreeBusyViewOptions>
    </GetUserAvailabilityRequest>
</soap:Body>

Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
    <s:Fault>
        <faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:-2146233088</faultcode>
        <faultstring xml:lang="en-US">The specified time zone isn't valid.</faultstring>
        <detail>
            <m:ErrorCode xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">-2146233088</m:ErrorCode>
        </detail>
    </s:Fault>
</s:Body>

like image 638
Greg Martin Avatar asked May 06 '13 13:05

Greg Martin


People also ask

Do all time zones do Daylight Savings?

As of August 2021, the following states and territories are not observing DST: Arizona, Hawaii, American Samoa, Guam, The Northern Mariana Islands, Puerto Rico, and the Virgin Islands.

Which time zone does not change?

Today, most of Arizona (except the Navajo Nation), Hawaii, the Northern Mariana Islands, Puerto Rico, Guam, American Samoa, and the U.S. Virgin Islands don't change their clocks.


2 Answers

All of the examples on MSDN show that Standard and Daylight times have different values for the <Month>. Use different month values but the same <Bias> value for both Daylight and Standard time zones.

like image 62
William Price Avatar answered Oct 27 '22 05:10

William Price


Thanks to @WilliamPrice's comment I have managed to resolve this. The answer was to set the Daylight Time month to a different value than the Standard Time when setting those values arbitrarily:

    <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>
    <GetUserAvailabilityRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
        <t:TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
            <Bias>-120</Bias>
            <StandardTime>
                <Bias>0</Bias>
                <Time>00:00:00</Time>
                <DayOrder>1</DayOrder>
                <Month>1</Month>
                <DayOfWeek>Wednesday</DayOfWeek>
            </StandardTime>
            <DaylightTime>
                <Bias>0</Bias>
                <Time>00:00:00</Time>
                <DayOrder>1</DayOrder>
                **<Month>2</Month>**
                <DayOfWeek>Wednesday</DayOfWeek>
            </DaylightTime>
        </t:TimeZone>
        <MailboxDataArray>
            <t:MailboxData>
                <t:Email>
                    <t:Address>[email protected]</t:Address>
                </t:Email>
                <t:AttendeeType>Organizer</t:AttendeeType>
                <t:ExcludeConflicts>false</t:ExcludeConflicts>
            </t:MailboxData>
            <t:MailboxData>
                <t:Email>
                    <t:Address>[email protected]</t:Address>
                </t:Email>
                <t:AttendeeType>Required</t:AttendeeType>
                <t:ExcludeConflicts>false</t:ExcludeConflicts>
            </t:MailboxData>
        </MailboxDataArray>
        <t:FreeBusyViewOptions>
            <t:TimeWindow>
                <t:StartTime>2013-05-13T00:55:11</t:StartTime>
                <t:EndTime>2013-05-27T00:55:11</t:EndTime>
            </t:TimeWindow>
            <t:MergedFreeBusyIntervalInMinutes>15</t:MergedFreeBusyIntervalInMinutes>
            <t:RequestedView>FreeBusyMerged</t:RequestedView>
        </t:FreeBusyViewOptions>
    </GetUserAvailabilityRequest>
</soap:Body>
like image 3
Greg Martin Avatar answered Oct 27 '22 04:10

Greg Martin