gpt4 book ai didi

c# - Windows 8 商店应用程序的 WCF 与 Web API

转载 作者:行者123 更新时间:2023-11-30 17:49:10 26 4
gpt4 key购买 nike

我建议我们从 WCF 迁移到 Web API,因为它更容易实现并且很难被否决。以下是提出的反对意见:

  • WebAPI 专为 rails 转换而生
  • 我们不需要 REST 或第 3 方开源支持,也不需要带有 Microsoft 后端的 Windows 8 Store Apps。
  • 基于 net.tcp 的 WCF 比 HTTP(S)+XML 或 JSON“快得多”且开销更少

最后的评论是“我想不出使用 Web API 比使用 WCF 有什么优势。

有趣的是,我在一家基于 MS 技术的大型企业的上一份工作从 WCF 改为 Web API,开发人员的工作效率猛增,许多错误消失了,而且我们从未遇到过任何性能问题,但我不想只是这么说,我想用事实回应他的观点。你会如何回应?

最佳答案

WCF or ASP.NET Web APIs? My two cents on the subject :

  • If your intention is to create services that support special scenarios – one way messaging, message queues, duplex communication etc, then you’re better of picking WCF
  • If you want to create services 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 transports are unavailable, then you’re better off with WCF and using both SOAP-based bindings and the WebHttp binding.
  • If you want to create resource-oriented services over HTTP that can use the full features of HTTP – define cache control for browsers, versioning and concurrency using ETags, pass various content types such as images, documents, HTML pages etc., use URI templates to include Task URIs in your responses, then the new Web APIs are the best choice for you.

整篇文章值得一读。

关于c# - Windows 8 商店应用程序的 WCF 与 Web API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22061089/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com