Hi,
i am trying to connect to a exchange 2010 server to get all available appointments for a period of time. For this i am using the GetUserAvailabity Method from the Exchange Web Services. For example i have a time window from (2011-10-31 00:00:00 to 2011-11-07 00:00:00) with this information the code goes like this: TimeWindow pTimeWindow = new TimeWindow(rangeFrom, rangeTo); availabilityResults = m_sService.GetUserAvailability(m_sAttendees, pTimeWindow, AvailabilityData.FreeBusyAndSuggestions, m_sAvailabilityOptions); I only got the available appointment for the first day (2011-10-31 00:00 to 2011-11-01 00:00) and no other appointments so far. If i read everyday of this week as one day, i get all appointments, but i try to get the comparison of reading a time window day by day and reading the whole time window and sorting it then. So cann you tell me what my fault is, or did i misunderstood anything,
Thanks for your help,
Best regards from Germany,
Hartwig Pudzich
The XML- Files goes as following:
The Request:
<Trace Tag="EwsRequest" Tid="1" Time="2011-10-31 16:19:23Z" Version="14.02.0051.000">
<?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="Exchange2010" />
<t:TimeZoneContext>
<t:TimeZoneDefinition Name="(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien" Id="W. Europe Standard Time">
<t:Periods>
<t:Period Bias="-P0DT1H0M0.0S" Name="Standard" Id="Std" />
<t:Period Bias="-P0DT2H0M0.0S" Name="Daylight" Id="Dlt/1" />
</t:Periods>
<t:TransitionsGroups>
<t:TransitionsGroup Id="0">
<t:RecurringDayTransition>
<t:To Kind="Period">Dlt/1</t:To>
<t:TimeOffset>P0DT2H0M0.0S</t:TimeOffset>
<t:Month>3</t:Month>
<t:DayOfWeek>Sunday</t:DayOfWeek>
<t:Occurrence>-1</t:Occurrence>
</t:RecurringDayTransition>
<t:RecurringDayTransition>
<t:To Kind="Period">Std</t:To>
<t:TimeOffset>P0DT3H0M0.0S</t:TimeOffset>
<t:Month>10</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:Transitions>
</t:TimeZoneDefinition>
</t:TimeZoneContext>
</soap:Header>
<soap:Body>
<m:GetUserAvailabilityRequest>
<m:MailboxDataArray>
<t:MailboxData>
<t:Email>
<t:Address>MSchneider@lab.ads</t:Address>
</t:Email>
<t:AttendeeType>Required</t:AttendeeType>
<t:ExcludeConflicts>false</t:ExcludeConflicts>
</t:MailboxData>
</m:MailboxDataArray>
<t:FreeBusyViewOptions>
<t:TimeWindow>
<t:StartTime>2011-07-29T00:00:00</t:StartTime>
<t:EndTime>2011-07-30T00:00:00</t:EndTime>
</t:TimeWindow>
<t:MergedFreeBusyIntervalInMinutes>30</t:MergedFreeBusyIntervalInMinutes>
<t:RequestedView>Detailed</t:RequestedView>
</t:FreeBusyViewOptions>
<t:SuggestionsViewOptions>
<t:GoodThreshold>25</t:GoodThreshold>
<t:MaximumResultsByDay>48</t:MaximumResultsByDay>
<t:MaximumNonWorkHourResultsByDay>0</t:MaximumNonWorkHourResultsByDay>
<t:MeetingDurationInMinutes>60</t:MeetingDurationInMinutes>
<t:MinimumSuggestionQuality>Poor</t:MinimumSuggestionQuality>
<t:DetailedSuggestionsWindow>
<t:StartTime>2011-07-25T00:00:00</t:StartTime>
<t:EndTime>2011-08-01T00:00:00</t:EndTime>
</t:DetailedSuggestionsWindow>
</t:SuggestionsViewOptions>
</m:GetUserAvailabilityRequest>
</soap:Body>
</soap:Envelope>
</Trace>
The Request- Header:
<Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2011-10-31 16:19:23Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/14.02.0051.000
Accept-Encoding: gzip,deflate
</Trace>
The Response:
<Trace Tag="EwsResponse" Tid="1" Time="2011-10-31 16:19:23Z" Version="14.02.0051.000">
<?xml version="1.0" encoding="utf-8"?>
<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="de-DE">The SuggestionsViewOptions.DetailedSuggestionsWindow must fall within the FreeBusyViewOptions.TimeWindow.</faultstring>
<detail>
<m:ErrorCode xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">-2146233088</m:ErrorCode>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
</Trace>
The Response Header:
<Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2011-10-31 16:19:23Z">
500 Internal Server Error
Transfer-Encoding: chunked
Persistent-Auth: true
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Mon, 31 Oct 2011 16:19:13 GMT
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
</Trace>