views:

177

answers:

3

I wanted to create REST friendly URLs with my WCF service endpoints by avoiding the use of .svc. I know I can accomplish this by using IIS rewrite module to append the .svc.

Does anyone else know of a better way to do this?

Please note that I am limited to .NET 3.5 and cannot use .NET 4.0 (so can’t use System.Web.Routing in .NET 4.0)

A: 

Unfortunately without using the Rewrite module therre is currently no way of doing this. There is a team at MS working on the WCF REST Starter Kit available here who where looking at implementing this functionality.

During a Microsoft DevDays presentation I did earlier this year on the topic, a got confirmation from Ron Jacobs that the ability to do this will only be available in Framework 4.0 onwards, and for anything below the rewrite module is the only way to do this.

Diago
+1  A: 

You can "plug in" an ISAPI rewrite module to IIS that would do this for you, such as Ionic:

http://www.codeplex.com/IIRF

You can also write your own HTTP rewrite engine as early as .NET 1.1 - although that would need to have a file extension that could be mapped to use the ASP.NET engine as it only rewrites after IIS passes the request to .NET - but it could be any extension you choose.

For your question, the ISAPI rewrite module is the best solution.

Sohnee
A: 

The WCF Contrib library (which I have not used yet) claims to have the ability to do this.

Broam