Create a REST layer for your WCF application (0)Add to My Brief

Josh Doolan | 21/03/2012

WCF is pretty awesome, apart from the fact you can run it as a  windows service, in the event you would like to create REST IIS layer it is pretty simple process.

Now to ensure we keep our loose coupling intact between the WCF interface and the REST layer itself we do this by simply slotting in a .svc file from file and tweaking the routes.

As follows:

Have your WCF service contract interface: 

Now the trick now is to add annotation to get the web stuff to work:

Put this on your concrete method:

Hack your .svc file so that the code behind is pointing to your Concrete implementation class:

Now to create a restful route ensure you use a differ service factory, as going to the .svc will be purely web:

 

tags: Web Development

Interested in learning more?

Wiliam is a leading supplier of web solutions and can provide expert advice to assist your business or organisation online.

Make enquiry   Request quotation

Comments

Share this page

Print this page Email this page to a friend Copy the URL of this page

No Brief added yet.

My Brief results-driven approach emphasises a commitment to our clients needs through strategic analysis and best-practice.

Add to My Brief

Click on this icon to save item into My Brief. Retrieve, email and print

Drag & Drop

Drag & drop any iten with this icon into My Brief. Retrieve, email and print

Search Blogs