我有一个 java aplet 将 JSON 编码对象发送到 Zend Framework JSON 服务器。
我遇到的问题是代码设置如下:
服务器控制器:
public function jsonAction()
{
$server = new Zend_Json_Server();
$Server->setClass('Application_Model_ClassObject', 'co');
if('GET' == $_SERVER['REQUEST_METHOD'])
{
$server->setTarget('...')
->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
$smd = $server->getServiceMap();
header('Content-Type: application/json');
echo $smd;
return
}
echo $server->handle();
}
类对象函数:
/**
* DoSomethign description
* @param ClassObject
*/
public function doSomething(Application_Model_ClassObject $obj)
{
$someVariable = $obj->getSomeValue();
...
}
我从服务器收到一个错误响应,说obj
需要是ClassObject