I am currently writing an application having a client server architecture.
The client is a Java android application The server is a C# application.
The client will pull data from the server but in some cases push some data to the C# server as well.
The data that server needs to forward the clients is list of data structures (perhaps in the form of XML?), sometime binary data like files.
The client and server are communicating over a wireless network.
Speed and scalability is my top most priority in the design of the system,...
I have to write server as well as the client myself. I will be using sockets for communication.
I need your advise on the form of protocol I should use to exchange data between the Java client and C# server.
Should I write similar data structures (which seems redundant) in java and C# and serialize them ??
or should I exchange xml ??
I am not sure yet what is the best way to do it .. Essentially there will be commands from client and server will respond with data
Please advise me on this topic the data communicated could be be as large as several gigs over wifi so speed is very important.
Well, there's always JSON. It should be well-supported on both ends and is easy for your server to generate and client to consume. Not sure it helps with your bandwidth concerns any...
WCF might be approperiate for this,
WCF uses soap so a Java implementation should work well.
WCF also supports steaming, so transferring large files is possible, though I'm not sure if Java supports the streaming protocol.
As for performance, you will probably be limited by the speed of the device and not the protocol.
Have a look at this session from TechEd 2011: "My Customers Are Using iPhone/Android,But I'm a Microsoft Guy. Now What?"
It would probably be worth looking into MonoDroid if you want to share code between client and server (and if serialize/de-serialize makes sense).
As I don't know what you're building, I would advise you to read up on REST before you continue though. It should give you valuable pointers on how to create a nice API that can be easily consumed by various clients.