[omniORB] omniNames and VisiGenic

Rebecca.A.Sanford@gd-is.com Rebecca.A.Sanford@gd-is.com
Tue, 6 Jul 1999 10:07:48 -0500




FYI: I use omniNames with Java IDL (JDK 1.2.1) without a problem.
The two ORBs are quite compatible.  Simply invoke omniName with
"-start 900" since that is the default bootstrap port for Java IDL.
(It appears that the Java IDL ORB_init() method does not strip
ORB-related parametes from the command line string.)  I'm able to
access omniNames with the following "standard" Java code:

     org.omg.CORBA.Object obj =
       orb.resolve_initial_references("NameService");

You can also pass the IOR of omniNames and do a string_to_object()
and NamingContextHelper.narrow() on it as suggested.

Good luck!
--- becs





From: Jan Lessner <jan@c-lab.de> on 07/06/99 06:43 GMT

To:   omniorb-list@uk.research.att.com
cc:    (bcc: Rebecca A Sanford/GDIS/GDYN)
Subject:  [omniORB] omniNames and VisiGenic




Barend,
> I have an omniORB C++ Server and a Visigenic java-applet client, this
> works fine. Has anyone an example of using omniOrb's naming service from
> VisiGenic? (Or an example of using omniOrb's naming service from any
> other orb?)
Yes, we do that in our software. All you got to do is reimplement
omniORB's algorithm for resolve_initial_references("NameService") which
is pretty simple. The rest works fine (fully interoperable as far as we
experienced it). Here is a piece example code we are using to do that
job.

Regards,
Jan Lessner, C-LAB

------------------------------

  if (!(cfg_filename = getenv("OMNIORB_CONFIG")))
    return 2;
  if (!(cfg_file = fopen(cfg_filename, "r")))
    return 3;
  fgets(buf, sizeof(buf), cfg_file);
  fclose(cfg_file);
  strtok(buf, " ");
  if (!(rootior = strtok(NULL, " \n")))
    return 4;
  try {
    CORBA::Object_var tmp = g_orb->string_to_object(rootior);
    CosNaming::NamingContext_var rootctxt =
CosNaming::NamingContext::_narrow(tmp);
  }
  catch(CORBA::SystemException &sysEx) {
    return 5;
  }