Marshalling problem



Hello!

When I try to return an object from one of my methods, I keep getting
the following error message on the server:
Value is not a rm::Iface at ./rm-server-0.pl line 64.
Error marshalling result of call to MyRouter::getInterface at ./rm-server-0.pl line 64.

and on the client:
Exception: CORBA::MARSHAL ('IDL:omg.org/CORBA/MARSHAL:1.0')
    (0, COMPLETED_YES)
   Error marshalling parameter or result

This is the IDL:

module rm {
    interface Iface {
    };

    interface Router {
        Iface getInterface(in string ifaceName);
    };
};

This is the server:

use strict;
use CORBA::ORBit idl => [ qw(/usr/include/ORBitservices/CosNaming.idl rm.idl) ];

package MyIface;

@MyIface::ISA = qw(POA_rm::Iface);

sub new {
	my $proto = shift;
        my $class = ref($proto) || $proto;

	my $self = {};
	$self->{NAME} = shift;

	bless($self,$class);
	print "New interface created:",$self->{NAME},"\n";
	return $self;
}


package MyRouter;

@MyRouter::ISA = qw(POA_rm::Router);

sub new {
	my $proto = shift;
        my $class = ref($proto) || $proto;

	my $eth1=new MyIface("eth1");
	my $ppp0=new MyIface("ppp0");

	my %interfaces=();
	$interfaces{"eth1"}=$eth1;
	$interfaces{"ppp0"}=$ppp0;

	my $self  = {};
	$self->{INTERFACES} = \%interfaces;
	bless($self,$class);
	return $self;
}

sub getInterface {
	my ($self,$name) = @_;
	my $ifacesRef=$self->{INTERFACES};
	my %ifaces=%$ifacesRef;
	return $ifaces{$name};
}

my $orb = CORBA::ORB_init(@ARGV,"orbit-local-orb");

my $poa = $orb->resolve_initial_references("RootPOA");
my $namingContext = $orb->resolve_initial_references("NameService");

my $servant=new MyRouter;
my $id = $poa->activate_object ($servant);
my $ref = $poa->id_to_reference($id);

$poa->_get_the_POAManager()->activate();

my $name = [{id => "ltpc21", kind => "server"}];

$namingContext->bind($name, $ref);

$orb->run();


An this is the client:

use strict;
use CORBA::ORBit idl => [ qw(rm.idl /usr/include/ORBitservices/CosNaming.idl)];

my $orb = CORBA::ORB_init(@ARGV, "orbit-local-orb");

my $namingContext = $orb->resolve_initial_references("NameService");
my $name = [{ id => "ltpc21", kind => "server" }];
my $router = $namingContext->resolve($name);

my $interface = $router->getInterface("eth1");


Do you have any ideas what is the problem and how can I solve it?

				Bye,NAR
-- 
"Beware of bugs in the above code; I have only proved it correct, not
 tried it."





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