Interviewer And Interviewee Guide

WCF Data Services Interview Question:

Can you explain how to define a service as REST based service in WCF?

Submitted by: Administrator
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.
Submitted by: Administrator

Read Online WCF Data Services Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.