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故障返回給客戶端
?
轉載于:https://www.cnblogs.com/chucklu/p/4628502.html
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的WCF - Versus Web Service的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JavaWeb学习总结(五十二)——使用
- 下一篇: [Noip模拟赛] Polygon