0 Replies Latest reply on Sep 2, 2010 2:03 AM by RandomReado

    Zend AMF

    RandomReado Level 1

      I've put my Zend folder into my web root.

       

      From Flex, I'm calling amf.php:

       

      <?

      include '_services/Test/Main.php';

      include 'Zend/Amf/Server.php';

       

      $server = new Zend_Amf_Server();

      $server->setProduction(false);

      $server->setClass('Test_Main', 'test');

      $response = $server->handle();

      echo $response;

      ?>

       

      My _services/Test/Main.php has a class called "Test_Main" and a public method "init()" which simply returns "this is a test".

       

      I've used the services-config.xml file provided by Zend and modified the URI only to point to my amf.php file.

       

      In Flex:

       

      <fx:Declarations>
          <s:RemoteObject id="myAmf"
              fault="faultHandler(event)"
              showBusyCursor="true"
              destination="zend" />
      </fx:Declarations>

       

      protected function creationCompleteHandler(event:FlexEvent):void
      {
          var message:String    =    myAmf.Test_Main.init();
          Alert.show(message);
      }

       

      When I run the application, the call is being made to the amf.php file according to Apache with a response code of 200. However in Flex it says:

       

      "ReferenceError: Error #1069: Property init not found on mx.rpc.remoting.mxml.Operation and there is no default value."

       

      Can anyone tell me why this is happening? There is a similar post on the Zend forums posted in Feb 2009 but it's had loads of views and no replies!

       

      Thanks in advance.