0 Replies Latest reply on Apr 12, 2007 2:01 PM by andythehotty

    OpenAMF/Flex Resources

    andythehotty
      I'm having a difficult time connecting to an OpenAMF service via Flex Remoting. I can do it fine in Flash but am having problems in Flex. I've also been succesful using an amfphp service and Flex. But when I provide the service information for the OpenAMF service, using the otherwise same code, I get no response. Does anyone know of any good tutorials or source code of a succesful connectionto an openamf service?

      Here is an example of how I am doing it:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" viewSourceURL="srcview/index.html">
      <mx:RemoteObject id="myservice" fault="faultHandler(event)" showBusyCursor="true" source="DNAvigatorService " destination="amfphp">
      <mx:method name="getResult" result="resultHandler(event)" />
      </mx:RemoteObject>

      <mx:Script>
      <![CDATA[
      import mx.managers.CursorManager;
      import mx.rpc.events.ResultEvent;
      import mx.rpc.events.FaultEvent;
      private function faultHandler(fault:FaultEvent):void
      {
      CursorManager.removeBusyCursor();
      result_text.text = "hi";

      }

      private function resultHandler(evt:ResultEvent):void
      {
      //result_text.text = evt.message.body.toString(); // same as: evt.result.toString();
      result_text.text = "resutl";

      }
      ]]>
      </mx:Script>

      <mx:Button x="250" y="157" label="sayHello" width="79" click="myservice.getOperation('getResult').send();"/>
      <mx:Button x="250" y="187" label="test fault" click="myservice.getOperation('getResult').send(); "/>
      <mx:TextArea x="10" y="36" width="319" height="113" id="result_text"/>
      <mx:Label x="10" y="10" text="Result:"/>
      </mx:Application>


      and I am using a properly formed services-config.xml.