Hi I am trying to access an object passed from a C++ server to a java server and i wanted to know if i am doing it correctly <br><br><b>C++ Server Code:</b><br>CosNaming::NamingContextExt_var rootContext;<br> // Obtain a reference to the root context of the Name service:<br>
CORBA::Object_var obj;<br>obj = orb->resolve_initial_references("NameService");<br>rootContext = CosNaming::NamingContextExt::_narrow(obj);<br> <br> //Create a name called contextName<br> CosNaming::Name contextName;<br>
contextName.length(1);<br> contextName[0].id = (const char*) "obj"; <br> contextName[0].kind = (const char*) "obj"; <br> <br> // Bind the context to root.<br>
rootContext->bind(contextName,objref); //objRef is an address to the object that needs to be send<br><br><b>Java Client Code:</b><br> NamingContext rootContext = null;<br> NameComponent nc[] = new NameComponent[1];<br>
nc[0]=new NameComponent("obj","obj");<br> org.omg.CORBA.Object myobj = rootContext.resolve(nc);<br> MyInterImpl = MyInterHelper.narrow(myobj);<br><br>I just wanted to know if the path to acessing the object is correct in the above code<br>