設立的Zend AMF的時候我也跟着在本教程中設置的Zend AMF從我的Flash應用程序將數據傳遞到我的PHP應用程序的方式說明:訪問服務目錄笨
http://codeigniter.com/forums/viewthread/180414/
所以我有目錄結構和一切描述在那裏。這是我的網關控制器:
class Gateway extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('zend');
//root_folder + application + controllers + amf + services
define('SERVICES_FOLDER', APPPATH.'controllers/amf/services/');
}
public function index()
{
$server = new Zend_Amf_Server();
$server->setProduction(false);
//$server->addFunction('testservice');
$server->addDirectory(SERVICES_FOLDER);
echo $server->handle();
}
}
而且APPPATH是/應用/所以通過SERVIES_FOLDER定義的路徑爲 「/應用/控制器/ AMF /服務」,這是我的文件「TestService的。 PHP'坐。
當我嘗試連接到該服務中閃光:
var gateway:String = "http://mysite.com/amf/gateway";
con.connect(gateway);
con.call("Testservice.getMessage", new Responder(onResult, onFault));
它調用onFault方法,並顯示錯誤:
Plugin by name 'Testservice' was not found in the registry;
這讓我覺得addDirectory()行不知怎的,Gateway.php是個問題。有趣的是,我也無法通過URL訪問testservice函數,即通過訪問mysite.com/amf/services/testservice。
對這裏可能發生的事情有任何想法?