Introducing DotNetFunda.com on mobile http://m.dotnetfunda.com ! Be with DotNetFunda.com on the go !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 9345 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > WCF Interview Questions > How to define a service as REST based se ...

How to define a service as REST based service in WCF?

Interview question and answer by: Poster | Posted on: 11/18/2008 | Category: WCF Interview questions | Views: 5034 |


Answer:

WCF 3.5 provides explicit support for RESTful communication using a new binding named WebHttpBinding.
The below code shows how to expose a RESTful service

[ServiceContract]

interface IStock
{
[OperationContract]
[WebGet]
int GetStock(string StockId);
}


By adding the WebGetAttribute, we can define a service as REST based service that can be accessible using HTTP GET operation.

Source: http://weblogs.asp.net/shijuvarghese/archive/2008/04/04/rest-and-wcf-3-5.aspx | Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Poster

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2012 8:47:12 AM