I'm struggling to get a flex class instance back to Amfphp (v2.2)
Simplified code in Flex:
[RemoteClass(alias="Project")]
public class Project
{
public function Project()
{
}
}
Code in php:
class Project {
var $_explicitType = "Project";
public function foo()
{
return "bar";
}
}
At a point, I send this code to the server:
myRemoteObjectService.testMethod(myProjectInstance);
Which is handled in php like this:
public function testMethod($projectInstance)
{
return $projectInstance->foo;
}
This should return 'bar' to my Flex application but instead, I get
faultCode:Channel.Call.Failed faultString:'error' faultDetail:'NetConnection.Call.Failed: HTTP: Status 500'
What DOES work is:
public function testMethod()
{
$project = new Project();
return $project->foo;
}
Any help would be very appreciated!
Dany
Found the answer: The standard location for vo objects is /Services/Vo/ In my case, my vo objects where in /dto/ When I put all my vo objects into /Services/Vo/, everything worked as expected.
BUT
I tried setting /dto/ in config using:
$this->voFolders = array(AMFPHP_ROOTPATH . 'dto/');And that didn't work. So: