سؤال

I've successfully configured AMF on the flex side. The client is sending messages, but in return it always get empty response ( headers, but no body).

How to debug index.php? How to check if classes are mapped correctly?

Here is my 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());

and 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;
}
}
هل كانت مفيدة؟

المحلول

It turned out that my problem lied on the Flex side rather than php.

My problem wast that I've omit source attribute in RemoteObject declaration. Now it works perfectly :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top