No CosNaming binding?



Hello,

I installed CORBA-ORBit-0.4.5 on top of ORBit-0.5.16 
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 
not in blib/, there is only CORBA::Object etc. but no CosNaming 
(maybe blib/CosNaming.pm?).

I need to rewrite a Corba C++ server/client to Perl, and I need a solution, 
so I am desperately looking for working NameService example. How can I narrow, 
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örg Prante

----------------------snip -----------------------

use CORBA::ORBit idl => [ qw(MyObject.idl CosNaming.idl) ];
use CosNaming; # does it exist?
use Error qw(:try);

package CorbaTest;

my $orb = CORBA::ORB_init("orbit-local-orb");
my $poa = $orb->resolve_initial_references("RootPOA");
my $poa->_get_the_POAManager->activate;

# looking up $ns works fine
my $ns = $orb->resolve_initial_references("NameService");
 
# don't know if this makes sense
$ns->_narrow($ns->_repoid); 

my $obj = [ { id=>'MyObject', kind=>''} ];

try {
    my $subcontext = $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---------------------------------





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]