Amfphp Class Mapping Issue

Hello,

I’m fiddling around with a drupal installation to act as a backend for my flex application.

I’m trying to use AMFPHP class mapping to send and receive messages from and to php.

The following works fine:

ArrayCollection.php


<?
class ArrayCollection
{
    public $_explicitType = "flex.messaging.io.ArrayCollection";
    public $source = array();
}
?>

When i debug with charles, I can see that the arraycollection object is correctly sent from php.
Also, in debug mode when the request comes in, the arraycollection type is recognized and automatically mapped.

Now,

On the exact same location in the php backend, I have the following DTO:
NewsPostDTO.php


<?
class NewsPostDTO
{    
    public $_explicitType = 'be.titans.model.components.dto.NewsPostDTO';
    
    public $id;
    public $title;
    public $date;
    public $text;
    public $pictureURL;
}
?>

NewsPostDTO.as


package be.titans.model.components.dto
{
    [RemoteClass(alias="be.titans.model.components.dto.NewsPostDTO")]

    public class NewsPostDTO
    {
        public var id:String;
        public var title:String;
        public var date:String;
        public var text:String;
        public var pictureURL:String;
    }    
}

When monitoring in charles, i can see the object type is correctly passed as a
be.titans.model.components.dto.NewsPostDTO object.

However, when the request comes in, the object is not automatically parsed to the correct actionscriptclass.

The question is: Why does it work like a charm for ArrayCollection and not for the NewsPostDTO?

Below is the output of charles response and the service response in flex debugging

Any Ideas would be welcome :slight_smile:

Grtz