title: Invoke function by proxy
body: <p>I am trying to create a cf component to proxy another one. At the moment the code looks like this:  (stripped down for the sake of example):</p>
  
  <pre><code>public MyFuseboxProxy function init( Required any myFb ){
      variables.myFusebox = arguments.myFb;
      return this;
  }
  
  this.do = variables.proxy;
  
  private any function proxy(){   
      var local.functionName = getFunctionCalledName();
      var local.function = variables.myFusebox[local.functionName];
      var local.returnVal = local.function( arguments );
      ...
  }
  </code></pre>
  
  <p>As you can see, it's quite straight forward. I pass in my target object at initialisation then use the proxy method to intercept function calls.  I am using cfscript, and don't want to use cfinvoke, so am using this approach.</p>
  
  <p>I then call the proxy as follows:</p>
  
  <pre><code>var local.proxy = new ab.MyFuseboxProxy( myFusebox ); 
  var local.dump = local.proxy.do ( action='display.body', contentvariable="body" );
  </code></pre>
  
  <p>However, when I execute the above code I get the following error:</p>
  
  <blockquote>
    <p>The ACTION argument passed to the do function is not of type string.</p>
    
    <p>If the component name is specified as a type of this argument, it is possible that either a definition file for the component cannot be
    found or is not accessible.</p>
    
    <p>The error occurred in C:/ColdFusion10/cfusion/wwwroot/fusebox5/myFusebox.cfc: line 301</p>
  </blockquote>
  
  <p>The error is reported on the target component, so it seems like the function is being called, and the arguments passed through, but the type is not being preserved/recognised as a String.</p>
  
  <p>Can anyone advise what I am doing wrong or how I can preserve the argument types?</p>