Sunday, May 11, 2014

Consuming WCF Restful Services In Web Development - WCF Rest Services

In this post we will know how to apply client side validation in Asp .Net MVC.

Step : 1 Take a New ASP.NET MVC 4 Web Application
  Now, you will have a structure like

what are WCF REST services ?Before going towards WCF REST service , we should know what is WCF service ? 

simply  Windows Communication Foundation (or WCF) is a runtime and a set of APIs (application programming interface) in the .NET Framework for building connected, service-oriented applications.It is designed using service-oriented architecture principles to support distributed computing where services have remote consumers.

For cross platform and inter programming language support basically two technologies can be used. SOAP and REST services.

Now going towards WCF REST service we are not able to call a WCF service method from HTTP protocal via Ajax call directly . Because using Ajax call can only call [WEBMETHOD]  so for that we use REST service concept.

REST 
stands for Representational State TransferThe main idea behind REST is that we should treat our distributed services as a resource and we should be able to use simple HTTP protocols to perform various operations on that resource.
When we talk about the Database as a resource we usually talk in terms of CRUD operations
Now the basic CRUD operations are mapped to the HTTP protocols in the following manner:
  • GET: This maps to the R(Retrieve) part of the CRUD operation. This will be used to retrieve the required data (representation of data) from the remote resource.
  • POST: This maps to the U(Update) part of the CRUD operation. This protocol will update the current representation of the data on the remote server.
  • PUT: This maps to the C(Create) part of the CRUD operation. This will create a new entry for the current data that is being sent to the server.
  • DELETE: This maps to the D(Delete) part of the CRUD operation. This will delete the specified data from the remote server.


No comments :

Post a Comment