netTcpBinding 或 wsHttpBinding

发布于 2024-08-10 21:56:37 字数 354 浏览 4 评论 0原文

我有一个作为 Windows 服务托管的 WCF 服务,客户端是一个使用 WCF 服务方法的 ASP.Net 应用程序。

在实现安全性的过程中,我很困惑 netTcpBinding/wsHttpBinding 中的哪一个适合我的情况。

场景中的所有应用程序(WCF 服务、Windows 服务、ASP.Net 网站)很可能将位于我们办公室的不同服务器上,因此位于 Intranet 中。用户将通过Internet 访问ASP.Net 网站。

虽然,我始终可以在这里使用 wsHttpBinding,但在我的情况下使用 netTcpBinding 设置服务端点是否合适?

I have a WCF Service hosted as Windows Service and client is an ASP.Net application consuming WCF Service methods.

In process of implementing security, I am confused over which among netTcpBinding/wsHttpBinding will be suitable for my case.

Most likely all the applications in scene (WCF Service, Windows Service, ASP.Net Website) will be sitting on different servers in our office, thus in an Intranet. ASP.Net website will be accessed by users over Internet.

Though, I can always use wsHttpBinding here, will it be suitable to set the service endpoint using netTcpBinding in my case?

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

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

发布评论

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

评论(5

帝王念 2024-08-17 21:56:37

检查一下所有不同内置绑定的比较:

配置系统提供的绑定 - MSDN

对于您的情况,只要它是联系 WCF 服务的 Web 服务器,并且您不需要为该服务的任何外部使用者提供端点...netTcpBinding 应该能够胜任这份工作。

Check this out for a comparison of all the different built in bindings:

Configuring System-Provided Bindings - MSDN

As for your case, as long as it's the web server contacting the WCF service and you don't need to provide an endpoint for any external consumers of the service...netTcpBinding should be up to the job.

阳光①夏 2024-08-17 21:56:37

如果您愿意,您可以通过多个绑定公开您的服务,因此您实际上可以同时使用两者。

但是,如果您同时控制客户端和服务,并且它们都使用 WCF,则 netTcpBinding 的速度要快得多。除非两者之间有防火墙,否则我会选择它。

You can expose your service over more than one binding if you wish, so you could actually use both.

However, if you control both client and service and they both use WCF, netTcpBinding is much faster. Unless you have a firewall between those two, I would choose that.

葵雨 2024-08-17 21:56:37

如果您愿意为了性能而牺牲互操作性,请使用 netTcpBinding 代替 wsHttpBinding,因为您知道如果您对结果不满意,可以轻松取消交易(这是更改配置的问题)值)。

Use netTcpBinding instead wsHttpBinding if you are willing to trade interoperability for performance knowing that you can easily cancel the trade if you are not satisfied with the results (it's a matter of changing config values).

很糊涂小朋友 2024-08-17 21:56:37

由于您的 WCF 服务将由您办公室(内联网)中的应用程序访问,因此我会使用 netTcpBinding

Intranet场景中,建议您使用netTcpBinding,除非您有特定要求使用其他绑定(例如wsHttpBinding)。默认情况下,netTcpBinding 使用二进制编码传输安全性,从而提供更好的性能。

以下 URL 将有助于获取更多信息

http://msdn.microsoft.com/en -us/library/cc949026.aspx

http://msdn.microsoft .com/en-us/library/ms730879.aspx

Since your WCF Services will be accessed by applications sitting in your office (INTRANET), I would go with netTcpBinding.

In an intranet scenario, it is recommended that you use netTcpBinding unless you have a specific requirement to use other bindings such as wsHttpBinding. By default, netTcpBinding uses binary encoding and transport security, which delivers better performance.

Following URLS will help to get more information

http://msdn.microsoft.com/en-us/library/cc949026.aspx

http://msdn.microsoft.com/en-us/library/ms730879.aspx

懒猫 2024-08-17 21:56:37

由于您的WCF服务是netTcpBinding的Windows服务+1。在 IIS 上托管 netTcpBinding 很困难。

Since your WCF service is a windows service +1 for netTcpBinding. Hosting netTcpBinding on IIS is difficult.

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