Does either of the following:

* Invokes a component method from within a CFML page or
* Invokes a web service.
Different attribute combonations make some attributes required
at sometimes and not at others.

 <cfinvoke method="">


cfinvoke Attribute Reference

component string

String or component object; a reference to a component, or
component to instantiate.

method string

Name of a method. For a web service, the name of an

returnvariable variableName

Name of a variable for the invocation result.

argumentcollection string

Name of a structure; associative array of arguments to pass
to the method.

username string

Overrides username specified in Administrator > Web Services

password string

Overrides passowrd specified in Administrator > Web Services

webservice URL

The URL of the WSDL file for the web service.

timeout numeric

The timeout for the web service request, in seconds

proxyserver string

The proxy server required to access the webservice URL.

proxyport numeric

The port to use on The proxy server.

proxyuser string

The user ID to send to the proxy server.

proxypassword string

The user's password on the proxy server.

serviceport string

CF 7+ The port name for the web service. This value is
case-sensitive and corresponds to the port element's
name attribute under the service element. Specify this
attribute if the web service contains multiple ports.
Default: first port found in the WSDL.

refreshwsdl boolean
Default: false

CF 8+ * yes: reload the WSDL file and regenerate the artifacts used to consume the web service
* no
  • true
  • false

wsdl2javaargs string

CF 8+ A string that contains a space-delimited list of arguments to pass to the WSDL2Java tool that generates Java stubs for the web services.

wsVersion string

CF 10+ Used to specify the version of Apache Axis (web service engine used by CF) to use. Specify 1 for Axis Version 1 or 2 for Axis 2.
  • 1
  • 2

Examples sample code using the cfinvoke tag

Invoke a SOAP webservice using cfinvoke

Calls a remote web service to perform an addition, uses cfinvokeargument to pass the arguments to the method.

<cfinvoke webservice="" method="add" returnvariable="answer">
    <cfinvokeargument name="x" value="2">
    <cfinvokeargument name="y" value="3">

Expected Result: 5.0

Fork me on GitHub