Skip to content

Instantly share code, notes, and snippets.

@rpunt
Created March 16, 2013 14:07
Show Gist options
  • Save rpunt/5176539 to your computer and use it in GitHub Desktop.
Save rpunt/5176539 to your computer and use it in GitHub Desktop.
A SOAP message that will retrieve a conference room's schedule for the day in Exchange 2010.
// for some reason, Exchange Web Services seems to ignore the DST-specific bias settings, and only refer to the
// master bias.
// set the master bias here.
int bias = abs([[NSTimeZone systemTimeZone] secondsFromGMT] / 60);
NSString *soapMessage = [NSString stringWithFormat:@""
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
@"<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>%i</Bias>"
@"<StandardTime>"
@"<Bias>0</Bias>"
@"<Time>02:00:00</Time>"
@"<DayOrder>3</DayOrder>"
@"<Month>11</Month>"
@"<DayOfWeek>Sunday</DayOfWeek>"
@"</StandardTime>"
@"<DaylightTime>"
@"<Bias>-60</Bias>"
@"<Time>02:00:00</Time>"
@"<DayOrder>3</DayOrder>"
@"<Month>3</Month>"
@"<DayOfWeek>Sunday</DayOfWeek>"
@"</DaylightTime>"
@"</t:TimeZone>"
@"<MailboxDataArray>"
@"<t:MailboxData>"
@"<t:Email>"
@"<t:Address>%@</t:Address>"
@"</t:Email>"
@"<t:AttendeeType>Required</t:AttendeeType>"
@"<t:ExcludeConflicts>false</t:ExcludeConflicts>"
@"</t:MailboxData>"
@"</MailboxDataArray>"
@"<t:FreeBusyViewOptions>"
@"<t:TimeWindow>"
@"<t:StartTime>%@T00:00:00</t:StartTime>"
@"<t:EndTime>%@T23:59:59</t:EndTime>"
@"</t:TimeWindow>"
@"<t:MergedFreeBusyIntervalInMinutes>60</t:MergedFreeBusyIntervalInMinutes>"
@"<t:RequestedView>Detailed</t:RequestedView>"
@"</t:FreeBusyViewOptions>"
@"</GetUserAvailabilityRequest>"
@"</soap:Body>"
@"</soap:Envelope>"
@"", bias, room, date, date];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment