Invokes an object method and returns the result of the invoked method.
invoke(instance, methodName [, arguments])
→ returns any
Invokes the size method on a new HashMap object, which should return 0
invoke(createObject("java", "java.util.HashMap"), "size")
Expected Result: 0
Invokes the method named 'test' on the component Test.cfc with one parameter
obj = createObject("component", "Test");
invoke(obj, "test", {parameter="Test Data"});
Invokes the method named 'test' on the webservice Test.cfc with one argument
obj = createObject("webservice", "https://example.com/test.cfc?wsdl");
invoke(obj, "test", {argument1="Test Data"});
Invokes the method named 'test' on the webservice Test.cfc with multiple arguments
obj = createObject("webservice", "https://example.com/test.cfc?wsdl");
invoke(obj, "test", {argument1="Test Data", argument2="More Data", argument3="Still More Data"});
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.