I want to understand the WCF and REST API implementation. As per internet information, REST concept was introduced by Roy Fielding in year 2000 and WFC was incorporated in .Net framework on 2006. If REST concept was best then Why Microsoft introduced WCF and now REST API became popular.SOAP is now largely obsolete. Really appreciate if anyone can provide insights on this.
-
Possible duplicate of [Rest vs Wcf pros and cons](https://stackoverflow.com/questions/10357806/rest-vs-wcf-pros-and-cons) – Suraj Rao May 17 '18 at 05:16
1 Answers
There are a number of technologies that can help you develop HTTP Web Services like Web Service, WCF and WEB API.
Rest on the other hand is not a technology but an architectural style for creating Web Services so every service that follows a REST Architecture is called RESTful web services/API
read REST constraints here: Rest Constraints
The main differences between WCF and WEB API are:
WCF is SOAP-based and return data in XML, It requires more configuration, It supports more web protocols like HTTP, TCP, UDP, custom etc, is not open source, supports duplex message exchange patterns etc
Web API is REST-based framework for building HTTP Services, more suitable for connecting through any device, much less configuration, supports fewer protocols, supports request-response protocol [means every request should contain enough information for the response but it can be modified using Signal R and Web Sockets etc], is open source

- 1,937
- 5
- 23
- 42
-
Thanks for your response. I knew all the difference and implementation but my mind is struggling with question why Microsoft introduced SOAP, if REST was the best option. – Kabir May 17 '18 at 05:55
-
REST is the best option for most of the cases but there are cases when SOAP beats REST. SOAP is more secured it supports stuff that helps in data privacy if a request fails it can hit again and retry but in REST user have to deal with the response, sometimes HTTP is not the way to go and SOAP helps there too as SOAP is highly extensible. at the end of the day, best technology is the one that solves the problem depending upon the requirements. – Zeeshan Adil May 17 '18 at 06:05
-
REST is best for making client-server applications. SOAP is a good option for communication between two data end points – Zeeshan Adil May 17 '18 at 06:08
-
-