[omniORB] setting inital refrence in the code

Radu-Adrian Popescu radu.popescu at aldratech.com
Fri Sep 3 23:11:06 BST 2004


Andrew Knapp wrote:
> Let me start off by saying im using Pythoin2.3 with OmniORBpy 2.2 on 
> Solaris:
> 
>  
> 
> I am trying to setup my ORBInitRef inside my script.  The only two ways 
> I can find in the documentation to set your initial reference is either 
> a) through the /etc/omniORB.cfg file, or b) by passing –ORBInitRef <URI> 
> on the command line. 
> 
> 
Command line parameters are passed to the orb init method.
In C++ I do that by building the char* argv[] myself in the code
and then passing that to init.
I have some older Python tests at hand that read:

orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
obj = orb.resolve_initial_references("NameService")
rootContext = obj._narrow(CosNaming.NamingContext)
if rootContext is None:
         print "Failed to narrow the root naming context"
         sys.exit(1)
print "NS: OK"


Now my Python is primitive to put it mildly, but I guess it would be fairly easy 
to add some stuff to sys.argv from code, or to use something different 
altogether in it's place.

Cheers,
-- 
Radu-Adrian Popescu
CSA, DBA, Developer
Aldrapay MD
Aldratech Ltd.
+40213212243




More information about the omniORB-list mailing list