[omniORB] omniORBpy-3.0 "casting" inout Parameters

Duncan Grisby duncan at grisby.org
Fri Aug 17 20:08:17 BST 2007


On Friday 17 August, aaaa bbbb wrote:

> I have to use the following interface:
> 
> module A 
> {
> [...]
>   struct Attr {
>     string name;
>     SomeType type;
>     long numericv;
>     string textv;
>     SomeType2 state; 
>   };
>   typedef sequence<Attr> AttrSeq;
> }
> 
> module B
> {
> [...]
> 
>     A::RetType myFkt(
>       in A::Type1 ver,             // Enumeration
>       inout A::Type2 obj, 
>       inout A::AttrSeq theList)
>       raises (A::SomeException);
> 
> }
> 
> import A
> import B
> 
> [...]
> ret, obj, theList=obj.myFkt(A.NUMBER1, obj, theList)
> 
> will throw an BAD_PARAM_WrongPythonType exception. How
> can I "cast" obj and theList to the correct type? 
> I have read the OMG "Python Language Mapping
> Specification" but was not able to find any
> information. Thanks for any help!

You've missed out the important bit of the code where you populate the
argument values. You are calling the operation with the right number of
arguments, and extracting the right return values. The problem is that
the arguments don't have the right types according to the IDL. It's
nothing to do with the fact that they are declared inout.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list