Sunday, February 11, 2007

Reading Exchange Public Calendar folder using WebDAV

WebDAV is the only choice you have to programmatically access an Exchange Server 2000/2003 public calendar folder, either to read or write.

I ave read about web services support in Exchange 2007, but not yet tested that.


Marc has a great post showing how to access a calendar folder using C# Using .NET and WebDAV to access an Exchange server

Using WebDAV is not easy, you have to compose the proper formatted XML request and then wait to the response and parse it to get the results, when you need to query using dates; which is the case for Calendars you have to use a special format inside the XML request.

I have used a WebDAV wrapper library which was great in hiding those details; it offers wrapping classes like Calendar and Contact with properties and method which carries all the XML stuff for you; the library has samples in both VB.net and C#.

There is one free wrapper; which I didn't use myself ... but the library seems to be updated regularly (http://www.infinitec.de/libraries/exchange/infinitec_exchange_0_99_2.aspx)

The only drawback of using WebDAV is requirement of a new HTTP connection for each request.

When a large number of requests is required (like doing a request for each appointment in a personal calendar folder) you simply exceed the number of outgoing HTTP requests that a server can handle, using .net we get a WebException in this situation because an HTTP request object can't been created.

No comments: