And here is how you can replicate the above example response strings:
// success example JSONRPC2Response resp = new JSONRPC2Response(true, "req-002"); System.out.println(resp); // failure example JSONRPC2Error err = new JSONRPC2Error(-32601, "Method not found"); resp = new JSONRPC2Response(err, "req-003"); System.out.println(resp);
The mapping between JSON and Java entities (as defined by the underlying JSON Smart library):
true|false <---> java.lang.Boolean number <---> java.lang.Number string <---> java.lang.String array <---> java.util.List object <---> java.util.Map null <---> null
The JSON-RPC 2.0 specification and user group forum can be found here. @author Vladimir Dzhuvinov
|
|