No CosNaming binding?
Joerg Prante <[email protected]> Thu, 6 Jun 2002 14:02:16 +0200 (MEST)
| Newsgroups | gmane.comp.gnome.orbit.perl |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I installed CORBA-ORBit-0.4.5 on top of ORBit-0.5.16=20
and I can get simple examples running, like those in the distribution.
But I couldn't find a Perl CosNaming binding. It's not in ORBit.xs, and=20
not in blib/, there is only CORBA::Object etc. but no CosNaming=20
(maybe blib/CosNaming.pm?).
I need to rewrite a Corba C++ server/client to Perl, and I need a solution,=
=20
so I am desperately looking for working NameService example. How can I narr=
ow,=20
and how can I use a CosNaming object?
Here is a code snippet I wrote, but I'm totally stuck. The autoloader
message is that he can't find "bind_new_context", and he is right, there
is only a CORBA::Object.
There is not much documentation how to do CosNaming things in Perl.
Please help!
Kind Regards
J=F6rg Prante
----------------------snip -----------------------
use CORBA::ORBit idl =3D> [ qw(MyObject.idl CosNaming.idl) ];
use CosNaming; # does it exist?
use Error qw(:try);
package CorbaTest;
my $orb =3D CORBA::ORB_init("orbit-local-orb");
my $poa =3D $orb->resolve_initial_references("RootPOA");
my $poa->_get_the_POAManager->activate;
# looking up $ns works fine
my $ns =3D $orb->resolve_initial_references("NameService");
=20
# don't know if this makes sense
$ns->_narrow($ns->_repoid);=20
my $obj =3D [ { id=3D>'MyObject', kind=3D>''} ];
try {
my $subcontext =3D $ns->bind_new_context($obj);
} catch CosNaming::NotFound with {
print "IPS not found\n";
} catch CosNaming::AlreadyBound with {
print "IPS already bound\n";
} catch CosNaming::CannotProceed with {
print "cannot proceed\n";
} catch CosNaming::InvalidName with {
print "invalid name\n";
};
------------------snip---------------------------------