[omniORB] python behavior for CORBA.Any() and omniORB.to_any()
Thomas Lockhart
lockhart at fourpalms.org
Tue Sep 26 20:05:01 BST 2006
I'm using omniORB-4.0.7 and omniORBpy-2.7. I am seeing what may be an
inconsistency in handling CORBA anys, or at least in my understanding of
how to use them. In constructing a CORBA any, I notice the following
behavior:
>>> x = any.to_any(3)
>>> print x.typecode()
CORBA.TC_long
>>> y = CORBA.Any(CORBA.TC_long, 3)
>>> print y.typecode()
<CORBA.TypeCode 'IDL:omg.org/CORBA/long:1.0'>
Where for the first case returning the any to a co-located python client
succeeds but the latter case fails with the following:
omniORB: throw BAD_PARAM from pyMarshal.cc:3834
(MAYBE,BAD_PARAM_WrongPythonType)
afaict the latter case should be legal and is suggested in the version
1.2 Python mapping spec from OMG.
fwiw there is a different behavior from omniORBpy-2.6, details are shown
below (I haven't tested the actual results of returning an any for 2.6
in this simple test case, but have used CORBA.Any() to pass results of
sequences of longs etc to other applications in the past). Anyway, hints
and suggestions would be appreciated. Thanks!
- Tom
For omniORBpy-2.6:
>>> x = omniORB.any.to_any(3)
>>> print x.typecode()
<omniORB.tcInternal.TypeCode_empty instance at 0xb7a751cc>
>>> x = omniORB.any.to_any(int(3))
>>> print x.typecode()
<omniORB.tcInternal.TypeCode_empty instance at 0xb7a751cc>
>>> x = CORBA.Any(CORBA.TC_long, 3)
>>> print x.typecode()
<omniORB.tcInternal.TypeCode_empty instance at 0xb7a751cc>
More information about the omniORB-list
mailing list