سؤال

I have an api that I need to call that uses json-rpc-1.0 (I have no control of the implementation). I'd like to be able to manipulate jaxb objects and have them marshal into json-rpc-1.0 format. Is this something that jackson/jersey-json can accomplish or is there a different library that can achieve this goal?

هل كانت مفيدة؟

المحلول

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

However, since the latest JSON-RPC spec (2.0 - http://www.jsonrpc.org/specification) does not specify how request and responses are mapped to HTTP verbs (POST, GET, etc.) and status codes, there could be 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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top