Home
english
Home
WebDAV Server
WebDAV Client
WebDAV AJAX
Map Drive
Pricing
News
Contacts
info@ithit.com



WebDAV Server Samples, C#

The IT Hit WebDAV Server Engine is shipped with sample WebDAV Servers implementations that could be used as a starting point for understanding WebDAV server engine.

Sample WebDAV Features Hosting Storage Max File Size Authentication Remarks
WebDAVListener Class 1 MS SQL 2000/2005 or MS Access 2Gb NTLM Does not support MS Office and Web Folders on Vista
SQLStorage Class 1, Class 2 IIS 5.0 or later MS SQL 2000/2005 2Gb NTLM, Kerberos, Basic
Class2SqlListener Class 1, Class 2 MS SQL 2000/2005 2Gb NTLM
FileSystemListenerService Class1, simplified Class2 File system Unlimited NTLM, Kerberos Useful only for performance and Kerberos testing
DeltaV Class 1, Class 2, DeltaV MS SQL 2000/2005 and file system Unlimited NTLM, Kerberos, Basic, Digest

WebDAVListener Sample

WebDAVListener sample provides Class 1 WebDAV Server implementation. The server utilizes HttpListener class that was introduced in .Net Framework 2.0. For the sake of simplicity this sample was designed as a console application and requires minimum configuration. No IIS is required to run this server. Microsoft SQL Server or Microsoft Access could be used to store data. This sample does not support Microsoft Office applications and Web Folders on Windows Vista. The project is a Visual Studio 2005 Console Application, C# source codes.

Server Requirements:
.Net Framework 2.0 on Windows Server 2008, Windows Server 2003, Windows Vista or Windows XP SP2
Microsoft SQL Server 2000 / 2005 or Microsoft Access.

Running the Sample

  1. Place License.lic file in the folder where the compiled exe file resides (\bin).
  2. Create the database. The sample contains 2 databases located in '\Samples\WebDAVListener\DB' folder. MSAccessSample.mdb is a Microsoft Access database. MSSQLSample.sql is a script that creates and initializes the Microsoft SQL Server 2000/2005 database. Both databases initially contain several hierarchy items. Edit WebDAVServer.Listener.exe.config file located in '\bin' folder and change the connection string to the database.
  3. Change ListenerPrefix value. Specify url to which your server will be listening.

Finally run the exe file and connect to server with a Class 1 WebDAV client. Note that on Windows Vista you must select Run as Administrator from context menu. If you experience any problems with connecting to server examine the WebDAVLog.txt created in \bin folder. If you do not see the log file the requests do not reach the server.

SQLStorage Sample

SQLStorage sample provides Class 2 WebDAV Server implementation. The server runs as ASP.NET web application in IIS. This sample uses Microsoft SQL Server database to store data and utilizes Microsoft SQL Server particular features. For WebDAV Class 2 support ILock, IFolderLock and INullLock interfaces are implemented. Due to Class 2 support Microsoft Office applications and Windows Vista Web Folders could save files directly into WebDAV Server storage. This sample also utilizes transactions. The project is a Visual Studio 2005 Class Library, C# source codes.

Server Requirements:
ASP.NET 2.0 on Windows Server 2008, Windows Server 2003, Windows Vista, Windows XP or Windows 2000 Server,
Microsoft Data Access Components(MDAC) version 2.6 or later,
Microsoft SQL Server 2000 / 2005.

Running the Sample

  1. Place License.lic file in the root folder of your WebDAV server (\Samples\SqlStorage).
  2. Create the database. The database script located in \Samples\SqlStorage\DB folder. MSSQLSample.sql creates and initializes the Microsoft SQL Server 2000/2005 database. The script initially creates several folder items. Edit web.config file located in \Samples\SqlStorage and change the connection string to the database.
  3. Create web application in IIS that will be the root of your WebDAV server storage. Configure your web application to catch all WebDAV related verbs. If you plan to use Microsoft Web Folders as your WebDAV client we recommend dedicating the entire website to your WebDAV server (map you WebDAV server to the root of the website). Read Creating WebDAV Server Web Application in IIS.

Now connect to server with a WebDAV client. If you experience any problems with connecting to server examine the WebDAVLog.txt created in \SqlStorage folder. If you do not see the log file the requests do not reach the server or there are not enough permissions for crating the logfile.

Class2SqlListener Sample

This sample is very similar to SQLStorage sample but based on HttpListener. It it implements class 2 WebDAV server and utilizes asynchronous requests processing model. The project is a Visual Studio 2005 Console Application, C# source codes.

Server Requirements:
.Net Framework 2.0 on Windows Server 2008, Windows Server 2003, Windows Vista or Windows XP SP2
Microsoft Data Access Components(MDAC) version 2.6 or later,
Microsoft SQL Server 2000 / 2005.

Running the Sample

  1. Place License.lic file in the folder where the compiled exe file resides (\bin).
  2. Create the database. The database script located in \Samples\Class2SqlListener\DB folder. MSSQLSample.sql creates and initializes the Microsoft SQL Server 2000/2005 database. The script initially creates several folder items. Edit WebDAVServer.Class2SqlListener.exe.config file located in '\bin' folder. Change the connection string to the database.
  3. Edit ListenerPrefix value in bin\WebDAVServer.Class2SqlListener.exe.config. Specify url to which your server will be listening.
  4. Edit CustomHandlerPage value. Specify the path to MyCustomHandlerPage.html

Finally run the exe file and connect to server with a WebDAV client. Note that on Windows Vista you must select Run as Administrator from context menu. If you experience any problems with connecting to server examine the WebDAVLog.txt created in \bin folder. If you do not see the log file the requests do not reach the server.

FileSystemListenerService Sample

This sample provides simplified Class 2 WebDAV server example that runs as a Windows Service. It stores files directly in file system and not use any database. Because of the nature of the storage type it does not actually lock any resources and does not prevent resources from modifications as usually class 2 do. It also does not store any custom properties. This sample may be useful for performance and impersonation testing. The project is a Visual Studio 2005 Windows Service, C# source codes.

Server Requirements:
.Net Framework 2.0 on Windows Server 2008, Windows Server 2003, Windows Vista or Windows XP SP2

Running the Sample

  1. Place License.lic file in the folder where the compiled exe file resides (\bin).
  2. Edit the WebDAVServer.FileSystemListenerService.exe.config file located in '\bin' folder and change the path to the folder where files will be stored.
  3. Change ListenerPrefix value. Specify url to which your server will be listening.
  4. Register the service running 'installutil.exe WebDAVServer.FileSystemListenerService.exe' in a command prompt. Open Services snap-in and run the WebDAV FileSystemListener service.

Now connect to server with a WebDAV client. If you experience any problems with connecting to server examine the WebDAVLog.txt created in \bin folder. If you do not see the log file the requests do not reach the server.

DeltaV Sample

This sample is Class 1, Class 2 and DeltaV complaint WebDAV server. It is based on HttpListener and can run either as a stand-alone exe or as Windows Service. For best performance documents are stored in file system while structure and custom properties are stored in Microsoft SQL Server 2000/2005 database. This sample does not have any limitations on maximum file size. The sample supports Basic, Digest, NTLM and Kerberos authentication easily configured in application configuration file. It also demonstrates execution of all methods of interfaces implementation in a single transaction started at the beginning of each request and committed or rolled back at the end. C# source codes.

Server Requirements:
.Net Framework 2.0 on Windows Server 2008, Windows Server 2003, Windows Vista or Windows XP SP2
Microsoft Data Access Components(MDAC) version 2.6 or later,
Microsoft SQL Server 2000 / 2005.

Running the Sample

  1. Place License.lic file in the folder where the compiled exe file resides (\bin).
  2. Create the database. The database script located in \Samples\DeltaV\DB folder. DeltaV.sql creates and initializes the Microsoft SQL Server 2000/2005 database. The script initially creates several folder items. Edit WebDAVServer.DeltaV.exe.config file located in '\bin' folder. Change the connection string to the database.
  3. Edit RepositoryPath value in WebDAVServer.DeltaV.exe.config file located in '\bin' folder and change the path to the folder where files will be stored.
  4. Edit CustomHandlerPage value. Specify the path to MyCustomHandlerPage.html
  5. Finally you can either run the .exe or register the service.
    • If you run the .exe file note that on Windows Vista you must select Run as Administrator from context menu.
    • To register the service run running 'installutil.exe WebDAVServer.DeltaV.exe' in a command prompt. Open Services snap-in and run the DeltaVService service.

Now connect to server with a WebDAV client. If you experience any problems with connecting to server examine the WebDAVLog.txt created in \bin folder. If you do not see the log file the requests do not reach the server.

See Also:


What WebDAV software would you like to have?

Selected Customers:
Country: Norway
DnB NOR Group
Country: Finland
Bank of Finland
Country: United Kingdom
Bechtle Direct
Country: Sweden
BT Industries
Country: USA
California Chamber of Commerce
Country: Denmark
Danfoss Group
Country: Denmark
DFDS
Country: USA
Fluke Networks
Country: USA
HNI Corporation
Country: USA
IHS Inc
Country: USA
LandAmerica Financial Group
Country: Canada
Laurentian University
Country: USA
Microsoft
Country: Israel
RADVISION
Country: Ukraine
Raiffeisen Bank
Country: Netherlands
Sanoma Uitgevers
Country: USA
Siemens
Country: Australia
WorkCover NSW
Country: Ukraine
OTP Bank
Country: USA
Intel Corporation
Country: Austria
Austrian Federal Railways
Home WebDAV Server WebDAV Client WebDAV AJAX Map Drive Pricing News Contacts

Updated: Tuesday, February 26, 2008