The messages in the WebSocket protocol are in the JSON format (http://www.json.org/). This project relies heavily on Jackson for serialization and deserialization.
Every message in either direction is a JSON-formatted object with the members method
and params
. The member method
is a string with the name of the method to be invoked. The member params
is an array of JSON-formatted objects.
The interpretation of these parameters on the Javascript side is straightforward. The Javascript library executes the method with the given parameters using the apply
method on the callback object.
On the Java side, the system expects exactly one method defined in the Java service with the given name and number of arguments. The JSON objects are converted to the appropriate Java types as described in the section [Passing complex types].