Hello everyone!
I have a structure named data:
<cfscript>
data = {};
data.from = "
fr...@email.com";
data.to = "
t...@email.com";
data.type = "plain";
data.subject = "test subject #now()#";
data.body = "test email #hash(now())#";
</cfscript>
I call a function from my coldspring factory and pass information from
this structure. This works:
<cfset APPLICATION.beanFactory.getBean("MailService").mailTo(from =
data.from, to=
data.to, type=data.type, subject=data.subject,
body=data.body) />
But, this does not.
<cfset APPLICATION.beanFactory.getBean("MailService").mailTo
(attributecollection = "#data#") />
I get the error "coldfusion.runtime.MissingArgumentException: The FROM
parameter to the mailTo function is required but was not passed in."
How come specifying named parameters work, but when I do
attributecollection, it fails?
What's worse is that I tried the exact same thing with a simple CS
configuration, and it worked! Here's the code that worked:
<cfscript>
data = {};
data.arg1 = "hello";
data.arg2 = "goodbye";
xx = {};
xx.data = data;
xx.do1 = APPLICATION.beanFactory.getBean("test").doStuff(data.arg1,
data.arg2);
xx.do2 = APPLICATION.beanFactory.getBean("test").doStuff
(argumentcollection = data);
</cfscript>
<cfdump var="#xx#" />
So I verified that argumentcollection works, so it must be in the way
I set up my beans, or in the actual CFC code. Where do I start to
troubleshoot?