some string works, some not ;-(



Hello,


I'm somehow new to CORBA and ORBit and have to use it
together with the Perl module CORBA-ORBit-0.4.3 of
Owen Taylor. I use ORBit-0.5.10 on Linux for now, later
it should run on Solaris.
(Same behaviour with ORBit-0.5.7, ORBit-0.5.8)

I started with a really small test system with a client
and a server and an IDL with just one method.

module Test
{
  interface Test1
  {
    string Method1( in string a );
  };
};

The method just converts the string a into upper case and
returns it. And then, for some string the thing works fine,
with some it throws an expection:

Good case:
who@voldemor:~/Sources/CORBA/test$ ./client test
TEST
who@voldemor:~/Sources/CORBA/test$

Bad case:
who@voldemor:~/Sources/CORBA/test$ ./client test123
Exception: CORBA::BAD_PARAM ('IDL:omg.org/CORBA/BAD_PARAM:1.0')
    (0, COMPLETED_NO)
   An invalid parameter was passed
who@voldemor:~/Sources/CORBA/test$

At the server-side I see:
who@voldemor:~/Sources/CORBA/test$ ./server
incomplete message received at ./server line 51.

>From my point of view the length of the string couldn't be the problem alone:

Good case:
who@voldemor:~/Sources/CORBA/test$ ./client abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
who@voldemor:~/Sources/CORBA/test$

I checked the GIOP packets with Ethereal and have the feeling that
the client sends good stuff.


Does this sounds familiar to one of you? Do you think its a problem
of ORBit, of the Perl module or of my brain-damaged code (so few lines
that I will include it below)?

Can someone help?


Thanks,
Wolfgang


my test code:

Test.idl:
module Test
{
  interface Test1
  {
    string Method1( in string a );
  };
};

server:

#!/usr/bin/perl -w

use CORBA::ORBit idl => [ qw(Test.idl) ];


package MyTest;

@MyTest::ISA = qw(POA_Test::Test1);

use Error qw (:try);
use Data::Dumper;

sub new
{
  my $class = shift;

  my $self = {};

  bless $self, $class;

  return $self;
}

sub Method1
{
  my $self = shift;
  my $input = shift;

  my $output = uc $input;

  return $output;
}


package main;

use Error qw(:try);

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

$servant = new MyTest;
$id = $poa->activate_object($servant);
$ref = $orb->object_to_string($poa->id_to_reference($id));

open (OUT, ">test.ref");
print OUT $ref;
close OUT;

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


client:

#!/usr/bin/perl -w

use CORBA::ORBit idl => [ qw(Test.idl) ];

use Error qw (:try);

use strict;

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

open IOR, "test.ref";
my $ior = <IOR>;
close IOR;

my $test = $orb->string_to_object($ior);
my $a = shift;
print $test->Method1($a) . "\n";





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