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

David Riddoch djr@uk.research.att.com
Fri, 26 Feb 1999 16:28:58 +0000 (GMT)


Teemu,


If you check the kind() of the TypeCode you are looking at you will see
that it is a CORBA::tk_sequence. This is because the DynAny interface in
omniORB2 alias expands all TypeCodes it uses.


David


On Fri, 26 Feb 1999, Teemu Torma wrote:

> 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
> 
>