Exchange WebDAV Programming
Exchange WebDAV Programming
Exchange 2000 exposes mailbox and public folder data via WebDAV (Web Distributed Authoring and Versioning), an extension of HTTP. WebDAV allows you to create, read, update, and delete items using standard HTTP methods.
WebDAV Methods
| Method | Purpose |
|---|---|
| PROPFIND | Retrieve properties of a resource (folder listing, message headers) |
| PROPPATCH | Set or modify properties on a resource |
| SEARCH | Execute a SQL-like query against the store |
| GET | Retrieve the content of a resource (message body) |
| PUT | Create or replace a resource |
| DELETE | Delete a resource |
| MOVE | Move a resource to another folder |
| COPY | Copy a resource |
| MKCOL | Create a new collection (folder) |
URL Structure
Exchange WebDAV URLs follow this pattern:
http://server/exchange/username/Inbox/ http://server/exchange/username/Calendar/ http://server/public/FolderName/
Searching with WebDAV SEARCH
The SEARCH method accepts a SQL-like query in the request body:
<?xml version="1.0"?>
<searchrequest xmlns="DAV:">
<sql>
SELECT "DAV:displayname", "urn:schemas:httpmail:subject",
"urn:schemas:httpmail:datereceived"
FROM SCOPE('SHALLOW TRAVERSAL OF
"http://server/exchange/jsmith/Inbox/"'
)
WHERE "DAV:ishidden" = false
AND "DAV:isfolder" = false
ORDER BY "urn:schemas:httpmail:datereceived" DESC
</sql>
</searchrequest>
Authentication
WebDAV supports NTLM, Basic, and Negotiate authentication. For programmatic access, use NTLM or pass credentials with the XMLHTTP object. Always use HTTPS in production to protect credentials.