Siebel Object Interfaces Reference > Programming > Getting Started with the Siebel Object Interfaces >

Initializing ORB and Binding Siebel App Factory (Visibroker)


When using Inprise Visibroker ORB, the client application must bind to the Siebel Application Factory object as the Orbix clients do. However, the name of the host machine need not be passed on as an additional argument to the bind call.

NOTE:  For the correct version of Visibroker to use, read the system requirements and supported platform documentation for your Siebel eBusiness application.

The sample code that follows shows how to get a reference to the application factory and create an application object.

SiebelAppFactory_var appFact;
SiebelApplication_var appObj;
char objectRootName[OBJECTNAMELEN];

try {
   // Initialize the ORB.
   orb = CORBA::ORB_init(argc, argv);

   sprintf(objectRootName, "SiebelObjectFactory";
   // bind to the Factory object in the server.

  appFact = SiebelAppFactory::_bind(objectRootName);

} catch(const CORBA::Exception& excep) {
   // Standard exception.
   cerr << "Error id : " << seblExcep.id << endl;
   cerr << "Error text : " << endl;
   cerr << seblExcep.desc << endl;

   return;
}

try {
   appObj = appFact->CreateSiebelAppObject();
   cout << "Created Siebel object" << endl;
} catch (const SiebelException& seblExcep) {
   cerr << "Error id : " << seblExcep.id << endl;
   cerr << "Error text : " << endl;
   cerr << seblExcep.desc << endl;
   return;
}

After the bind and creation of the Siebel Application Object, the application must log on to the Siebel Application Object Manager to access the Siebel business objects. At the end of the session, the client can log off the session using the Logoff method.

The sample code that follows illustrates the invocation of the Login and GetBusObject methods to communicate with the Siebel Application Object Manager.

try {
   // call the login method to access the Siebel application
   appObj->Login("CCONWAY", "CCONWAY");
   // Get the reference to the Accounts business object
   pBusObj = appObj->GetBusObject("Account");
} catch (SiebelException& excep) {

   cerr << "Error code : " << excep.id << endl;
   cerr << "Error text : " << excep.desc << endl;
   return;
}


 Siebel Object Interfaces Reference 
 Published: 18 June 2003