Looking forward more support in JSON-RPC feature

Features you would like to see in RCF.
Post Reply
bladewhistle
Posts: 5
Joined: Wed Sep 19, 2012 5:54 am

Looking forward more support in JSON-RPC feature

Post by bladewhistle »

JSON-RPC Support is a very exciting feature in RCF, it is possible to expose some interface to other thin client (python, perl). It can be used for SOA architecture.

But in my testing, seems there are some minor problems in this feature.

RCF does not provide any JSON_RPC examples in client side, I tried some client implementations(Python, javascript...), some succeed, some failed.

In a JSON-RPC request, It has three properties:

method - A String containing the name of the method to be invoked.
params - An Array of objects to pass as arguments to the method.
id - The request id. This can be of any type. It is used to match the response with the request that it is replying to.

The specification does not define the id must be a integer, but in RCF, if the id is not a integer, the call will fail.

There are also some problem in call JSON-RPC from javascript.
In theory, it is possible to use javascript to call JSON-RPC in a web page.

But in many browser, if the webpage location is different with the ajax location, the Cross-domain policy will be applied. In this policy, a HTTP OPTION request will be sent to RCF. Unfortunately, RCF does not support http option request now.

So I failed to call JSON_RPC method in chrome, but I succeeded call JSON_RPC method from RCF from IE8 since it seems IE8 does not support Cross-domain policy.

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Looking forward more support in JSON-RPC feature

Post by jarl »

Thanks for your feedback. The request id issue comes down to a limitation in JSON Spirit, the library we are using to parse JSON-RPC requests. Basically it will fail to parse a JSON-RPC request if the request id is not a number. I would suggest reporting this to the JSON Spirit author here:

http://www.codeproject.com/Articles/200 ... mplemented

That being said, I've also improved the error response that goes back to the JSON-RPC client. Here is an updated build with those changes:

http://www.deltavsoft.com/downloads/RCF-2.0.0.2667.zip

Thanks also for pointing out the issue with cross domain policy - I will make sure we add support for HTTP OPTIONS requests.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

bladewhistle
Posts: 5
Joined: Wed Sep 19, 2012 5:54 am

Re: Looking forward more support in JSON-RPC feature

Post by bladewhistle »

So quick reply!!!
And thanks for the new build.

Post Reply