Web Service
It is based on SOAP and return data in XML form.
It support only HTTP protocol.
It is not open source but can be consumed by any client that understands xml.
It can be hosted only on IIS.
WCF
It is also based on SOAP and return data in XML form.
It is the evolution of the web service(ASMX) and support various protocols like TCP, HTTP, HTTPS, Named Pipes, MSMQ.
The main issue with WCF is, its tedious and extensive configuration.
It is not open source but can be consumed by any client that understands xml.
It can be hosted with in the applicaion or on IIS or using window service.
WCF Rest
To use WCF as WCF Rest service you have to enable webHttpBindings.
It support HTTP GET and POST verbs by [WebGet] and [WebInvoke] attributes respectively.
To enable other HTTP verbs you have to do some configuration in IIS to accept request of that particular verb on .svc files
Passing data through parameters using a WebGet needs configuration. The UriTemplate must be specified
It support XML, JSON and ATOM data format.
Web API
This is the new framework for building HTTP services with easy and simple way.
Web API is open source an ideal platform for building REST-ful services over the .NET Framework.
Unlike WCF Rest service, it use the full featues of HTTP (like URIs, request/response headers, caching, versioning, various content formats)
It also supports the MVC features such as routing, controllers, action results, filter, model binders, IOC container or dependency injection, unit testing that makes it more simple and robust.
It can be hosted with in the application or on IIS.
It is light weight architecture and good for devices which have limited bandwidth like smart phones.
Responses are formatted by Web API’s MediaTypeFormatter into JSON, XML or whatever format you want to add as a MediaTypeFormatter.
To whom choose between WCF or WEB API
Choose WCF when you want to create a service that should support special scenarios such as one way messaging, message queues, duplex communication etc.
Choose WCF when you want to create a service that can use fast transport channels when available, such as TCP, Named Pipes, or maybe even UDP (in WCF 4.5), and you also want to support HTTP when all other transport channels are unavailable.
Choose Web API when you want to create a resource-oriented services over HTTP that can use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats).
Choose Web API when you want to expose your service to a broad range of clients including browsers, mobiles, iphone and tablets.

最新文章

  1. thinkphp 杂项(3.2.3)
  2. 一个动画 Label (走马观花)
  3. linux下安装编译php的curl扩展
  4. CGI综述
  5. IOS中两个view的切换
  6. hihocode ---1032
  7. WCF再学习小结
  8. C# mvc3 mvc4 伪静态及IIS7.5配置
  9. 案例:利用累加器计算前N个学生的总成绩和平均成绩
  10. 【Unity 3D】使用 2DToolkit 插件 制作2D精灵动画
  11. RMAN duplicate from active 时遭遇 ORA-17627 ORA-12154
  12. C# 脚本代码自动登录淘宝获取用户信息
  13. pandas数据处理基础——筛选指定行或者指定列的数据
  14. OOP的魔术方法
  15. Python之OS内置模块
  16. Flask 系列之 LoginManager
  17. python第三方库 - dateutil
  18. 译:Spring Boot 自动伸缩
  19. k8s(4)-使用服务公开应用程序
  20. vue 动态组件、父子组件传参

热门文章

  1. Hibernate 使用注解后没发现建表
  2. Java中static作用及用法详解(转)
  3. python作用域 scope
  4. IN改写关联注意事项!
  5. 【JS】JS外联不执行,内联执行
  6. 转 ---- Asp.net mvc项目分页功能
  7. 关于下拉刷新你是否真的非常理解还是只会搬砖?附 Android 实例子源代码文件下载地址380个合集
  8. 低压差稳压器AMS1585
  9. Two kinds of Quaternion SlerpImp (Unity)
  10. Poj 3580-SuperMemo Splay