Winsmarts.com

Microsoft MVP

MVP Logo

Awarded the Microsoft MVP Award.

Hosted By

blah!bLaH!BLOG!!

SharePoint 2007 as a WCF host - Step #1, make a WCF Home

Posted on 5/9/2008 @ 10:47 PM in #Sharepoint | 5 comments | 1766 views

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.


The first thing you need to do is find a home for your WCF services. You could put them inside _layouts or _vti_bin, but I like to keep things clean and create a new home for them for the following reasons:

a) You will be adding significant information in the web.config

b) Isolation

c) Won't interfere with Microsoft's future updates.

Okay thats great, so lets get started. You can create such a WCF home using the following steps -

  1. First, create a physical directory. I like to create it inside the same virtual directory that is hosting my SharePoint site. This way, all relevant security permissions are simply inherited. I created a dir at C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_wcf.
  2. Next, on your port 80 (or whatever port you are WCF enabling), through IISMGR, create a new virtual directory .. call it _wcf, turn it into an application, and give it execute and read permissions.
  3. Run the following - "%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y

Okay good, your home is all setup.

Next, create a WCF Service in a WCF Service library, and throw it in the GAC.

After which, you can create a .svc file.


On 5/11/2008 4:26:56 PM Peter said ..

I think you need a "Step 0: Why are we using WCF again?" post, because...well, I'm curious.


On 5/11/2008 4:28:31 PM Peter said ..

Oops, scratch that, apparently the "intro" post dropped off your front page and I missed it. Ok, disregard my previous comment.


On 5/11/2008 6:41:46 PM Sahil Malik said ..

LOL :).

Okay, is there a better way I can surface such content on my front page? The thing is, I don't think a pager would be very helpful in searching through a gazillion blogposts.

What do you say?

SM


On 5/14/2008 1:13:56 PM Peter said ..

Let's just forget this ever happened :)


On 5/14/2008 1:36:49 PM Sahil Malik said ..

OMG WTF! It's not like I caught you changing clothes or sump'n :)

Okay - Men in Black - memory erased :)

SM

Please post your comments:


Your feedback will be submitted for moderation, and will appear after it is approved.

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 

Site designed and maintained by Sahil Malik | All Rights Reserved. ©2007 WinSmarts.com.