2012-06-24 9 views
0

플래시에서 끝점을 호출하면 모든 작업이 제대로 수행되지만 응답은 비어 있습니다. 코드는 다음과 같습니다 Zend_Amf_Server의 빈 응답

class Application_Model_Amf { 
    /** 
    * 
    * @param bytearray $data 
    * @param string $dateString 
    * @return int 
    */ 
    public function save($data, $dateString) 
    { 
     $dateString = str_replace(array('|', ':'), array('_', ''), $dateString); 
     //file_put_contents("$dateString.jpg", $data); 
     $r = new stdClass(); 
     $r->error = 0; 
     return $r; 
    } 
} 

class AmfController extends Zend_Controller_Action { 
    public function indexAction() 
    { 
     $server = new Zend_Amf_Server(); 
     $server->setProduction(false); 
     $server->setClass('Application_Model_Amf'); 
     $response = $server->handle(); 
     echo $response; 
    } 
} 

가 나는 또한
public function save($data, $dateString) 
    { 
     $dateString = str_replace(array('|', ':'), array('_', ''), $dateString); 
     //file_put_contents("$dateString.jpg", $data); 
     return true; 
    } 

을 시도했지만이 둘을 일 - 여전히 빈 응답을. 이 stdClass()와 같은 응답을 어떻게 반환 할 수 있습니까? 또는 정수 값 1 또는 0 만?

답변

0

이 솔루션은 추가하는 것입니다 die()

public function indexAction() 
{ 
    $server = new Zend_Amf_Server(); 
    $server->setProduction(false); 
    $server->setClass('Application_Model_Amf'); 
    $response = $server->handle(); 
    echo $response; 
    die(); 
}