Hi, I've found that if I send an object to a CF component;
MyService.MyFunction( anObject );
And try to catch it with;
<cfargument name="theObject" type="struct" required="yes">
It throws back an error saying no argument was passed, and yet if I put a
random string before hand....
MyService.MyFunction( "gibberish", anObject );
and catch with;
<cfargument name="theString" type="string" required="yes">
<cfargument name="theObject" type="struct" required="yes">
It all works ok and I can access theObject fine....
Huh?? Am I missing something? Why wont it work if its only the object sent?
Surely the type translation is the same?
JadeBlue - 26 Sep 2005 19:31 GMT
Clacker,
When you send an object/struct as the only parameter, the gateway thinks you
are sending all parameters as an argument collection, trying to match the
object properties to each cfargument name. Because your object does not contain
a property called theObject, your function is not receiving any argument.
You can send your object inside another object:
MyService.MyFunction( {theObject: anObject } );