Go to DotNetFunda.com
 Welcome, Guest!  
LoginLogin  
Expose your profile for FREE in Xpose
Submit: Article | Interview Question | Code | Question | Xpose | Joke | Link || Search  
 Skip Navigation Links Home > Interview/Exam Questions > How to define a service as REST based service in WCF? ...


WCF Interview Question

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

Author: Poster | Posted on: 11/18/2008 1:53:53 AM | Category: WCF | Views:247 |  Print Source: http://weblogs.asp.net/shijuvarghese/archive/2008/04/04/rest-and-wcf-3-5.aspx | Asked In: Many Interviews


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.

Interesting?  Bookmark and Share


Navigate to:

<< Previous Question: Which type is inherited by Structs by default?

Next Question >>: Menton the events in page life cycle and explain them.

Random Questions: Random Interview Questions

Help: If for some reason you are getting the same question by clicking Next and Previous, Try clicking Random Question or Category link above.

About Us | Contact Us | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)