0 Replies Latest reply on Mar 10, 2010 7:36 AM by flex_n00b

    Using VO with AMFPHP Flex




      I have made the following ActionScript class, Person.as for the Flex Application. This gets the details about a person from a Form I have in the Application.



      package info.mysite
          public class Person {
              public var username:String;
              public var password:String;
              public var fname:String;
              public var lname:String;
              public var email:String;
              public var gender:String;
              public var bdate:Date;


      I am sending this data using a Remote Object to AMFPHP. Here are my services-


      class Person {
          public $username;
          public $password;
          public $fname;
          public $lname;
          public $email;
          public $gender;
          public $bdate;
          // explicit actionscript class
          var $_explicitType = "info.mysite.Person";




      and my main Service-


       * Service to feed registration data
      require_once ('Person.php');
      require_once ('db.php');
      class Feed
           * Adds a new user
           * @returns Status of operation 
          public function feedData(Person $a) {
                             //Connect to the DB
                             $query="insert into users(username,password) values($a->username,$a->password)";
                             return "true";
                             else return "false";


      When I test the service, AMFPHP reports error as argument given as array, expected an object of Person type. I am calling the method in Flex as myRemoteObject.feedData(<object of Person class>)


      Where am I going wrong?