Ron Jacobs

Windows Workflow Foundation

WCF Data Services (OData) and eliminating the .SVC file

WCF Data Services (OData) and eliminating the .SVC file

  • Comments 7

After my previous post where I showed you how you can eliminate the .SVC extension from your URI someone asked me another good question.

When I add the route I can access the service from the route and the path to the SVC file.  Can I block the path to the SVC file from accessing the service?

Absolutely – all you have to do is get rid of the .SVC file.  But be careful when you do!  If you delete the .svc file VS2010 will also delete the code-behind file.

 

VS2010 treats the file where your service code lives as code-behind so it offers you a limited set of options for dealing with it.

image

The best thing to do is to open the file and save it without the .svc extension.  In this case I saved it as Conference.cs.

Now you can delete the .SVC file this will prevent it from being used as a path to access the service

 

image

With the .SVC file gone only the URI from the route will be able to access your service.

  • In this walkthrough I’ll show you how to use the AppFabric-enabled WCF Data Service template for Visual

  • In this walkthrough I’ll show you how to use the AppFabric-enabled WCF Data Service template for Visual

  • In this walkthrough I’ll show you how to use the AppFabric-enabled WCF Data Service template for Visual

  • In this walkthrough I’ll show you how to use the AppFabric-enabled WCF Data Service template for Visual

  • In this walkthrough I’ll show you how to use the AppFabric-enabled WCF Data Service template for Visual

  • In this walkthrough I’ll show you how to use the AppFabric-enabled WCF Data Service (C#) template

  • In this walkthrough I’ll show you how to use the AppFabric-enabled WCF Data Service (VB) template for

Page 1 of 1 (7 items)