Use URL Routing with WCF Services

Description Article

The ServiceRoute is derived from Route.

When the ServiceRoute constructor is called, WCF it will :

  1. Add the corresponding route prefix (URL pattern); and
  2. Add a hidden route handler to the ASP.NET RouteCollection

The route prefix, service host factory and service type info will be cached into an internal hash table for future service activation.

How to do it

RouteTable.Routes.Add(new ServiceRoute("Training", new ServiceHostFactory(), typeof(TestService1)));


Extensionless URL on WCF 4

By configuring a route to a WCF service using the ServiceRoute it will originate a extensionless URL with WCF 4.