4 Replies Latest reply on Aug 10, 2011 9:30 PM by Josue Mancilla

    How to send ValueObject from flex to PHP? using AMFPHP

    Sonunew2flex Level 1

      Hi Friends,

       

      i mapped vo object.

       

      this is my package

       

      package customers

      {

      [RemoteClass(alias="customers.CustomerVO")]

      [Bindable]

      public class CustomerVO

      {

      public var name:String;

      public var title:String;

      public var companyname:String;

      public var address:String;

      public var city:String;

      public var country:String;

      public var postalcode:String;

      }

      }

       

      and this is my php class for this

       

      <?php

       

        class CustomerVO{

              public $name;

              public $title;

              public $companyname;

              public $address;

              public $city;

              public $country;

              public $postalcode;

       

              var $_explicitType = "customers.CustomerVO";

        }

      ?>

       

      both are mapped and i got result in flex side.

       

      now i want to send object of CustomerVO to php.

       

      i am doing like this

      var addcustomer:CustomerVO=new CustomerVO();

      addcustomer.name="sunil";

      addcustomer.title="test";

      addcustomer.companyname="test";

      addcustomer.address="test";

      addcustomer.city=t"test";

      addcustomer.country="test";

      addcustomer.postalcode="test"t;

       

      CustomerSRV.addCustomer(addcustomer);

       

      if i send like this i am getting fault string as

       

      Argument 1 passed to CUSTOMERDATA::addCustomer() must be an instance of CustomerVO, array given

       

      this is my CUSTOMERDATA class method

       

            public function addCustomer(CustomerVO $newcustomer){

       

                return "success";

            }

       

      Where i am wrong? how to send vo to php?

       

      Thanks