SharePoint 2007 as a WCF host - Step #4, Write a Virtual Path Provider
Posted by: Sahil Malik - blah.winsmarts.com,
on 09 May 2008 |
View original | Bookmarked: 0 time(s)
Table of Contents for SharePoint as a WCF host.
1. Create a WCF Home. This is the virtual directory that will host all your WCF endpoints.
2. Create a WCF Service Library, and throw it in the GAC.
3. Create a relevant .svc file in the WCF home you created in step #1.
4. Write a WCF Virtual Path Provider, and register it in the SharePoint site.
As I just mentioned, the SPVirtualPathProvider blows up when it see's a URL that starts with '~'. Luckily, the problem is easy to fix. You simply author your own Virtual Path Provider.
In order to write your own VirtualPathProvider, you have to author a class that inherits from the System.Web.Hosting.VirtualPathProvider class. Now, you might be thinking that this will be...