background image
Tech Note #40:  Initializing CORBA Applications
©
1998 Bionic Buffalo Corporation; All Rights Reserved.
          1 November 1998
http://www.tatanka.com
Page 
4 of 5
To obtain a list of services available initially with a given ORB, the application calls the
 
CORBA_ORB_list_initial_
 
services
 
()
 procedure, which returns a list of strings. Each string is a
service name chosen from the above table. The definitions are:
 
typedef char
 
* CORBA_ORB_ObjectId ;
 
typedef struct
 
{
 
unsigned long
 
_maximum ;
 
unsigned long
 
_length ;
 
CORBA_ORB_ObjectId
 
* _buffer ;
 
}
 
CORBA_OR
 
B_ObjectIdList ;
 
CORBA_ORB_ObjectIdList
 
* CORBA_ORB_list_initial_services
 
( CORBA_ORB
 
orb1,
 
CORBA_Environment
 
* env1 ) ;
The next task for most applications will be to use one of the listed services to find the objects
needed by the application. Two of these initial services are used for this purpose: NameService
and TradingService.
The Name Service provides a tree-structured directory of objects, similar to a common file
system directory. The Trading Service allows objects to advertise themselves with their
properties, and permits potential clients to search for objects with specified qualities.
Regardless of the initial service needed, the name of the service (selected from the returned
sequence of strings) is used in the next step.
Obtaining Initial Object References
A name returned by 
 
CORBA_ORB_list_initial_
 
services
 
()
 may be submitted to another routine,
 
CORBA_ORB_resolve_initial_references()
. This latter routine will return the object reference for
the designated initial service. The function prototype is:
 
CORBA_Object
 
CORBA_ORB_resolve_initial_reference
 
( CORBA_ORB
 
orb1,
 
CORBA_ORB_ObjectId
 
object_id1,
 
CORBA_Environment
 
* env1 ) ;
Each initial service must be submitted separately, since the routine resolves only a single
reference at a time.
The reference to the service object may then be used to invoke the object’s methods.