How to get POA object in corba client

19 views Asked by At

I have to write client side corba code which involves getting hold of POA object. Going through various CORBA related code snippets available on internet, I see 2 ways of getting POA object:

org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, props);
String strNameService = "corbaloc::" + ip + ":" + port + "/NameService";
POA rootPOA  = (POA) POAHelper.narrow(orb.string_to_object(strNameService));

...and

org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, props);
org.omg.CORBA.Object rootPOAObj = orb.resolve_initial_references("RootPOA");
POA rootPOA  = (POA) POAHelper.narrow(rootPOAObj);

Which of these is the correct one?

0

There are 0 answers