Last post Nov 13, 2014 03:41 PM by Selvakumar Ramachandran
Nov 12, 2014 04:17 PM|Selvakumar Ramachandran|LINK
Can any one explain what is the difference between Web Service, Web Service RESTful service, WCF and Web API.
Nov 12, 2014 04:31 PM|sen338|LINK
the below site may help you out
Nov 12, 2014 04:41 PM|Rion Williams|LINK
What is a Web Service?
Since your question pertains to Web Services, let's use the following paraphrased definition provided from
this Stack Overflow discussion :
A Web Service is a function that can be accessed by other programs over the web (via HTTP). To clarify a bit, when you create a website or application that outputs HTML, its target is the browser and by extension the human being
reading the page in the browser. A web service is different in this regard in that rather than directly targeting a browser, it is designed to be used / consumed by an actual application.
Basically, you can think of a Web Service as an application that can communicate with other applications to either receive or send data and exposes certain methods for doing so.
Types of Web Services
Now when it comes to Web Services, they can typically be broken down into two types that define "how" these Web Services operate : REST and SOAP. You can find a great
summary of both of these types of services here and detailed below :
You can find another in-depth discussion here that details many of the differences between the two protocols.
WCF and Web API
You have two major options when working with Web Services in ASP.NET. The older approach being Windows Communication Foundation (WCF) and the newer being Web API. I'll include a few resources below detailing Getting Started with both technologies.
Windows Communication Foundation or WCF is a framework that was designed by Microsoft to construct and build Web Services that can be used to provide an API and other
services to other web applications. Web Services are excellent if your application's architecture calls for it and you have multiple applications that might need to work together and access some of the same data (such as passing data or other objects across).
ASP.NET Web API is a development environment aimed at developing RESTful Web Services that will allow your application to easily send and receive HTTP Requests (web
requests) and perform operations based on the types of Requests that are made to it (such as providing information about a user if provided their ID etc.) It was designed to replace the previous Windows Communication Foundation
(WCF) approach to developing Web Services within .NET.
You'll generally see WCF used more commonly with SOAP-based services as Web API simply does not support them. Web API generally shines when you are working purely with HTTP requests and is considered RESTful.
A few benefits that you'll often hear regarding choosing Web API over WCF :
There really isn't any particular reason to ALWAYS choose one over the other. They each serve to accomplish similar goals (web services) in different ways and have their own strengths and weaknesses. I would recommend
reading through an article that compares and contrasts the two such as this one to help get a better idea of what you need as there are so many different factors at play here. There really isn't any reason that you couldn't implement both for a single
type of application and use Web API for your "web" oriented activities and WCF for more of your larger "data" oriented activities.
I would recommend checking out the following resources pertaining to WCF :
With regards to Web API, I would recommend
visiting the Web API area of this site. It features tutorials and walkthroughs that not only explain what Web API is, but how to use it in various scenarios.
If you need some generic information on Web Services within ASP.NET in general, the following might be useful :
Nov 13, 2014 03:41 PM|Selvakumar Ramachandran|LINK
Thanks Rion for the detailed information.