[omniORB] omniORBpy strangeness with structs

Chris Knight cknight@ptolemy.arc.nasa.gov
Tue, 9 May 2000 09:19:08 -0700


Hi again, I ran into something odd yesterday that I'd like to share.  I
don't know if this is the standard behavior of CORBA ORBs or not (I would
suspect not) but it's not a stopper, just an annoyance.  I have a CORBA
method that takes a struct as a parameter and returns a different struct.

For example:

module test_mod {
  struct strings_struct { string a; string b; };
  struct longs_struct { long a; long b; };
  interface test_i {
    longs_struct atoi2(in strings_struct a);
  };
};

On the server side (written in Python) I would call the constructor for
longs_struct, passing it floating point values (whoops) and return the
newly-built struct.  Needless to say, the only error I got was on the client
side, being: omniORB.CORBA.BAD_PARAM: Minor: 0, Completed: COMPLETED_MAYBE.

I traced the method on the server and found that it did, indeed, create the
object and return it.  (So, effectively, it looks like only the client does
typechecking.)  This caused me much confusion (taking me hours to trace
down, thinking I was passing an invalid strings_struct into the function...)