netTcpBinding or wsHttpBinding

2019-02-11 17:38发布

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?

5条回答
做自己的国王
2楼-- · 2019-02-11 17:56

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

查看更多
走好不送
3楼-- · 2019-02-11 17:57

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

查看更多
爷的心禁止访问
4楼-- · 2019-02-11 17:58

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.

查看更多
Animai°情兽
5楼-- · 2019-02-11 18:06

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...netTcpBindnig should be up to the job.

查看更多
做自己的国王
6楼-- · 2019-02-11 18:06

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

查看更多
登录 后发表回答