Examples

#There is a python example of using SALOME_NamingService

from omniORB import CORBA
from time import sleep
from LifeCycleCORBA import *
from SALOME_NamingServicePy import *

# initialise the ORB
orb = CORBA.ORB_init([''], CORBA.ORB_ID)

# create an LifeCycleCORBA instance
myLifeCycleCORBA = LifeCycleCORBA(orb)

#create a naming service instance
naming_service = SALOME_NamingServicePy_i(orb)

mySession = myNamingService.Resolve("/Kernel/Session")
mySession.GetInterface()
sleep(10)
myLocalVisu = myLifeCycleCORBA.FindOrLoadComponent("FactoryServer", "Visu")


//There is some part of a code written by C++

SALOME_NamingService aNamingService(orb);
CORBA::Object_ptr anObject = aNamingService.Resolve("/Kernel/Session");
SALOME::Session_var aSession = SALOME::Session::_narrow(anObject);
Engines::Component_var aComponent = aSession->GetVisuGen();
myVisuGen = VISU::VISU_Gen::_narrow(aComponent);