【问题标题】:How to check if class was properly mapped in Zend_amf?如何检查 Zend_amf 中的类是否正确映射?
【发布时间】:2012-01-09 21:00:29
【问题描述】:

我已经成功地在 flex 端配置了 AMF。客户端正在发送消息,但作为回报,它总是得到空响应(标头,但没有正文)。

如何调试 index.php?如何检查类是否映射正确?

这是我的index.php

use Project\Entity\Product;

require_once('Zend/Amf/Server.php');
require_once(realpath(APPLICATION_PATH . '/models/Amf/') . DIRECTORY_SEPARATOR. 'AmfService.php');

$server = new Zend_Amf_Server();
$server->setClass('AmfService');
$server->setClassMap("Product", "Product");

echo($server -> handle());

AmfService.php:

use Project\Entity\Product;

class AmfService {

 public function getProducts(){
    $result = array();

    $product = new Product();

    $product->description = "desc";
    $product->title_pl = "title";

    $result[] = $product;

    return $result;
}
}

【问题讨论】:

    标签: apache-flex zend-framework amf zend-amf


    【解决方案1】:

    原来我的问题在于Flex而不是php

    我的问题是我在 RemoteObject 声明中省略了 source 属性。现在它完美地工作了:)

    【讨论】:

      猜你喜欢
      • 2014-04-12
      • 2021-11-20
      • 2016-03-19
      • 1970-01-01
      • 2019-04-10
      • 1970-01-01
      • 1970-01-01
      • 2021-11-12
      • 2015-11-06
      相关资源
      最近更新 更多