我应该使用 WCF 还是 ASMX Web 服务?

发布于 2024-09-09 00:48:55 字数 137 浏览 1 评论 0原文

我一直在寻找使用 .net 4.0 的 asp.net Web 服务,但每次我选择 4.0 时,Web 服务选项都会消失。

有人向我建议,也许他们(MS)希望你改用 WCF。我对此了解不多,但他说它们就像网络服务,但更好。那么有人有比较指南吗?

I was looking for an asp.net webservice that uses .net 4.0 but everytime I choose 4.0 the webservice choice goes away.

Someone suggested to me that maybe they(MS) want you to use WCF instead. I don't know much about it but he said they are like webservices but better. So anyone got a comparisons guide?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤城病女 2024-09-16 00:48:55

首先...忘记微软希望您使用什么,您应该使用最能解决您问题的技术。

WCF 相对于 ASMX 的优势之一是改进且更强大的安全模型。但是,如果您可以保护该服务或者该服务是公开的,那么这就不是一个考虑因素。 WCF 还可以托管在远程服务器上运行的应用程序中,而不是必须通过 IIS 托管的 ASMX。

First off...FORGET what Microsoft WANTS you to use, you should use the technology that best solves your problem.

One advantage of WCF over ASMX is an improved and more robust security model. However if you can secure the service or it is public then that isn't a consideration. WCF can also be hosted within an application that runs on a remote server as opposed to ASMX which must be hosted through IIS.

巾帼英雄 2024-09-16 00:48:55

Windows Communication Foundation (WCF) 是一个用于构建服务的框架。

Web 服务是一种可以使用 WCF 构建的服务。

因此,您应该使用 WCF 构建 Web 服务。

在 .NET 4.0 中,Microsoft 取消了经典的 ASMX 风格的 Web 服务,并将所有人推向 WCF。您可以构建与 WCF 中的 ASMX Web 服务功能相同的 Web 服务,只需定义正确的绑定即可。

Windows Communication Foundation (WCF) is a Framework for building services.

A Web Service is one kind of service you can build using WCF.

Therefore, you should build your Web Service using WCF.

With .NET 4.0, Microsoft has taken the classic ASMX style Web Services away and are pushing everybody to WCF. You can build Web Services that function the same way as your ASMX Web Services in WCF, it's just a matter of defining the correct binding.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文