purpose of life is joy

NAVIGATION - SEARCH

How to : remove .SVC extension from WCF service URL

By default, WCF service URL runs with .svc extension. sometimes, I felt that .svc extension is not useful when we reference or share the service URL to application or public. There is a very simple way I found to remove this extension and run as very plain URL with out any major coding. Normally, URL looks like below http://domainname/WCFServiceName.svc/MethodName?parameter We need to change the above URL to below one. Looks simple and neat right? http://domainname/WCFServiceName/MethodName?parameter Simple solution is to implement it at web.config level using URL re-writing which is very very simple. Other methods like writing custom URL Re writing module, configure at server level are little complex than compared to web.config changes.We have to apply changes under system.webserver as below below WCFServiceName names alone we need to change according to your service name. try now with removing with .svc URL. Share your feedback!!! <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <rewrite> <rules> <rule name="WCFServiceName" stopProcessing="true"> <match url="^WCFServiceName/(.*)$"/> <action type="Rewrite" url="WCFServiceName.svc/{R:1}" /> </rule> </rules> </rewrite> </system.webServer>

How to : Create strongly typed generic session helper in C#?

Writing session code in ASP.NET is easy. but to organize and maintain is very difficult. To overcome that in one of our project, we have decided to created a generic Session Handler. This will replace the session keyword across the project. instead, this static session helper allow us to create session across the different pages by way of single static helper class. Here is the generic class for you. [More]
Protected by Copyscape Web Plagiarism Check
DMCA.com