简体   繁体   English

net.pipe与net.tcp对比http绑定

[英]net.pipe vs. net.tcp vs. http Bindings

I'm new to WCF and would like to know the differences/advantages/limitations/etc of each of the following bindings: 我是WCF的新手,想知道以下每个绑定的差异/优点/限制/等等:

net.pipe
net.tcp
http

Supporting scenarios on when to use each binding and other examples would be appreciated. 关于何时使用每个绑定和其他示例的支持方案将不胜感激。

While not great for providing specific usage examples, here is a link from MSDN which lists all the features for the bindings. 虽然不是很适合提供特定的用法示例,但这里有一个来自MSDN的链接,其中列出了绑定的所有功能。

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

Here is a decent flow chart that can help choosing between them as well. 这是一个体面的流程图,可以帮助他们之间进行选择。

流程图

Source: http://bloggingabout.net/blogs/dennis/archive/2006/12/01/WCF-Binding-decision-chart.aspx 资料来源: http//bloggingabout.net/blogs/dennis/archive/2006/12/01/WCF-Binding-decision-chart.aspx

Here is a good overall article I've used in the past. 这是我过去使用的一篇很好的整篇文章。

http://mkdot.net/blogs/dejan/archive/2008/03/31/wcf-binding-decision.aspx (or here in the wayback machine if the link no longer works for you). http://mkdot.net/blogs/dejan/archive/2008/03/31/wcf-binding-decision.aspx (或这里的自由之路机,如果该链接不再为你的作品)。

net.pipe, fast and secure because your web service is not accessible from the network (typically, you will use net.pipe to interact with a windows service easily). net.pipe,快速且安全,因为您的Web服务无法从网络访问(通常,您将使用net.pipe轻松地与Windows服务交互)。

http, you will use it for interoperability reason, if your web service is not over HTTP, silverlight or flash cannot use it (because the browser filter non-http packets, as a firewall does). http,您将使用它来实现互操作性,如果您的Web服务未通过HTTP,则Silverlight或Flash无法使用它(因为浏览器过滤非HTTP数据包,就像防火墙一样)。

net.tcp, is a bit faster because your soap message is not wrapped inside a HTTP request, but you cannot invoke your webservice with a RIA technology, and some firewall will drop your message. net.tcp,有点快,因为你的soap消息没有包含在HTTP请求中,但是你不能用RIA技术调用你的web服务,而且有些防火墙会丢弃你的消息。

Windows Communication Foundation (WCF) is a framework for building services that process XML messages. Windows Communication Foundation(WCF)是用于构建处理XML消息的服务的框架。 WCF allows you to transmit messages using different transport protocols (such as HTTP, TCP, and MSMQ) and using different XML representations (such as text, binary, or MTOM, which is commonly referred to as the message encoding in WCF. WCF允许您使用不同的传输协议(例如HTTP,TCP和MSMQ)传输消息并使用不同的XML表示(例如文本,二进制或MTOM,这通常称为WCF中的消息编码)。

If you want to host many WCF Services on one machine and want them to use shared memory for their communication, use a named pipe=>net.pipe, and then use tcp for the communication to WCF Services on different machines. 如果要在一台计算机上托管多个WCF服务并希望它们使用共享内存进行通信,请使用命名管道=> net.pipe,然后使用tcp与不同计算机上的WCF服务进行通信。

Configuration of nettcp binding focuses on creating a channel stack that will perform better in Windows environments, giving you a great option for replacing your various COM+ and .NET remoting investments. nettcp绑定的配置侧重于创建一个在Windows环境中性能更好的通道堆栈,为您提供了替换各种COM +和.NET远程投资的绝佳选择。

BasicHttpBinding was designed for scenarios where interoperability is of utmost importance. BasicHttpBinding专为互操作性至关重要的场景而设计。 As a result, BasicHttpBinding uses HTTP for the transport and text for the message encoding. 因此,BasicHttpBinding使用HTTP进行传输,使用文本进行消息编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM