locked
EWS Managed API GetUserAvailability method is returning wrong suggestions RRS feed

  • Question

  • Hi there,

    I am using EWS Managed API for retrieving suggestions for arranging meetings. In fact, I'm using the GetUserAvailability function but I'm having some problems with the time zones.

    If I set my working calendar from 8am to 5pm and my time zone in GMT+1 (Paris), I get all the suggestions for a given day from 8am to 5pm. Everything is working fine.

    But if I change my time zone to GMT-6 (Houston), then I'm getting the suggestions from 1am to 10am. It seems that the server is taking my old time zone (which is also its time zone), and subtracting the 7 hours of difference between the two time zones.

    Does it mean that the Exchange server is calculating properly the suggestions but before retrieving them to me it applies a subtract for matching my time zone?

    What if I trying to get suggestions for two people with different time zones (Houston and New York, for instance)?

    I have read this interesting article, but it only gives solution for EWS, not for EWS Managed API. Is there any way to solve this problem with EWS Managed API?

    I have also tried to update the EWS DLL from version 1.1 to 2.0, but it works in the same wrong way than the previous one.

    Any brilliant mind who can help to solve this annoying problem?

    Thanks in advance.

    Regards.

    Thursday, September 25, 2014 7:09 PM

All replies

  • I'd start with enabling tracing http://msdn.microsoft.com/en-us/library/office/dd633676(v=exchg.80).aspx and have a look at what the actual time zone is that is being submitted in the request.

    You might also want to do some testing using the EWSeditor http://ewseditor.codeplex.com/ (if you change the global options you can set the timezone used when it send requests).

    Cheers
    Glen

    Friday, September 26, 2014 6:04 AM
  • Hi,

    I've enabled tracing for EWS, and this is a little bit of the XML response that I'm getting when I set my time zone in Houston (-6:00):

    <Trace Tag="EwsResponse" Tid="1" Time="2014-09-26 11:00:46Z" Version="15.00.0516.014">
      <?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="3" MajorBuildNumber="342" MinorBuildNumber="0" Version="Exchange2007_SP1" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
        </soap:Header>
        <soap:Body>
          <GetUserAvailabilityResponse xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
            <SuggestionsResponse>
              <ResponseMessage ResponseClass="Success">
                <ResponseCode>NoError</ResponseCode>
              </ResponseMessage>
              <SuggestionDayResultArray>
                <SuggestionDayResult xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
                  <Date>2014-09-26T00:00:00</Date>
                  <DayQuality>Excellent</DayQuality>
                  <SuggestionArray>
                    <Suggestion>
                      <MeetingTime>2014-09-26T08:00:00+02:00</MeetingTime>
                      <IsWorkTime>true</IsWorkTime>
                      <SuggestionQuality>Excellent</SuggestionQuality>
                      <AttendeeConflictDataArray>
                        <IndividualAttendeeConflictData>
                          <BusyType>Free</BusyType>
                        </IndividualAttendeeConflictData>
                      </AttendeeConflictDataArray>
                    </Suggestion>
                    <Suggestion>
                      <MeetingTime>2014-09-26T08:30:00+02:00</MeetingTime>
                      <IsWorkTime>true</IsWorkTime>
                      <SuggestionQuality>Excellent</SuggestionQuality>
                      <AttendeeConflictDataArray>
                        <IndividualAttendeeConflictData>
                          <BusyType>Free</BusyType>
                        </IndividualAttendeeConflictData>
                      </AttendeeConflictDataArray>
                    </Suggestion>
                    <Suggestion>
                      <MeetingTime>2014-09-26T09:00:00+02:00</MeetingTime>
                      <IsWorkTime>true</IsWorkTime>
                      <SuggestionQuality>Excellent</SuggestionQuality>
                      <AttendeeConflictDataArray>
                        <IndividualAttendeeConflictData>
                          <BusyType>Free</BusyType>
                        </IndividualAttendeeConflictData>
                      </AttendeeConflictDataArray>
                    </Suggestion>
                    ...

    Having my working time from 8:00am to 5:00pm, the suggestions here in the XML response seem to be OK.

    But I think I'm suffering the same problem described here: when the XML response is serialized into Suggestion class and I get it on my application, the hour of the suggestions have changed to 1:00am, 1:30am, etc.

    Any idea?


    Friday, September 26, 2014 11:10 AM