Skip to content
Duarte Nunes edited this page Feb 23, 2011 · 4 revisions

HOL 1

Setting up the work directory

  • Clone the session's source code, used for exercises and samples, and place it in a directory henceforth known as %WCFHOME%.

You can use Git to clone the repository or download a zip (note that you may have to update the source for the exercises later on).

  • Retrieve the code from the WCF HTTP codeplex page and place it in %WCFHOME%\wcf.codeplex.com. You have to create this directory.

You can use Mercurial do clone the repository or download a zip file with the sources.

Exercise 1

Given the files in %WCFHOME%\Files, create a resource that performs lookups in that directory. The resource responds to GET requests that specify a file name.

  1. Decide which file is sent to the client based on the extension.
  2. Support special text files (.lnk extensions) that contain an URI to the actual resource, where the client should be redirected.
  3. Allow the file extension to be absent from the file name and employ content negotiation to identify the requested file.
  4. Add the Content-Location and Vary headers to the response.

If the file does not exist, a response with status code 404 is issued. For redirects, issue responses with status code 3xx.

Clone this wiki locally