Thank for your answer and source codes Mike. I modified the amfphp 1.9 beta 2 to work with advanced settings, incoming and outgoing class mappings just like the 1.2 version. I needed that because we have a project in amfphp 1.2 almoust done, and we have our VO s in different directories in Flex(written in different modules), but the same directory in php.
Janos --- In flexcoders@yahoogroups.com, "Mike Crowe" <[EMAIL PROTECTED]> wrote: > > Janos, > > The following is working for me with amfphp 1.9. You may want to > check out the patch I submitted to amfphp: > http://sourceforge.net/forum/message.php?msg_id=4166079. Note that > I am now using AMF3 instead of the original AMF0 routines that > Patrick wrote. > > LoginVO.as: > [RemoteClass(alias="com.sidata.all.vo.LoginVO")] > public dynamic class LoginVO extends EventDispatcher > implements ValueObject > { > // Properties > public var /* 37 */ uuid:String; > public var /* 255 */ > user_name:String; > public var /* 255 */ > password:String; > public var /* 20 */ > remember_me:Boolean; > public var /* 20 */ > logout:Boolean; > ... > > > > LoginService.php: > require_once(DIR_PREFIX."sidata/all/vo/LoginVO.php"); > class LoginService > { > public function loginLogin($login) > { > $c = new LoginVO(); > $ret = $c->loginLogin($login); > return $ret; > } > ... > > > > LoginVO.php: > class LoginVO > { > public $_explicitType = "com.sidata.all.vo.LoginVO"; > public /* (string), 37 */ $uuid; > public /* (string), 255 */ $user_name; > public /* (string), 255 */ $password; > public /* (boolean), 20 */ $remember_me; > public /* (boolean), 20 */ $logout; > > function loginLogin($login=null) > { > ... > > > > > > > --- In flexcoders@yahoogroups.com, Patrick Mineault > <patrick.mineault@> wrote: > > > > I removed advancedsettings.php because it required configuration > and > > that is against the amfphp design philosophy (convention over > > configuration). I can see the use for it but more trouble than > it's worth. > > > > Patrick > > > > Kun Janos a écrit : > > > > > > Hi Michael > > > > > > I had them slightly different, I tried your way also and didn't > work :( > > > Class mapping succeded when I rewrote in Flex: > > > [RemoteClass( alias="LoginVO" )] > > > and setup $gateway->setClassM appingsPath( 'com/virtualro/ vo/'); > > > If $gateway->setClassM appingsPath( 'com/virtualro/ vo/') and > > > [RemoteClass( alias="com. virtualro. vo.LoginVO" )] then amfphp > looked for > > > the classes for mapping in com/virtualro/ vo/com/virtualro /vo/ > witch > > > didn't exists. > > > Thanks for your answers Michael, they helped me to solve the > problem. > > > > > > Janos > > > > > > --- In [EMAIL PROTECTED] ups.com > > > <mailto:flexcoders%40yahoogroups.com>, "michael_ramirez44" > > > <michael_ramirez44@ ...> wrote: > > > > > > > > Is this the way you have the mapping setup? > > > > > > > > Actionscript Classes > > > > //Location of PHP classes > > > > [RemoteClass( alias="com. virtualro. vo.LoginVO" )] > > > > [RemoteClass( alias="com. virtualro. vo.TaxVO" )] > > > > > > > > PHP Classes > > > > //Location of AS classes > > > > $_explicitType = "com.virtualro. shell.vo. LoginVO"; > > > > $_explicitType = "com.virtualro. taxes.vo. TaxVO"; > > > > > > > > --- In [EMAIL PROTECTED] ups.com > > > <mailto:flexcoders%40yahoogroups.com>, "Kun Janos" <kunjanos@> > wrote: > > > > > > > > > > Thanks you Michael, but this is not the answer to I was > expecting. > > > > > Maybe I didn't express myself well enough. > > > > > I know that I can set the VO directory in the globals.php. > But > > > > setting > > > > > that won't map my VO -s. > > > > > In my application I have com.virtualro. shell.vo. LoginVO or > > > > > com.virtualro. taxes.vo. TaxVO on Flex, and com.virtualro. > vo.LoginVO, > > > > > com.virtualro. vo.TaxVO on amfPhp (notice that on Flex I > have the VOs > > > > > in separate dirs, and on php I have another structure for > all the > > > > VO-s > > > > > in one dir). With version 1.2 of amfphp I was setting the > incoming > > > > and > > > > > outgoing class mappings using the setCustomIncomingCl > assMappings and > > > > > setCustomOutgoingCl assMappings functions from > $gateway...now in > > > > amfphp > > > > > 1.9 beta 2 these functions are missing, just like the > > > > > advancedsettings. php. > > > > > > > > > > --- In [EMAIL PROTECTED] ups.com > > > <mailto:flexcoders%40yahoogroups.com>, "michael_ramirez44" > > > > > <michael_ramirez44@ > wrote: > > > > > > > > > > > > Janos, > > > > > > > > > > > > Amfphp 1.9 looks for your VO objects in "services\vo" by > default. > > > > You > > > > > > can change this in the globals.php file. > > > > > > > > > > > > Michael Ramirez > > > > > > > > > > > > --- In [EMAIL PROTECTED] ups.com > > > <mailto:flexcoders%40yahoogroups.com>, "Kun Janos" <kunjanos@> > wrote: > > > > > > > > > > > > > > Hi all. > > > > > > > > > > > > > > I just upgraded amfphp 1.2 to amfphp 1.9 beta 2 and class > > > > mapping is > > > > > > > not working any more :( > > > > > > > In one of the messages that Patrick Mineault wrote I > read that > > > > for > > > > > > > class mapping I should put > > > > > > > [RemoteClass( alias="com. virtualro. shell.vo. > LoginVO") ] in Flex > > > > > > > LoginVO.as (just like in amfphp 1.2) and > > > > > > > public $_explicitType = "com.virtualro. shell.vo. > LoginVO"; //in > > > > > > LoginVO.php > > > > > > > I'm using Charles and I see that the data is sent from > flex to > > > > > > amfphp, > > > > > > > but the class mapping doesn't occour. > > > > > > > Using > > > > > > > $msg = ''; > > > > > > > foreach($login as $key => $value){ > > > > > > > $msg .= $key.' -> '.$value.', '; > > > > > > > } > > > > > > > I saw that the data arrives to LoginService. php but > using > > > > > > > $login->username gives null :( meaning that data has > arrived > > > > but > > > > > > class > > > > > > > mapping is not working. > > > > > > > Patrick Mineault also wrote that after setting up > LoginVo.php > > > > and > > > > > > > LoginVo.as we should read the instructions in > > > > advancedsettings. php > > > > > > > The problem is that the file advancedsettings. php > doesn't exist > > > > in > > > > > > > amfphp 1.9 beta 2, and the methods used in amfphp 1.2 > > > > > > > (setBaseCustomMappi ngsPath, setCustomIncomingCl > assMappings and > > > > > > > setCustomOutgoingCl assMappings) have been removed from > the > > > > $gateway. > > > > > > > Can anybody help me? > > > > > > > > > > > > > > Thanks, > > > > > > > Janos > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >