[omniORB] How to cdrMarshal CORBA.Any value?
Duncan Grisby
duncan at grisby.org
Sat Dec 29 13:36:08 GMT 2007
On Friday 28 December, Anton Dedov wrote:
> I am trying form request context in interceptor via Python interface
> of omniORB. Our server part is working under ACE-TAO. Server-side
> interceptors wait for a context data encapsulated into Any. But I
> cannot marshal Any value with cdrMarshal:
>
> >>> s = SecurityContext(...)
> >>> s_any = CORBA.Any(CORBA.TypeCode(CORBA.id(s)), s)
> >>> cdrMarshal(CORBA.TypeCode(CORBA.id(s_any)), s_any)
> Traceback (most recent call last):
> File "<console>", line 1, in ?
> File "./omniORB/CORBA.py", line 480, in id
> BAD_PARAM: CORBA.BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType, CORBA.COMPLETED_NO)
CORBA.id() is only intended to work on declared types, not on base types
like Any. According to the mapping specification, you should use
CORBA.TC_any to get Any's TypeCode:
cdrMarshal(CORBA.TC_any, s_any)
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list