Better solution for remote communication between GUI and server
in our company we are going to develop a server application, and a GUI which will control it. The server application is made in c++. We need to be able to send commands from the GUI to the application. They will have usually few parameters, and the data will not be very big (hardly bigger then 1kb). At first, the GUI will run on the same system of the server, but the requirement is the GUI to be placed in another machine. An important requirement is that while the GUI needs to send asynchronous calls to server meth开发者_运维问答ods, the server too must be able to send data to the GUI (for example, for reporting errors). Right now we are evaluating the technology for the communication protocol between the GUI application and the server. We are open to various opportunities, such as SOAP, XML-RPC, JSON, Protocol buffer or others. In the case of SOAP or similar protocols, due to the bidirectionality requirement, we could evaluate the possibility to create a polling mechanism, i.e. the GUI would periodically "ping" the server, without the need of a simmetric SOAP server, if needed.
I would like to have some suggestions regarding the various solutions available.
Update: we also need a system for authentication and encryption. HTTPS would be a viable solution.
zeroc's ice is also a communication middleware system worth checking, it has bidirectional connections and icestorm has a publish/subscribe model that allows asynchronuous method invocation
Personally, I'd go with JSON. It's a lot less verbose than XML (and by extention, SOAP), and there are plenty of libraries you can use to handle the serializing and de-serializing of the JSON data, and plenty of good tools to display JSON data in a nice way.
In my opinion, it can be just as readable to the human eye (when formatted) as XML. And you don't have the overhead of XML, either.
精彩评论