[SabreAMF] Mapping continue to don't work well

Oscar scriviaoscar at yahoo.it
Mon Feb 2 07:52:13 PST 2009


I've put"SabreAMF_ClassMapper::registerClass("business.Utente","Utente");" into gateway.php before "$server->exec();" but nothing ... self problem!





----- Messaggio originale -----
Da: Evert | Rooftop <evert at rooftopsolutions.nl>
A: Oscar <scriviaoscar at yahoo.it>
Cc: sabreamf at osflash.org
Inviato: Lunedì 2 febbraio 2009, 15:58:24
Oggetto: Re: [SabreAMF] Mapping continue to don't work well

Hi Oscar,

I'm thinking 'myFun' is probably a method, which is called from flex.

The problem here is, that the entire request has already completely  
been handled and decoded.
So, the trick is to call registerClass before anything else.. (so  
before you hit $server->exec()).

Evert

On 2-Feb-09, at 9:15 AM, Oscar wrote:

>
> Continue to don't work well, I done this try:
>
> business in PHP and Flex
> <?
> class Utente{
>  var $idUtente;
>  var $nome;
>
> }
> ?>
>
> package business{
>    [RemoteClass(alias="business.Utente")]
>    [Bindable]
>    public class Utente    {
>        public var idUtente:uint;
>        public var nome: String = "pluto";
>
>    }
> }
>
>
> function that I call into flex across SabreAMF, function PHP:
>
> public function myFun($u){
>      SabreAMF_ClassMapper::registerClass("business.Utente","Utente");
>      print_r($u);
>      print($u->nome);
>      $u->nome = "pippo";
>
>      return $u;
> }
>
> the result is:
>
> "print_r($u)" print the object:
>
> SabreAMF_TypedObject Object
> (
>    [amfClassName:private] => business.Utente
>    [amfData:private] => Array
>        (
>            [idUtente] => 0
>            [nome] => pluto
>        )
>
> )
>
> "print($u->nome)" don't print nothing that is "" (character empty)
>
> in
> flex I receive the object "Utente", so I can print "utente.nome" on
> flex and it print "pluto" and not "pippo" that I've updated into
> "myFun".
>
> the class Utente has mapped because if I call into
> "myFun" the function
> "SabreAMF_ClassMapper::getLocalClass('business.Utente')" I receive
> "Utente".
>
> While it work almost well if myFun is:
>
> public function myFun($u){
>      SabreAMF_ClassMapper::registerClass("business.Utente","Utente");
>      print_r($u);
>      print($u->nome);
>      $u->nome = "pippo";
>
>      return $u->nome;
> }
>
> in fact "print_r($u)" print like before, "print($u->nome)" print  
> like before, while in flex I receive the string "pippo".
>
> The problem is with the objects., that is to work into PHP with the  
> object received from flex.
>
> Thanks a lot
>
>
>
>
>
> _______________________________________________
> sabreamf mailing list
> sabreamf at osflash.org
> http://osflash.org/mailman/listinfo/sabreamf_osflash.org
>


      



More information about the sabreamf mailing list