Login Register

PHP server side coding for rpc.JsonService?

Hi,
I have one question and a clarification for implementors:
Question: There don't seem to be a lot of JSON RPC server implementations for PHP. Are there others besides PHP-O-lait?  Can someone comment on the robustness of solutions out there?

Clarification: For those not familiar with json-rpc see the spec here: http://json-rpc.org/wiki/specification
In the documentation here: http://dojotoolkit.org/book/dojo-book-0-4/part-5-connecting-pieces/i-o/r...
it indicates that the results are transferred to the calling function:
"As you can see, we've added myCallbackMethod as a callback for the deferred object returned from myObject.add(). In this case myCallbackMethod will be called with parameter with a value of 8."

The JSON-RPC server returns the results via HTTP as a Json object of the form {'result':'results here','error':'error information here'}.
In php to return an object to dojo the result content should be an array/object and not a json_ecoded string the json_encode of the result
converts the array to an embedded json string.  The json object from dojo is passed to php in $HTTP_RAW_POST_DATA of the form

{"params":[parameter array],"method":"methodname","id":dojo assigned id (seems to be an integer)}

PHP Server output example (vastly simplified)

print json_encode(array('return'=>array('type'=>'message','body'=>'some text here'),'error'=>'','id'=>'incoming message id'));

(the inner array is passed to javascript as an object see below)
Client callback function:

function HandleReturn(stuff){
rtnType = stuff.type;
rtnBody =stuff.body';
}

I don't know if this helps anyone else but at least it helped me understand it.

regards
Steve