Webservce、WCF、WebApi的区别
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.
转载:http://www.dotnet-tricks.com/Tutorial/webapi/JI2X050413-Difference-between-WCF-and-Web-API-and-WCF-REST-and-Web-Service.html
Webservce、WCF、WebApi的区别的更多相关文章
- 关于WEB Service&WCF&WebApi实现身份验证之WebApi篇
之前先后总结并发表了关于WEB Service.WCF身份验证相关文章,如下: 关于WEB Service&WCF&WebApi实现身份验证之WEB Service篇. 关于WEB S ...
- 关于WEB Service&WCF&WebApi实现身份验证之WCF篇(2)
因前段时间工作变动(换了新工作)及工作较忙暂时中断了该系列文章,今天难得有点空闲时间,就继续总结WCF身份验证的其它方法.前面总结了三种方法(详见:关于WEB Service&WCF& ...
- Webservice WCF WebApi 前端数据可视化 前端数据可视化 C# asp.net PhoneGap html5 C# Where 网站分布式开发简介 EntityFramework Core依赖注入上下文方式不同造成内存泄漏了解一下? SQL Server之深入理解STUFF 你必须知道的EntityFramework 6.x和EntityFramework Cor
Webservice WCF WebApi 注明:改编加组合 在.net平台下,有大量的技术让你创建一个HTTP服务,像Web Service,WCF,现在又出了Web API.在.net平台下, ...
- WebService/WCF/WebAPI区别
详细描述它们之间的区别,为什么这么选择,尤其是WCF vs WebAPI
- 学习Web Service、wcf、webapi的区别
csdn:关于wcf,webservice,webapi或者其他服务或者接口有什么区别. wcf,webservice采用的是rpc协议,这个协议很复杂,所以每次要传递.要校验的内容也很复杂,别看我们 ...
- WebService/WCF/WebAPI 之间的区别
Web Service 1.数据的格式基于SOAP协议 2.数据的传输只支持HTTP协议 3.它只能部署在IIS上 WCF 1.数据的格式基于SOAP协议 2.数据的传输支持HTTP,HTTPS,TC ...
- wcf必知必会以及与Webapi的区别
快速阅读 介绍wcf中的信息交换模式MEP以及数据在传输过程中的序列化,endpont的介绍和wcf的三种实例模式以及安全模式 以及和Webapi的简单对比. wcf介绍 支持跨平台. 支持多种协议 ...
- SOA和WCF&WebAPI
SOA http://www.cnblogs.com/leslies2/archive/2011/12/12/2272722.html WCF开发框架形成之旅--如何实现X509证书加密 WebAPI ...
- Webservice WCF WebApi
注明:改编加组合 在.net平台下,有大量的技术让你创建一个HTTP服务,像Web Service,WCF,现在又出了Web API.在.net平台下,你有很多的选择来构建一个HTTP Service ...
随机推荐
- .NET设计模式(11):组合模式(Composite Pattern)(转)
概述 组合模式有时候又叫做部分-整体模式,它使我们树型结构的问题中,模糊了简单元素和复杂元素的概念,客户程序可以向处理简单元素一样来处理复杂元素,从而使得客户程序与复杂元素的内部结构解耦. 意图 将对 ...
- css属性简写集合
作为一个前端攻城狮,CSS那绝对是基础,可是基础也有掌握不牢的时候.今天就来总结一下容易写错的CSS属性简写问题. 1.background 背景颜色:background-color ...
- KafkaClient接口与Kafka处理请求的若干特性
(依据于0.10.0.0版本) 这个接口的唯一实现类就是NetworkClient,它被用于实现Kafka的consumer和producer. 这个接口实际上抽象出来了Kafka client与网络 ...
- HDOJ 1709 The Balance(母函数)
The Balance Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- centos msyql 安装与配置
Mysql具有简单易学.体积小等优点,深受编程开发初学者的喜爱 工具/原料 接入Internet的Centos计算机 安装Mysql 1 Centos 6.6下安装Mysql很简单, yum list ...
- javascript设计模式--状态模式(State)
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Unity Texture 2D Compress
测试了一下 unity 图片 对 apk 的影响. 上两种测试环境 1024 * 1024 带 alpha的话 默认压缩就是RBA 16bit就是2M 不带的话就是 etc 的话 ...
- 【二】php常用方法
-------------------------------数据类型------------------------------------------ 1.settype(var,type) 类 ...
- 在WCF中使用消息队列
在一些大型的解决方案中,假设我们的服务没有办法一直在线,或者因为这样那样的原因宕机了,有没有什么办法让客户端的影响最小化呢?答案是可以通过消息队列的方式,哪怕服务是没有在线的,客户端依然可以继续操作. ...
- struct 理解 (需要经常理解)
2014.3.11 分析offviewer时,有一些问题,很基础的,但是忘记了,发现问题那就快点搞定它 以下内容参考自百度百科: (2)struct 结构体有点忘记了,要复习一下 定义一个结构的一般 ...