[omniORB] How to pass sequence<any> as parameter from Python

Duncan Grisby duncan at grisby.org
Mon Apr 12 22:09:19 BST 2004


On Monday 12 April, Joel Wagner wrote:

> First question is why does the following IDL cause a compilation error, must
> I use the ANY_SEQ typedef?
> 
> 	long Exec( in long Cmd, inout sequence<any> Args ); // causes IDL
> compilation error

It is illegal IDL syntax to declare types in parameters. You must do
it with a typedef.

> Second question is what is the proper way to pass a sequence<any> as a
> parameter from Python?  Both try #1 and #2 produce omniORB.CORBA.BAD_PARAM:
> Minor: BAD_PARAM_WrongPythonType exceptions.

You want something like this:

    rec = V.Rec(0,1,2)

    tc = CORBA.TypeCode(CORBA.id(V.Rec))
    rec_in_any = CORBA.Any(tc, rec)

    resp = server.Exec(1, [ rec_in_any ])

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list