ColdFusion 9.0 Resources |
Using CORBA interface methods in ColdFusionWhen you use the cfobject tag or the CreateObject function to create a CORBA object, ColdFusion creates a handle to a CORBA interface: the cfobjectname attribute or the CreateObject function return variable. For example, the following CFML creates a handle named myHandle: <cfobject action = "create" type = "CORBA" context = "IOR" class = "d:\temp\tester.ior" name = "myHandle" locale="visibroker"> <cfset myHandle = CreateObject("CORBA", "d:\temp\tester.ior", "IOR", "visibroker") You use the handle name to invoke all of the interface methods, as in the following CFML: <cfset ret=myHandle.method(foo)> Method name case considerationsMethod names in IDL are case sensitive. However, ColdFusion is not case sensitive. Therefore, do not use methods that differ only in case in IDL. For example, the following IDL method declarations correspond to two different methods: testCall(in string a); // method #1 TestCall(in string a); // method #2 However, ColdFusion cannot differentiate between the two methods. If you call either method, you cannot be sure which of the two gets invoked. Passing parameters by value (in parameters)CORBA in parameters are always passed by value. When calling a CORBA method with a variable in ColdFusion, specify the variable name without quotation marks, as shown in the following example:
Passing variables by reference (out and inout parameters)CORBA out and inout parameters are always passed by reference. As a result, if the CORBA object modifies the value of the variable that you pass when you invoke the method, your ColdFusion page gets the modified value. To pass a parameter by reference in ColdFusion, specify the variable name in double-quotation marks in the CORBA method. The following example shows an IDL line that defines a method with a string variable, b, that is passed in and out of the method by reference. It also shows CFML that calls this method.
In this case, the ColdFusion variable foo corresponds to the inout parameter b. When the CFML executes, the following happens:
Using methods with return valuesUse CORBA methods that return values as you would any ColdFusion function; for example:
|