On Saturday, February 19, 2011 03:25:12 pm Simon Walter wrote:
> http://zend-framework-community.634137.n4.nabble.com/Zend-json-Client-or-Ho
> w- to-start-contributing-td1755405.html
I've tried out Lars' code mentioned in the above email. There are a few
problems:
1. The JSON-RPC spec states: error - An Error object if there was an error
invoking the method. It must be null if there was no error.
However we have: if(array_key_exists('error', $response))
It should probably be: if(array_key_exists('error', $response) &&
!is_null($response['error']))
2. According to the ZF
docs(http://framework.zend.com/manual/en/zend.json.server.html), if we send a
GET request to the server, we should get back an SMD. However "$this->_client-
>doRequest($request, $this->_smd)" will make a POST request to the server.
I've modified those two issues, and the code works. Though, there are probably
other issues that I've overlooked as I have not done extensive testing - esp.
WRT error handling and checking of the ids.
If you want a diff of my changes, please let me know.
Also, if I should be sending this elsewhere, please let me know.
Regards,
Simon