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 ...
随机推荐
- BZOJ 3714: [PA2014]Kuglarz
Description 魔术师的桌子上有n个杯子排成一行,编号为1,2,-,n,其中某些杯子底下藏有一个小球,如果你准确地猜出是哪些杯子,你就可以获得奖品.花费c_ij元,魔术师就会告诉你杯子i,i+ ...
- angularjs取Sevice和directive的引用
取Sevice和directive的引用 3: Grab any Services We can grab a reference to any service using the injector ...
- jboss 占用cpu 100%
通过Java thread dump分析找到耗费CPU最高的源代码 分类: 9. Java2010-04-11 23:06 9272人阅读 评论(4) 收藏 举报 threadjavaeclipse插 ...
- VS2010 Notes
1.fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 VS2010在经历一些更新后,建立Win32 Console Project时会出“error LNK112 ...
- SQL技术内幕-13 SQL优化方法论之分析实例级别的等待
优化方法论的第一步是在实例级别上找出什么类型的等待占用了大部分的等待时间,这可以通过查询动态管理图(DMV,dynamic management view)sys.dm_os_wait_stats 运 ...
- 数据库中已存在名为 'View_Business' 的对象。
用EF框架+MCF,编译的时候出现:数据库中已存在名为 'View_Business' 的对象. 解决方案: 1.Enable-Migrations2.Add-Migration3.Update-Da ...
- SQL语句AND 和 OR执行的优先级
例句: ) FROM RT_CUSTALLOCRESULT WHERE REGDATE BETWEEN '2014-03-01' AND '2014-03-31' ) FROM RT_CUSTALLO ...
- UVA 1362 Exploring Pyramids 区间DP
Archaeologists have discovered a new set of hidden caves in one of the Egyptian pyramids. The decryp ...
- HighCharts开发说明及属性详解
一.HighCharts开发说明: HighCharts 开发实际上配置HighCharts每个部分,比如配置标题(title),副标题(subtitle)等,其中每个部分又有更细的参数配置,比如标题 ...
- 让fdisk输出更准确合理
注意:新版本的fdisk默认输出已经正确合理了,本文只适用于旧版本的fdisk. 1 无option选项参数的输出 [root@localhost ~]# fdisk -l Disk /dev/sda ...