Platform SDK: Exchange 2000 Server

HTTP/WebDAV Search Folder Creation Protocol Commands

[This is preliminary documentation and subject to change.]

You create a persisted search folder using the HTTP/WebDAV MKCOL command that contains a special set of HTTP headers, and an XML formatted request body containing the SQL search command. The following list outlines these HTTP protocol elements:

Command Part Description
MKCOL Command A standard MKCOL (make collection) protocol command to create a folder (collection). The request must contain the headers and request body listed in the following items to be identified as a persisted search folder creation command.
Colltype: Header This mandatory HTTP header with the value "<DAV:searchcol>" to indicate to the Internet Information Services instance that you want to create a persisted search folder. This header is mandatory for creating persisted search folders. If this header is not present, creation of a standard folder is attempted.
Timeout: Header This mandatory header indicates how long (in minutes) the creation of the persisted folder can proceed before timing out. The WebDAV service may not necessarily honor this timeout period. In most cases, you send the value "Infinite".
Content-Type: Header This mandatory header must have the value "text/xml", and the request body must contain a valid <DAV:searchrequest> XML body. The body must contain the search command used to construct the contents of the search folder.
text/xml request body. The request body must be well formed XML containing a SQL search used to populate the persisted search folder. You use the same XML structure here as you do when executing an HTTP/WebDAV SEARCH command.

The following is an example of a persisted search folder HTTP/WebDAV request. The XML portion has been formatted with extra spaces to aid reading and need not be formatted exactly in this way.

MKCOL /folderpath/persisted_search_folder/ HTTP/1.1
Host: somedomain.microsoft.com
Content-Length: XXX
Content-type: text/xml
Timeout: Infinite
Colltype: <DAV:searchcol>

<?xml version="1.0"?>
<a:searchrequest xmlns:a="DAV:">
  <a:sql>
   SELECT * 
   FROM scope('shallow traversal of "http://somedomain.microsoft.com/public folders/myfolder"')
   WHERE "DAV:ishidden" = False 
   AND "DAV:contentclass" = "urn:schemas-mydomain-tld:specification"
  </a:sql>
</a:searchrequest>