Accessing user created Exchange 2011 calendars through Exchange Web Services (SOAP)
Hi,
I am trying to access a calendar hosted by Microsoft Exchange 2007 through Exchange Web Services. To build up the SOAP request, I am using a class based on the work done here:
http://www.howtoforge.com/talking-soap-with-exchange
The PHP is all functioning exactly as expected, so this is not a PHP question. Indeed, I am able to access the default user calender perfectly, by using the following construction:
---
$FindItem->Traversal = "Shallow";
$FindItem->ItemShape->Base Shape = "AllProperties";
$FindItem->ParentFolderIds ->Distingu ishedFolde rId->Mailb ox->EmailA ddress = "user@domain.com";
$FindItem->ParentFolderIds ->Distingu ishedFolde rId->Id = "calendar";
$result = $client->FindItem($FindIte m);
---
However, the target I really want to access is not the default user calendar (using the special 'calendar' identifier), but an additional user created calendar (several, in fact). This is the sort you can make in Outlook when you create a new folder of type calendar.
Doing this for user created mail folders is straight forward, as one can obtain an Id and ChangeKey from a FindFolder operation and plug it into the FindItem call, as below.
---
$FindItem->ParentFolderIds ->FolderId ->Id = "id_from_FindFolder_result "
$FindItem->ParentFolderIds ->FolderId ->ChangeKe y = "ChangeKey_from_FindFolder _result"
---
If you run the FindFolder operation at root level (Top of Information Store), using Traversal = 'Deep', an exhaustive list of all mail folders will appear (and Notes too), but no calendar folders.
My question is... How do I construct a FindFolder operation to include calendar folders? As mentioned earlier, addressing the default user calendar is easy, what with the reserved Ids available, laid out by Microsoft at the links below. I dare say I could address these calendars with FindItem, but need FindFolder to obtain the Id and ChangeKey to plug into it.
http://msdn.microsoft.com/en-us/library/aa563918(v=exchg.80).aspx
http://msdn.microsoft.com/en-us/library/aa580808(v=exchg.80).aspx
Any help would be most appreciated. Do ask questions if I've not been clear enough.
Best wishes,
Richard
I am trying to access a calendar hosted by Microsoft Exchange 2007 through Exchange Web Services. To build up the SOAP request, I am using a class based on the work done here:
http://www.howtoforge.com/talking-soap-with-exchange
The PHP is all functioning exactly as expected, so this is not a PHP question. Indeed, I am able to access the default user calender perfectly, by using the following construction:
---
$FindItem->Traversal = "Shallow";
$FindItem->ItemShape->Base
$FindItem->ParentFolderIds
$FindItem->ParentFolderIds
$result = $client->FindItem($FindIte
---
However, the target I really want to access is not the default user calendar (using the special 'calendar' identifier), but an additional user created calendar (several, in fact). This is the sort you can make in Outlook when you create a new folder of type calendar.
Doing this for user created mail folders is straight forward, as one can obtain an Id and ChangeKey from a FindFolder operation and plug it into the FindItem call, as below.
---
$FindItem->ParentFolderIds
$FindItem->ParentFolderIds
---
If you run the FindFolder operation at root level (Top of Information Store), using Traversal = 'Deep', an exhaustive list of all mail folders will appear (and Notes too), but no calendar folders.
My question is... How do I construct a FindFolder operation to include calendar folders? As mentioned earlier, addressing the default user calendar is easy, what with the reserved Ids available, laid out by Microsoft at the links below. I dare say I could address these calendars with FindItem, but need FindFolder to obtain the Id and ChangeKey to plug into it.
http://msdn.microsoft.com/en-us/library/aa563918(v=exchg.80).aspx
http://msdn.microsoft.com/en-us/library/aa580808(v=exchg.80).aspx
Any help would be most appreciated. Do ask questions if I've not been clear enough.
Best wishes,
Richard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BTW, you don't need the change key if you are just reading.
ASKER
Thanks for the tip about the ChangeKey. Are there any other PHP classes you can recommend that interface with EWS for these type of operations?
I don't know, sorry - I only use VB.Net. How about the author of the class? Do they give contact details?
Do you get any calendar folders returned if you try a Shallow traversal on msgfolderroot ?
Do you get any calendar folders returned if you try a Shallow traversal on msgfolderroot ?
ASKER
Thanks Lee. You set me on the right course. I was referencing the result too far down the tree.
I was looking at:
$result->ResponseMessages- >FindFolde rResponseM essage->Ro otFolder-> Folders->F older;
When, for a calendar, I should have been looking at:
$result->ResponseMessages- >FindFolde rResponseM essage->Ro otFolder-> Folders->C alendarFol der;
Thanks very much,
I was looking at:
$result->ResponseMessages-
When, for a calendar, I should have been looking at:
$result->ResponseMessages-
Thanks very much,
ASKER
Lee set me on the right track