0 Replies Latest reply on Feb 15, 2007 12:08 PM by Ned01

    HELP: Problem using AS3 and CF-Flash Remoting CFC

    Ned01
      I am trying to use CF flash remoting from an AS3 Class using the NetConnection class. The approach I am using is directly from "ActionScript 3.0 Cookbook" by Joey Lott et. al.

      I am using a totally standard default install of CF, Flex and SQL server on Windows 2003 R2.

      When I do a CF Flash remoting call using,

      _netConnection = new NetConnection();
      _netConnection.connect(' http://pordev2.wcrt.xeroxlabs.com:8500/flashservices/gateway/');
      _netResponder = new Responder(onGotData, onGotError);
      _netConnection.call("porTechDB.PorComponents.ProjValuationRemote.getProjValuationData", _netResponder, 1, strtest);

      all seems OK. The CFC returns the integer and string just fine.

      HOWEVER, when I also add an associative array, "aa", to the string of arguments, I get an error...

      _netConnection.call("porTechDB.PorComponents.ProjValuationRemote.getProjValuationData", _netResponder, 1, strtest, aa);

      returns the error: "Unknown object type tag (17)"

      The same error is also returned if "aa" is an XML variable instead of an associative array.

      So:
      a) Is this a bug?
      b) Is there an AS3 specific gateway I should have referenced?
      c) Is Flash Remoting not yet supported in AS3?

      Thanks you for your time,

      Ned

      =================================================================

      Here is my test code:

      <cfcomponent displayname="ProjValuationRemote" hint="Returns an array of Project Header, Valuation and supporting data recordsets">
      <cffunction access="remote" name="getProjValuationData" output="false" returntype="String">

      <cfargument name="test1" type="numeric" required="no" default=1>
      <cfargument name="test2" type="string" required="no" default = "a default string">
      <cfargument name="AA" type="Struct" required="no">

      <cfset testReturn = #test2# & ": TESTING -- This is the return integer: " & #test1#>
      <cfreturn testReturn>
      </cffunction>
      </cfcomponent>

      public function requestVRD():void {
      var strtest:String = "Simple test string";
      var aa:Object = new Object();
      aa.curDataSet = 86;
      aa.curYear = 2007;
      _netConnection = new NetConnection();
      _netConnection.connect(' http://pordev2.wcrt.xeroxlabs.com:8500/flashservices/gateway/');
      _netResponder = new Responder(onGotData, onGotError);
      _netConnection.call("porTechDB.PorComponents.ProjValuationRemote.getProjValuationData", _netResponder, 1, strtest);
      }

      private function onGotData(re:String):void {
      // arVRD = re;
      trace(re);
      returnString = re;
      trace("got remote data response");
      }



      private function onGotError(error:Object):void {
      trace("Executing the gotProjectData_Fault: " + error.description);
      trace("Executing the gotProjectData_Fault -- no detail");
      // setErrorAlert();
      }


      This works as expected producing the following trace:

      Simple test string: TESTING -- This is the return integer: 1


      Replacing the remote with the following, which adds an array to the parameter list...

      _netConnection.call("porTechDB.PorComponents.ProjValuationRemote.getProjValuationData", _netResponder, 1, strtest, aa);


      Produces the following error:

      Executing the gotProjectData_Fault: Unknown object type tag (17)