User Guide

Table Of Contents
964 Chapter 38: Integrating COM and CORBA Objects in CFML Applications
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:
1.
ColdFusion calls the method, passing it the variable by reference.
2.
The CORBA method replaces the value passed in, "My Initial String", with some other value.
Because the variable was passed by reference, this modifies the value of the ColdFusion variable.
3.
The cfoutput tag prints the new value of the foo variable.
Using methods with return values
Use CORBA methods that return values as you would any ColdFusion function; for example:
Using IDL types with ColdFusion variables
The following sections describe how ColdFusion supports CORBA data types. They include a
table of supported IDL types and information about how ColdFusion converts between CORBA
types and ColdFusion data.
IDL support
The following table shows which CORBA IDL types ColdFusion supports, and whether they can
be used as parameters or return variables. (NA means not applicable.)
IDL void method(in string a, inout string b);
CFML <cfset foo = "My Initial String">
<cfset ret=handle.method(bar, "foo")>
<cfoutput>#foo#</cfoutput>
IDL double method(out double a);
CFML <cfset foo=3.1415>
<cfset ret=handle.method("foo")>
<cfoutput>#ret#</cfoutput>
CORBA IDL type General support As parameters As return value
constants No No No
attributes Yes (for properties) NA NA
enum Yes (as an integer) Yes Yes