[omniORB] Any handling with typedef:ed sequences in 2.7.0.

Teemu Torma tot@trema.com
Fri, 26 Feb 1999 17:11:15 +0100


Does anyone know if the following is a bug in omniORB, or am I doing something
wrong.  I am trying to pretty print some structures and sequences from
CORBA::Any.

Using the following IDL:

  typedef sequence<octet> Test_Sequence;
  struct Test_Struct
  {
    Test_Sequence seq;
  };

If I do:

    Test_Struct st;
    st.seq.length (1);
    st.seq[0] = 1;

    CORBA::Any data;
    data <<= st;

    try
      {
	DynAny_var any = orb->create_dyn_any (data);
	DynStruct_var value = DynStruct::_narrow (any);

	// We should have only one.
	NameValuePairSeq *members = value->get_members ();

	cout << "Type is " << (*members)[0].value.type ()->id () << endl;
      }
    catch (...)
      {
	cout << "Got Exception\n";
      }

I always get an exception thrown by TypeCode_base::id () method.  The same
code structure works just fine with nested structures, but not with typedef'ed
sequences, even though the marshalled data shows that the typedef'ed id is
included into the stream.

Am I doing something wrong here, or should I not count on getting information
of typedef'ed constructs?

Teemu