Basic Difference Between WCF Rest and ASP.Net WebAPI
Hi friends, today we all develop & use "Service Based Application". Now a days Rest Full Service are so popular. There are two famous technology used in .Net Framework to develop Rest Full Services.
1. ASP.Net Web API
2. WCF Rest
What is the ASP. NET Web API?
The ASP. NET Web API is a framework that uses the HTTP Services and makes it easy to provide the response to the client request. The response depends on the request of the Clients. The Web API builds the HTTP services, and handles the request using the HTTP Protocols. The request may be GET, POST, DELETE and PUT. We can also say that the ASP. NET Web API:
1. Is an HTTP service.
2. Is designed for reaching the broad range of clients.
3. Uses the HTTP application.
We use the ASP. NET Web API for creating the REST full (Representational State Transfer) services.
The following are some important points of the ASP. NET Web API:
The ASP. NET Web API supports the MVC application features that are controller, media formatters, routing etcetera.
It is a platform for creating the REST services.
It is a framework for creating the HTTP services.
Responses can be formatted by the APIs MediaTypeFormatter into the Java Script Object Notation (JSON) and Extencible Markup Language (XML) formats.
Architecture of Web API:
To choose between Web API and WCF:
- You can choose the Web API when you want to create the service that uses all the HTTP features, such as request and response header, URIs, versioning etcetera.
- You choose the Web API if you want to expose the HTTP services to a broad range of clients. These includes the mobile , iPhone and browsers.
Now define the reason of choosing the WCF:
- You can choose the WCF if you want to create the service that supports one-way messaging, message queues, duplex communication etcetera.
- You can choose the WCF if you want to create a service that uses the fast transport channel, such as TCP, UDP, Named pipe etcetera.