Calling CORBA Objects
377
Example
Here is the IDL for an object:
struct SimpleStruct
{
short s;
long l;
float d;
};
struct NestedStruct
{
SimpleStruct f;
char c;
string s;
};
typedef sequence<long, 5> BLongSequence;
interface SomeObject {
short SomeMethod( in NestedStruct inStruct, in BlongSequence inSeq);
};
Here is the applicable ColdFusion code:
<!—-- Declare a couple of structures --->
<cfset x = StructNew()>
<cfif IsStruct(x)>
<cfset temp=StructInsert(x,"s",3)>
<cfset temp=StructInsert(x,"l", 256)>
<cfset temp=StructInsert(x,"d", 93.45)>
</cfif>
<cfset NestedStruct = StructNew()>
<cfif IsStruct(NestedStruct)>
<cfset temp=StructInsert(NestedStruct,"f",x)>
<cfset temp=StructInsert(NestedStruct,"c", 'b')>
<cfset temp=StructInsert(NestedStruct,"s", " Test")>
</cfif>
<!—-- Declare a sequence --->
<cfset FixedSeq = ArrayNew(1)>
<cfloop index="LoopCount" from="1" TO="5">
<cfset FixedSeq [LoopCount] = #LoopCount#>
</cfloop>
<cfset retA=obj.SomeMethod(NestedStruct, FixedSeq)>
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...