映射PHP和Flex对象

映射PHP和Flex对象,php,apache-flex,zend-framework,amf,zend-amf,Php,Apache Flex,Zend Framework,Amf,Zend Amf,我正在使用ZendAMF进行远程处理 <?php error_reporting(E_ALL | E_STRICT); //error reporting, not needed require_once "Zend/Amf/Server.php"; //the zendAMF server require_once "process.php"; //our test class $server = new Zend_Amf_Server(); //d

我正在使用ZendAMF进行远程处理

<?php
    error_reporting(E_ALL | E_STRICT); //error reporting, not needed

    require_once "Zend/Amf/Server.php"; //the zendAMF server
    require_once "process.php";  //our test class

    $server = new Zend_Amf_Server(); //declare the server

    $server->setClass("process"); //load our test-class to the server
    $server->setClassMap("Session", "Session");
    echo($server->handle()); // needed to start the server
?>

谢谢。

您需要做一些不同的事情。通常,它类似于添加

[RemoteClass(alias=“Session”)]

添加到AS类的元数据,或者在PHP对象中使用Zend_Amf的函数(如getASClassName())之一。查看韦德·阿诺德(Zend_Amf的作者)关于类映射的屏幕广播。我相信他会得到你的答案


TypeOne错误是正确的;你需要

[RemoteClass(alias="Session")]
[Bindable]
在ActionScript类的顶部

我确定的其他一些事情可能会导致此问题:

  • 类变量必须是公共的,并且具有相同的名称
  • ActionScript类不应具有已定义的构造函数

我在日常工作中使用过AMFPHP,但没有使用Zend AMF工具。在Zend工具中,他们是否有类似于AMFPHP提供的“服务浏览器”的功能?这是我在故障排除服务方面的最佳选择。我只做过PHP方面的工作,没有做过Flash方面的工作。@artlung AMFPHP中的服务浏览器是一个独立的Flash应用程序,OP应该能够轻松地从AMFPHP下载中获取,并将其用作调试工具。Charles Proxy已被证明对我这类工作非常宝贵。如果没有其他原因,这是一个伟大的精神检查。哦,天哪。即使我将元标记添加到我的值对象中,也无法实现这一点。我向Carles询问,php向flex发送严格类型的值对象,但映射不起作用。
[RemoteClass(alias="Session")]
[Bindable]