网。管与净。tcp与http绑定

时间:2021-08-05 16:45:58

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.

对于何时使用每个绑定和其他示例的支持场景将会得到赞赏。

3 个解决方案

#1


64  

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.

这里有一个不错的流程图,可以帮助你在两者之间做出选择。

网。管与净。tcp与http绑定

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(如果链接不再对您有效,也可以在回路机中找到)。

#2


50  

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).

网。管道,快速和安全,因为您的web服务无法从网络访问(通常,您将使用net。管道与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.

网。tcp更快一点,因为您的soap消息没有封装在HTTP请求中,但是您不能使用RIA技术调用您的web服务,并且一些防火墙将删除您的消息。

#3


14  

Windows Communication Foundation (WCF) is a framework for building services that process XML messages. 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.

Windows通信基础(WCF)是一个用于构建处理XML消息的服务的框架。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。管道,然后使用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 remoting投资的良好选项。

BasicHttpBinding was designed for scenarios where interoperability is of utmost importance. As a result, BasicHttpBinding uses HTTP for the transport and text for the message encoding.

BasicHttpBinding是为那些互操作性非常重要的场景而设计的。因此,BasicHttpBinding使用HTTP进行传输和消息编码的文本。

#1


64  

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.

这里有一个不错的流程图,可以帮助你在两者之间做出选择。

网。管与净。tcp与http绑定

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(如果链接不再对您有效,也可以在回路机中找到)。

#2


50  

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).

网。管道,快速和安全,因为您的web服务无法从网络访问(通常,您将使用net。管道与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.

网。tcp更快一点,因为您的soap消息没有封装在HTTP请求中,但是您不能使用RIA技术调用您的web服务,并且一些防火墙将删除您的消息。

#3


14  

Windows Communication Foundation (WCF) is a framework for building services that process XML messages. 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.

Windows通信基础(WCF)是一个用于构建处理XML消息的服务的框架。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。管道,然后使用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 remoting投资的良好选项。

BasicHttpBinding was designed for scenarios where interoperability is of utmost importance. As a result, BasicHttpBinding uses HTTP for the transport and text for the message encoding.

BasicHttpBinding是为那些互操作性非常重要的场景而设计的。因此,BasicHttpBinding使用HTTP进行传输和消息编码的文本。