Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
weblover #1
CFINVOKE
Hi,
I've a problem invoking 2 cfc's in one function which has same return
variable. please see the below code. my question is how does it affect if i
return one variable for cfreturn variable. or how do i return 2 diff.variables
for one function, is it possible.
================================================== =======================
<cffunction name="test" access="remote" output="true" returnType="struct">
<cfargument name="testFields" type="struct">
<cfinvoke component="testOne"
method="TestOne"
returnVariable="ReturnValue">
<cfinvokeargument name="tFields" value="#tFields#">
</cfinvoke>
<cfinvoke component="testOne"
method="testtwo"
returnVariable="ReturnValue">
<cfinvokeargument name="tFields" value="#tFields#">
</cfinvoke>
<cfreturn ReturnValue>
</cffunction>
================================================== ==============================
=============
appreciate if anybody could help me.
thanks,
weblover Guest
-
CFInvoke Tag... dumb question
Hi, I would like to know if the CFInvoke tag is available for all versions of CF or just CFMX7? Is it supported on a default install? If not,... -
Using WS Stubs in CFINVOKE Tags
Hi there, I am developing a CF family of web service components that make use of complex data types. I've noticed that CFMX generates stub Java... -
the saxexception on cfinvoke wsdl
this seems to be a pretty common error and Macromedia has yet to give a consistent answer... I'm trying to use cfinvoke to use a web service, and... -
using cfinvoke
Can I use <!--- file abc.cfc---> <cfcomponent> <cffunction> <cfquery> </cfquery> <cfreturn xyz> </cffunction> </cfcomponent> -
passing structures using cfinvoke.
Quick question. Can I create a structure in a cfc and then return in? If so does anyone have a simple example. Thanks. -
Stressed_Simon #2
Re: CFINVOKE
This function will return the result from the testtwo method only, as it is called second it overwrites the ReturnValue variable set by the TestOne method.
Stressed_Simon Guest
-
Stressed_Simon #3
Re: CFINVOKE
To return multiple values from a function add them to a structure.
Stressed_Simon Guest
-
weblover #4
Re: CFINVOKE
does it look like this. pls.advise.
<cffunction name="test" access="remote" output="true" returnType="struct">
<cfargument name="testFields" type="struct">
<cfset treturnvalue = StructNew()>
<cfinvoke component="testOne"
method="TestOne"
returnVariable="treturnvalue.ReturnValue(1)">
<cfinvokeargument name="tFields" value="#tFields#">
</cfinvoke>
<cfinvoke component="testOne"
method="testtwo"
returnVariable="treturnvalue.ReturnValue(2)">
<cfinvokeargument name="tFields" value="#tFields#">
</cfinvoke>
<cfreturn ReturnValue>
</cffunction>
weblover Guest
-
BSterner #5
Re: CFINVOKE
I'd use one of the examples below. No need to invoke the same object twice w/i
the same function call. Also, if you're just using numeric keys, you don't
need a 'Struct'. Use an array.
<!--- Option 1 --->
<cffunction name="test" access="remote" output="true" returnType="struct">
<cfargument name="testFields" type="struct">
<cfscript>
var objTest = createObject("component", "testOne");
var treturnvalue = StructNew();
treturnvalue[1] = objTest.testOne(arguments.tFields);;
treturnvalue[2] = objTest.testTwo(arguments.tFields);
return treturnvalue;
</cfscript>
</cffunction>
<!--- Option 2 --->
<cffunction name="test" access="remote" output="true" returnType="struct">
<cfargument name="testFields" type="struct">
<cfset var treturnvalue = StructNew()>
<cfset var objTest = "">
<cfobject component="testOne" name="objTest" />
<cfset treturnvalue[1] = objTest.testOne(arguments.tFields)>
<cfset treturnvalue[2] = objTest.testTwo(arguments.tFields)>
<cfreturn treturnvalue>
</cffunction>
BSterner Guest



Reply With Quote

