Automatic Protocol Driver Selection

If the OLE DB Provider  for Internet Publishing has already cached the protocol driver for any URL which matches or prefixes the one to which the client is binding, that protocol driver is re-used for the new URL (but no new cache association is created). In response to certain failure conditions, the OLE DB Provider may conclude that the assumed protocol driver was not the correct one (see the discussion on Automatic Protocol Driver Reselection below) and will select a different protocol driver. In these cases, a new cache entry is saved referencing the new URL and the newly selected protocol driver.

If the OLE DB Provider does not have any cached information about a URL, it uses a two-tier mechanism to determine which protocol driver to use:

  • The OLE DB Provider issues an OPTIONS HTTP request to the Web server, in which the request-URL is the parent of the URL specified by the OLE DB client (usually in the call to IBindResource::Bind). If the server's response contains an MS-Author-Via header, and the header contains the string "MS-FP/4.0" before the string "DAV" (or doesn't contain the string "DAV" at all), the OLE DB Provider will use the WEC driver. Conversely, if the MS-Author-Via header contains the string "DAV" before the string "MS-FP/4.0" (or doesn't contain the string "MS-FP/4.0" at all), the OLE DB Provider will use the WebDAV driver.
  • If the server's response does not contain an MS-Author-Via header, the OLE DB Provider for Internet Publishing loads the WEC and WebDAV protocol drivers one at a time (WEC first, WebDAV second) and asks them, "Do you know how to handle this URL?", specifying the exact URL passed in by the client. The first protocol which responds "yes" is selected. If neither protocol driver responds "yes" then the method which triggered the automatic driver selection (usually IBindResource::Bind) fails with an OLE DB Provider for Internet Publishing specific error code IPP_E_SERVERTYPE_NOT_SUPPORTED.

When one of the protocol drivers indicates that it can handle the URL, it also specifies the URL where that support begins. For FrontPage, the URL will be the FrontPage web containing the resource. For WebDAV, the URL will either be the resource itself or the resource's parent (the latter is contacted only if the attempt to query the child results in "File not Found"). The association between this URL and the protocol driver is then cached.

The WEC protocol driver decides whether or not it can handle the URL by calling the IFpWebSite::UrlToWebUrl method in the COM WEC API.

The WebDAV driver decides whether or not it can handle the URL by issuing another OPTIONS request to the Web server and looking for the WebDAV header in the response.