Search code examples
.netwpfwcfwcf-binding

WCF service TCP/Ip vs Http protocol for Internet vs Intranet service consumption


I have a WCF service, which can be consumed through jQuery based web app in internet and also through WPF app in local intranet.

Should I choose http or TCP protocol OR should i make two similar services with http protocol for internet and TCP protocol for Intranet.


Solution

  • I am not an expert of WCF but here my two cents:

    in WCF bindings are only a matter of configuration, meaning the web.config for the WCF end point and the app.config for your WPF client.

    You need only one service and eventually multiple bindings/endpoints in the server web.config

    client applications will connect using one of the two end points and a client binding/protocol as needed without any need for you to have two services or to make any specific change.

    in an intranet netTCPbinding is probably the fastest option as it transfer binary data, in Internet httpBinding should work well; Notice that you could use httpBinding also in the intranet with no issues and if it will be much slower or fully equivalent to the netTcp binding has all to be proven depending also on your usage transer type/content.