[omniORB] how to pass python list through CORBA IDL?

Duncan Grisby duncan at grisby.org
Wed Jan 7 12:37:47 GMT 2009


On Tuesday 6 January, "Deepan N Seeralan" wrote:

> This example works just fine without any modifications. However, if i try to
> change the parameters of the method 'echoString' from string to a sequence, I
> get CORBA_BAD_PARAM error.

That means the Python type of either the arguments or the return value
do not match the IDL.

> Here is the new IDL and piece of client code where i invoke the method
> echoString.
> module Example {
>   typedef sequence<string> sample;
>   interface Echo {
>     void echoString(inout sample mesg);
>   };
> };

Did you really mean to use inout there?  That means the sequence is
returned from the server back to the client.

> .. client code:
> message = ["hello"] #python list
> result  = eo.echoString(message)
> print "I said '%s'. The object said '%s'." % (message,result)
> 
> I referred to the CORBA-Python mapping document which says that list and
> tuples are the equivalent objects of CORBA sequence. However, when I run the
> server and client, it throws the error omniORB.CORBA.BAD_PARAM:
> CORBA.BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType, CORBA.COMPLETED_MAYBE).

You probably aren't returning the list from your servant method. What
does your servant class look like?

You can get more information about where the exception came from by
running your code with command line arguments -ORBtraceExceptions 1

Cheers,

Duncan.

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



More information about the omniORB-list mailing list