I’m developing a library which you can use in client or server code. More specifically, you create an instance of some class for the library and tell it to be a server or a client.
The client must send about 5 attributes to the server without any hierarchical structure, the server must answer with one attribute or some error description.
Client and server don’t have to share any state, so if the server changes the information given by the client, the client doesn’t have to know about these changes.
At the moment I decode everything into a string with a special separating charater and send it over a TCP-Socket. I would like to have a bit more type-safety here and was thinking about using RMI, but as far as my short research went, RMI enforced a shared state on the object, which is not my goal. Therefore I might need some kind of web-service solution? Should I use JAXB to describe the messages and send xml messages over the socket? Is there some good library to send JAXB annotated object over the web and still have some control over communication, network, server failures?
The software should always be able to run on a basic JRE installation.
Thanks for the advice.
Any of the technologies enumerated in the tags are good. You can also take a look at Google Protocol Buffers and Netty for the communication. But I would not call them basic. Also JSON is a good way to go. JAXB is included in the JVM so it will work without any extra library.