Passes
the name and value of a parameter to a component method or a web service.
This tag is used in the cfinvoke tag.
Extensibility tags
<cfinvokeargument
name="argument name"
value="argument value"
omit = "yes|no">
attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.cfargument, cfcomponent, cffunction, cfinvoke, cfobject, cfproperty, cfreturn
ColdFusion
MX 7: Added the omit attribute.
ColdFusion MX: Added this tag.
Attribute |
Req/Opt |
Default |
Description |
|---|---|---|---|
|
Required |
Argument name. |
|
|
Required |
Argument value. |
|
|
Optional |
|
Enables you to omit a parameter when invoking
a web service. It is an error to specify
|
You can
have multiple cfinvokeargument tags in a cfinvoke tag
body.
You can use cfinvokeargument tag to
dynamically determine the arguments to be passed. For example, you
can use conditional processing to determine the argument name, or
you can use a cfif tag to determine whether to
execute the cfinvokeargument tag.
If you
are invoking a web service, you can omit a parameter by setting
the omit attribute to "yes". If
the WSDL specifies that the argument is nillable, ColdFusion MX
sets the associated argument to null. If the WSDL specifies minoccurs=0,
ColdFusion MX omits the argument from the WSDL.
<cfinvoke
component="nasdaq.quote"
method="getLastTradePrice"
returnVariable="res">
<cfinvokeargument name="symbol" value="mot">
<cfinvokeargument name="symbol" value="macr">
</cfinvoke>
<cfoutput>#res#</cfoutput>
<!--- Using cfinvoke to consume a web service using a ColdFusion component. --->
<cfinvoke
webservice="http://www.xmethods.net/sd/2001/TemperatureService.wsdl"
method="getTemp"
returnvariable="aTemp">
<cfinvokeargument name="zipcode" value="55987"/>
</cfinvoke>
<cfoutput>The temperature at zip code 55987 is #aTemp#</cfoutput>