The following sections describe how to create, or instantiate, a CORBA object and how to use it in your ColdFusion application.
The cfobject
tag and CreateObject
functions create in ColdFusion a stub, or proxy object, for the CORBA object on the remote server. You use this stub object to invoke the remote object.
The following table describes the attributes you use in the cfobject
tag to create a CORBA object:
Attribute | Description |
---|---|
type |
Must be CORBA. COM is the default. |
context |
Specifies the CORBA binding method, that is, how the object is obtained, as follows:
|
class |
Specifies the information required for the binding method to access the object. If you set the If you set the |
name |
Specifies the name (handle) that your application uses to call the object's interface. |
locale |
(Optional) Identifies the connector configuration. You can omit this option if ColdFusion MX Administrator has only one connector configuration, or if it has multiple connector configurations and you want to use the one that is currently selected in the Administrator. If you specify this attribute, it must be an ORB name you specified in the CORBA Connector ORB Name field when you configured a CORBA connector in ColdFusion MX Administrator; for example, Visibroker. |
For example, use the following CFML to invoke a CORBA object specified by the tester.ior file if you configured your ORB name as Visibroker:
<cfobject action = "create" type = "CORBA" context = "IOR"
class = "d:\temp\tester.ior" name = "handle" locale = "Visibroker">
When you use the CreateObject
function to invoke this CORBA object, specify the name as the function return variable, and specify the type, class, context, and locale as arguments. For example, the following line creates the same object as the preceding cfobject
tag:
handle = CreateObject("CORBA", "d:\temp\tester.ior", "IOR", "Visibroker")
For the complete cfobject
and CreateObject
syntax, see CFML Reference.
Currently, ColdFusion can only resolve objects registered in a CORBA 2.3-compliant naming service.
If you use a naming service, make sure that its naming context is identical to the naming context specified in the property file of the Connector configuration in use, as specified in the ColdFusion MX Administrator CORBA Connectors page. The property file must contain the line "SVCnameroot=name" where name is the naming context to be used. The server implementing the object must bind to this context, and register the appropriate name.