[omniORB] omniNames and VisiGenic

Jan Lessner jan@c-lab.de
Tue, 06 Jul 1999 08:43:28 +0200


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;
  }