0
votes

I have small question,

  1. If I host NetTcpbinding WCF service in IIS 7.0 and I want to invoke this service from Client application, then what format this will be used fo communication..??

  2. Is there any rule saying that, all NetTcpbinding should not host on IIS instead they have to host on Console application or windows service..??

  3. When extactly I want to go for TcpNet binding..??

  4. Suppose, I have two endpoints one for WsHttpbinding and other one is NetTcpbinding and deploy Service in IIS then If I want to use NetTcp endpoint from Client application then how..?? Is this correct way to do...?? in this scenario...

Thanks, Sukesh.

1

1 Answers

0
votes

NetTcpBinding Class info:

http://msdn.microsoft.com/en-us/library/ms576421.aspx

  1. Quoted from the remarks:

    The NetTcpBinding generates a run-time communication stack by default, which uses transport security, TCP for message delivery, and a binary message encoding. This binding is an appropriate Windows Communication Foundation (WCF) system-provided choice for communicating over an Intranet.

2. No. There is even this nice blog post on how to do it:

http://blogs.msdn.com/b/santhoshonline/archive/2010/07/01/howto-nettcpbinding-on-iis-and-things-to-remember.aspx

3. Back to the class info:

More generally, the HTTP system-provided bindings such as WSHttpBinding and BasicHttpBinding are configured to turn things on by default, whereas the NetTcpBinding binding turns things off by default so that you have to opt-in to get support, for example, for one of the WS-* specifications. This means that the default configuration for TCP is faster at exchanging messages between endpoints than that configured for the HTTP bindings by default.

This means that this binding doesn't do all the higher level processing that basicHttpBinding and WSHttpBinding do due to the additional protocol layers expected (http layer and WS-* spec layer). So this is a higher performance binding configuration giving you a faster turn around time in your service message replies at the cost of losing your http layer (clients can no longer just HTTP POST soap envelopes to your service).

4. I would set up two separate service endpoints(one TCP and one WSHttp) that implement the same interface. Then you can set up two client config items on the client end that again use different binding configuration but call to the same interface. Then you can just load either.

<client>          
<endpoint name="WSEndpoint" address="http://address/WSEndpoint.svc" binding="WSHttpBinding" contract="Your.Contract.Namespace"/>
<endpoint name="TCPEndpoint" address="http://address/TCPEndpoint.svc" binding="NetTcpBinding" contract="Your.Contract.Namespace"/>
</client>