tags:

views:

347

answers:

2

WCF Binary over TCP option, is it applicable only for Intranet or Internet also?

Is TCP applicable only for Intranet?

+1  A: 

The serializer and the transport are largely unrelated. There are pre-configured bindings for common scenarios, but my understanding is that you can plug the binary serializer (NetDataContractSerializer) into any transport. Or write your own ;-p

However - a different transport may be trickier to configure (firewalls etc) than plain HTTP.

See here (although I would dispute the speed claim; I've seen NetDataContractSerializer thrashed on occasion...)


Re comment - not so much the transport (I suspect you're best off staying with http), but consider this and this. An alternative binary serializer, excellent for sending some types of messages. And it plays nicely with MTOM (over http) too.

Marc Gravell
Thanks Marc. Are there any references you can provide on restrictions on protocol other than HTTP. I need to understand, whether we can use other protocols over internet or not? If possible, what it takes to do that (opening port, etc) ?
@jobless-spt : added some links
Marc Gravell
+1, Binary over HTTP is a good compromise. It reserves the ability to host the service in IIS (I can't tell you the last time I bothered to write my own WCF host) and it's firewall friendly. The HTTP overhead is probably very low if you're not streaming chunks or chatting frequently.
Josh Einstein
+1  A: 

The answer is: it depends. As far as I know, WCF's binary encoding requires both endpoints to be WCF endpoints (which would currently limit you to Windows unless/until Mono supports binary encoding). The other issue would be whether or not you can reach the port on which the remote server is listening. One of the reason running services over HTTP has become so popular is that port 80 is much more like to be open.

Matt McClellan
+1 exactly - in theory, it should work just fine - but it's TCP - not HTTP - so expect firewall problems, and your other end must also talk the same tcp/ip binding with binary encoding, so it's only useful if you control both ends of the communication, really.
marc_s
Thanks. So according to you if I open port 434 (Or whatever for TCP), I should be able to access it over internet? Or do I need to setup VPN Tunnel with Client?
@jobless-spt - The things you'll need to do to access the remote port will vary wildly depending on the network's security configuration. You'll need to talk to your local IT/Sec people to get that sorted out. Note, however, that the security people will probably be very reluctant to expose an additional port to external networks; and if they're not, you might need new security people.
Matt McClellan