Is it possible to configure Jersey-Json / Jackson to produce json-rpc-1.0?

I have an api that I need to call that uses json-rpc-1.0 (I have no control over the implementation). I would like to be able to manipulate jaxb objects and marshal them in json-rpc-1.0 format. Is this something Jackson / Jersey Json can do, or is there another library that can accomplish this?

+4
source share
1 answer

No, Jersey cannot be configured to support JSON-RPC, but Jersey can be used to implement JSON-RPC. JSON-RPC defines a protocol with requests and responses and can be implemented via HTTP. Jersey (and all JAX-RPC implementations) can be used to implement any HTTP protocol.

However, since the latest JSON-RPC specification (2.0 - http://www.jsonrpc.org/specification ) does not indicate how the request and responses are mapped to HTTP verbs (POST, GET, etc.) and status codes, they can There are some incompatibilities between JSON-RPC implementations.

Instead of using Jersey to implement JSON-RPC, you might be better off using an existing JSON-RPC implementation, see also http://en.wikipedia.org/wiki/JSON-RPC#Implementations

+2
source

Source: https://habr.com/ru/post/1436448/


All Articles