客户端设置固定端口: http://www.pcreview.co.uk/forums/thread-3307883.php
netTcpBinding 相关讨论:
http://social.msdn.microsoft.com/Forums/en/wcf/thread/740fdf69-98f9-4ac4-b25e-00aa5e5763ed
撮要: netTcpBinding has the dissadvantages that you can't host it in IIS6, (you need a custom host,
or WAS in IIS7), you will need to use a WCF client, and some firewalls may block TCP connections on unknown ports.
NetTcpBinding can be used over the internet, but it may not be the best choice.
of course technically the answer is yes, as long as the IS team agrees to open the ports for TCP communication, which they wouldn't do. The whole reason why webservices/ WCF services come in handy is for the interoperable HTTP based communication bindings
that they offer.
Check the decision chart/ other details from Juval Lowy- http://www.code-magazine.com/article.aspx?quickid=0605051&page=3
You can happily use NetTcpBinding over the internet for duplex. I discuss duplex and bindings here
http://www.dotnetconsult.co.uk/weblog2/PermaLink,guid,b891610a-6b78-4b54-b9a6-4ec81c82b7c0.aspx
you will need two things: the firewall on the machine will have to allow the windows service to listen on the port and external firewalls will need to allow traffic to the machine on the port you listen on
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/03beeb93-39a4-44fd-a08e-97b4dffc099d
撮要: you can use NetTcpBinding over the internet but it's recommended to use over intranet. You must use httpbinding(s) over internet. how ever if both sides are using WCF and .NET you can still use net tcp binding. In short for publishing you service over
the internet you should use http bindings.
防火墙配置 http://stackoverflow.com/questions/4280663/tcp-connection-and-firewalls
撮要: When you deploy to an enterprise, you usually don't have control over their external firewall. The setup of their firewall is made by network administrators following an enterprise wide policy. External firewalls almost always allow outgoing HTTP
requests (otherwise you couldn't browse the web). Some corporate firewalls block outgoing TCP requests, which means you cannot use netTcpBinding. As an example, see this
question for somebody trying to deal with that issue. If you KNOW that the firewall of every one of your customers will allow outgoing TCP, then NetTcpBinding is an appropriate choice.
挑选 WCF binding
http://mohammedatef.files.wordpress.com/2009/06/wcfbinding.jpg