views:

1651

answers:

4

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?

+3  A: 

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.

Justin Niessner
Thanks for your reply. I think I still need to specify the end point otherwise how will I add reference to the client Website... please correct me if I am missing something. Or did you mean something else when you say... 'you don't need to provide an endpoint for any external consumers of the service'
inutan
When you say website, I assumed you meant a ASP.NET site running on your hardware on your network. If so, any connections to the WCF service will be made from the Web Server to your service before being returned to the client. If you want 3rd parties to connect to your service, then wsHttpBinding would be better because it wouldn't tie them to a platform.
Justin Niessner
Thank you! you have assumed that right :-)
inutan
+2  A: 

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.

Mark Seemann
+1  A: 

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

Darin Dimitrov
+1  A: 

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

Rasik Jain