Note: reproduced
Under the. NET platform, there's a lot of technology that lets you create an HTTP service, like Web SERVICE,WCF, and now out of the Web API. Under the. NET platform, you have a number of options to build an HTTP Services. I share my views on Web Service, WCF, and the Web API.
Web Service
1, it is based on the SOAP protocol, the data format is XML
2, only support HTTP protocol
3. It is not open source, but can be used by any one who knows the XML
4. It can only be deployed on IIS
Wcf
1, this is also soap-based, the data format is XML
2. This is the evolutionary version of Web Service (ASMX) that can support a wide variety of protocols, such as Tcp,http,https,named Pipes, MSMQ.
3. The main problem with WCF is that it is very cumbersome to configure.
4. It is not open source, but can be used by any one who knows the XML
5. It can be deployed in applications or on IIS or in Windows services
WCF Rest
1. To use the WCF Rest service, you must use Webhttpbindings in WCF
2. It uses [WebGet] and [WebInvoke] attributes respectively to implement HTTP GET and post verbs
3, to use other HTTP verbs, you need to do some configuration in IIS, so that the. svc file can accept the request of these verbs
4, the use of WebGet through the parameters of data transmission, also need to configure. And you must specify UriTemplate
5, it supports XML, JSON and atom these data formats
Web API
1. This is a simple new framework for building HTTP services
2. The Web API on the. NET platform is an open-source, ideal technology for building rest-ful services
3, unlike WCF REST Service. It can use all the features of HTTP (such as URIs, Request/response header, cache, versioning, multiple content formats)
4. It also supports MVC features like routing, Controller, action, filter, model binding, inversion of control (IOC), or Dependency injection (DI), unit testing. These can make the program simpler and more robust
5. It can be deployed on applications and IIS
6, this is a lightweight framework, and to limit the bandwidth of devices, such as smartphones and other support is very good
7. Response can be converted into JSON, XML, or any format you want to convert by Mediatypeformatter the Web API.
What should I choose for WCF and Web APIs?
1. When you want to create a service that supports message, Message Queuing, duplex communication, you should choose the WCF
2, when you want to create a service, you can use a faster transmission channel, such as TCP, Named pipes or even UDP (in WCF4.5), when the other transport channels are not available can also support HTTP.
3, when you want to create an HTTP-based resource-oriented service and can use all the features of HTTP (such as URIs, Request/response header, cache, versioning, multiple content formats), you should choose the Web API
4. When you want your service to be used in browsers, phones, iphones, and tablets, you should choose the Web API
Original: http://www.dotnet-tricks.com/Tutorial/webapi/ Ji2x050413-difference-between-wcf-and-web-api-and-wcf-rest-and-web-service.html
Differences between WCF, WebAPI, Wcfrest, WebService