WCF to Unix communincation

Topics: Web Api, WebSockets
Jan 16, 2012 at 5:07 AM


I am designing a two way client-server communication. The server will be Windows based. There can be as many as 200 clients communicating to one server, some of the clients  can be on Windows and remaining on Unix.The communication should be secure (TLS/SSL). The clients can not be hosted in a web-server, in other words, they can be a process/windows service or daemon.

With very limited understanding of WCF and Unix I listed down the following designs. Before going further with my reading and prototyping, wanted to validate it with you people for feasibility, simplicity, efficiency and productivity of the options. 

Option 1> Have the client-to-server and server-to-client communication over raw sockets. Secure the communication using certificates on both end.

Problems with this approach: Since it is raw socket programming,  I will need to interpret the command and data before serializing it on the senders side and do the reverse on recipient side. This may reduce my as well as applications productivity.  Also the complexity of managing certificates for 200 clients and a server will be very high operational cost.

Option 2> Expose the server using WCF on WsHTTP(s) binding. The client can be developed in C++. The client will generate proxy using the metadata and wsdl exposed by the server. The client will be able to communicate with server using this proxy. When client connects to the server for the first time, the server will issue a key, that it will use for encrypting data for the client in next 24 hours. After which next key will be issued to the client. Ofcourse, the client will be able to request a new key anytime.

For Server-to-client communication, the client will be listening on a port (socket programming) and the server would communicate directly on the published port. The server will send the data encrypted using the key which was generated when client connected to it.

Problem The cost of raw socket programming is still there, however it is less than option 1. 


Option 3> Have the server on WCF using WsHttp(s) binding and the client also exposes itself on equivalent of WsHttp(s) binding in native c++. The server would generate proxy using the WSDL of the client service. Authentication can be either certificate based or password based.

In my opinion option 3 would be best. I don't know what tools are available for doing it in the native language without using WCF. I also have following questions.

Question a> When server is in WCF ,WsHttp(s) binding, what tool can I use to generate proxies for native C++ from wsdl/metadata.

Question b>How to expose a service from a c++ process running on Windows/Unix on WsHTTP(s)? So that I can generate a proxy on the server side, which can be used by Server to communicate with client.

If you know any other option or pattern or example, please suggest.


Thanks in advance,


Jan 17, 2012 at 7:05 AM

WsHttp binding, proxy generation from metadata, WSDL, etc....  this is the stuff of WCF + SOAP.  Despite the "WCF" in its name, Web API is not about SOAP.  It's about REST (but not exclusively so).

Try posting here: http://social.msdn.microsoft.com/Forums/en-US/wcf/threads

Jan 17, 2012 at 1:07 PM

Thanks Andrew! I would post it on the forum pointed by you. Though I had mentioned a few option, I am open for other options like REST, socket programming, etc. I want to evaluate the possible options and choose the best out of it.

Jan 17, 2012 at 3:28 PM

To evaluate the REST approach vs SOAP, have a read of the excellent O'Reilly book "REST in Practice".