WCF>Web服务:basicHttpBinding与netTcpBinding [英] WCF > Web Service: basicHttpBinding vs netTcpBinding
问题描述
当我遇到以下问题时,我试图理解WCF的基本知识:
I'm trying to understand the basic of WCF, when I came across following question:
为什么要通过 netTcpBinding
使用 basicHttpBinding
作为Web服务?
Why use basicHttpBinding
over netTcpBinding
for a web service?
它们两个都可以有一个混合端点,使您可以通过添加服务器引用窗口轻松地添加它们,而无需进行任何配置?
Both of them can have a mex endpoint which allows you to add both of them easily through the Add Server Reference window, without any configuration at all?
我知道 HTTP
协议是建立在 TCP
协议之上的,但是对我来说,HTTP似乎提供了许多简单的样板(性能等)
I'm aware of that the HTTP
Protocol is built on top of the TCP
Protocol, however to me it just looks like that HTTP provides a lot of unessecary boilerplate (perfomance etc.)
任何人都可以澄清一下,为什么您会选择一个用于Web服务吗?
Could anyone please clarify why you would choose one over the other for a web service?
推荐答案
所有功能,兼容性,安全性和性能都有待解决
It has all todo with capabilities, compatability, security and performance
它可以归结为:如果您的客户端支持WCF并且位于Intranet上,请使用netTcp.
It boils down to: use netTcp if you're clients support WCF and are on your intranet.
如果需要支持可能在Internet上的较旧"(asmx)或兼容"(java/rails/pythone)客户端,请使用basicHtpp.
use basicHtpp if you need to support 'older' (asmx) or 'compatible' (java/rails/pythone) clients, which might be on the internet.
请参阅: http://msdn.microsoft.com/en-us/library/ff649887.aspx
和
http://mohammedatef.wordpress.com/tag/basichttpbinding/
这篇关于WCF>Web服务:basicHttpBinding与netTcpBinding的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!