title: How do you send a JSON encoded object to a PHP function that takes a PHP class object as a variable?
body: <p>I have a java aplet that is sending a JSON encoded object to a Zend Framework JSON Server.</p>
  
  <p>the problem that I have is the code is setup like this:</p>
  
  <p>ServerController:</p>
  
  <pre><code>public function jsonAction()
  {
  
  $server = new Zend_Json_Server();
  $Server-&gt;setClass('Application_Model_ClassObject', 'co');
  
  if('GET' == $_SERVER['REQUEST_METHOD'])
  {
      $server-&gt;setTarget('...')
             -&gt;setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
      $smd = $server-&gt;getServiceMap();
  
      header('Content-Type: application/json');
  
      echo $smd;
      return
  }
  
  echo $server-&gt;handle();
  }
  </code></pre>
  
  <p>ClassObject function:</p>
  
  <pre><code>/**
  * DoSomethign description
  * @param ClassObject
  */
  public function doSomething(Application_Model_ClassObject $obj)
  {
  
      $someVariable = $obj-&gt;getSomeValue();
      ...
  }
  </code></pre>
  
  <p>I get an error response from the server saying that <code>obj</code> needs to be an instance of <code>ClassObject</code></p>