Cook Computing

Outlook Web Access and WebDAV

December 19, 2002 Written by Charles Cook

I was experimenting with Outlook Web Access (OWA) and ProxyTrace yesterday after I read that OWA uses the WebDAV protocol. The first thought that came to mind was that there must be some pretty impressive JavaScript to make this possible and, sure enough, I found eight .js files in the IE cache with a total size of 181KB.

ProxyTrace reveals heavy use of the SEARCH WebDAV method. This is still at the draft stage and is used here to specify a range and ordering for the multistatus response from the server. A standard PROPFIND request would not work very well for displaying items in the Inbox. For example if the Inbox contains 5000 items and you only want to display the first 50 in most recent first order.

The request body for retrieving list of folders and associated properties is as follows (yes, it is invalid XML):


<searchrequest xmlns="DAV:">
 <sql> Select 
  "DAV:displayname",
  "DAV:href",
  "http://schemas.microsoft.com/exchange/content-href",
  "DAV:hassubs",
 "urn:schemas:httpmail:unreadcount",
 "DAV:contentclass",
 "http://schemas.microsoft.com/exchange/smallicon" 
 FROM Scope('HIERARCHICAL TRAVERSAL OF ""') 
 WHERE "DAV:ishidden" = false
 </>
</>

The contents of the inbox are retrieved with a slightly more complex request. Note the use of the range element to restrict the number of entries in the DAV multistatus response:


<searchrequest xmlns="DAV:">
 <sql>SELECT  
  "http://schemas.microsoft.com/exchange/x-priority-long" as prop1,
  "http://schemas.microsoft.com/exchange/smallicon" as prop2,
  "http://schemas.microsoft.com/mapi/proptag/x10900003" as prop3,
  "urn:schemas:httpmail:hasattachment" as prop4,
  "http://schemas.microsoft.com/mapi/sent_representing_name" as prop5, 
  "http://schemas.microsoft.com/mapi/subject" as prop6,
  "urn:schemas:httpmail:datereceived" as prop7,
  "http://schemas.microsoft.com/mapi/proptag/x0e080003" as prop8,
  "urn:schemas:httpmail:read" as read,
  "http://schemas.microsoft.com/exchange/outlookmessageclass" as messageclass,
  "DAV:href" as davhref
  FROM Scope('SHALLOW TRAVERSAL OF ""')
  WHERE "http://schemas.microsoft.com/mapi/proptag/0x67aa000b" = false 
   AND "DAV:isfolder" = false
  ORDER BY 
  "http://schemas.microsoft.com/mapi/proptag/x10900003" ASC,
  "urn:schemas:httpmail:datereceived"  DESC 
 </sql>
 <range type="row">0-24</range>
</searchrequest>

I was interested in determining whether performance using WebDAV is better than MAPI so I implemented a test with my .NET WebDAV library. WebDAV calls turned out to be significantly slower but this was maybe because the connection was being closed after each call and the NTLM authentication process was being repeated each time. I need to look into this further.

This article provides some information on OWA and WebDAV.