WCF - Versus Web Service

https://www.tutorialspoint.com/wcf/wcf_versus_web_service.htm

There are some major differences that exist between WCF and a Web service which are listed below.

这里总结了WCF和网络服务之间主要的不同之处

  • Attributes - WCF service is defined by ServiceContract and OperationContract attributes, whereas a web service is defined by WebService and WebMethod attributes.

  • Protocols - WCF supports a range of protocols, i.e., HTTP, Named Pipes, TCP, and MSMQ, whereas a web service only supports HTTP protocol.

  • Hosting Mechanisms - Various activation mechanisms are there for WCF hosting, i.e., IIS (Internet Information Service), WAS (Windows Activation Service), Self-hosting and Windows Service, but a web service is hosted only by IIS.

  • Services - WCF supports a robust security, trustworthy messaging, transaction and interoperability, while a web service only supports security services.

  • Serializer - WCF Supports DataContract serializer by employing System.Runtime.Serialization, whereas a web service supports XML serializer by making use of System.Xml.Serialization.

  • Tools - ServiceMetadata tool (svcutil.exe) is used for client generation for a WCF service, while WSDL.EXE tool is used for generating the same for a web service.

  • Exception Handling - In WCF, unhandled exceptions are handled in a better way by making use of FaultContract. They do not return to the client like in a web service as SOAP faults.

  • Has

 

1.特质:WCF服务由服务契约和操作契约定义,然而web服务是由WebService以及WebMethod属性来定义的

2.协议:WCF支持一系列的协议,例如HTTP、命名管道、消息队列,然而web服务仅仅支持HTTP协议

3.托管机制:wcf有各种可用的机制,例如IIS(互联网信息服务)、WAS(windows激活服务)、Self-hosting(自托管)以及windows服务,但是webService仅仅支持IIS

4.服务:wcf提供了一个稳健的安全,可靠的消息,事务以及互操作性。然而webService仅仅支持安全服务

5.序列化器:wCF通过使用System.Runtime.Serialization提供数据契约序列化器,然而webservice是通过使用System.Xml.Serialization来支持XML序列化器的

6.工具:svcutil.exe被客户端用来生成一个wcf服务,然而webservice使用WSDL.EXE工具

7.异常处理:在wcf中,未处理的异常会由faultContract来以一种较好的方式来处理。wcf并不会像webservice那样将未处理的异常作为soap故障返回给客户端

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(201)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2014-07-07 ubuntu12 root账户自动登录
2014-07-07 ZedGraph如何动态的加载曲线
点击右上角即可分享
微信分享提示