header image

Url Rewriting using WCF

Posted by: | December 22, 2008 | No Comment |

One of my interesting thing is “URL Rewriting”. The first time I have implemented it through implementing HTTPHandler using .NET 1.1. Same concept I have applied to a Document Management Service [DMS] project to PUT the document and GET the document by an .ASMX WebService. There I added verb * using wild charater in IIS 6.0 as well as added  <httpHandler> node in web.config. Then we got in different way in .NET 2.0. Finally this time we got using URITemplate, WebGet, WebInvoke in WCF 3.5 SP1.

The UriTemplate class provides methods for working with sets of URIs that share a common structure for URL Rewriting.
As this follows based on the URL pattern comprises left portion of URI which is fixed and rest is dynamic where certain parameter is getting manipulated or changed to request a page. System.UriTemplate provides runtime support for URI template syntax.
UriTemplate is to manipulate parameters using ByName and ByPosition.
[WebGet] – supports HTTP GET method
WebOperationContext provides easy access to Web specifics (e.g., headers, status codes)
[WebInvoke] supports other HTTP methods; POST is default method



Corresponding to previous version’s URL concept the available resources are in





under: 9532, 9533, 9534, 9535, 9536