[omniORB] DII and struct as operation argument

Smits, Martin martin.smits at task24.nl
Tue Jul 28 11:25:13 BST 2009


Thanx Duncan

That was indeed the problem. Checking my other code that uses the IFR now, also uses the = operator.
I was using the example code I found in a series of articles on using the dynamic interfaces of CORBA in de DDJ. The example they implemented inserted a String in the argument and then you don't have the problem I had. And the example on the DynAny and Any only went so far as to convert the DynamicAny to the Any and then had some ...

Now I understand some more about what is going on.

Greetz,
  Martin

-----Original Message-----
From: Duncan Grisby [mailto:duncan at grisby.org] 
Sent: vrijdag 24 juli 2009 16:26
To: Smits, Martin
Cc: omniorb-list at omniorb-support.com
Subject: Re: [omniORB] DII and struct as operation argument

On Wednesday 22 July, "Smits, Martin" wrote:

[...]
> -          Create the _request(“add”)
> 
> -          Create the TypeCode for the item_list sequence and the add_info
> struct
> 
> -          Create DynamicAnys for the item_list and add_info from the
> TypeCodes
> 
> -          Fill in the values of all the fields
> 
> -          Convert the DynamicAny to an Any
> 
> -          Use add_in_arg(“input”) to add the Any as argument

Exactly what code are you using?  From the symptoms, it looks as though
you are inserting your Any into the in arg Any -- i.e. you have an Any
inside an Any. That means the client is marshalling the request with an
Any as the argument.

I expect your code is something like this:

  CORBA::Any arg = // value from the DynamicAny
  CORBA::Request_var req = obj->_request("add");

  req->add_in_arg() <<= arg;

That is inserting the Any into the Any that's returned by add_in_arg().
Instead, just use assignment:

  req->add_in_arg() = arg;


Cheers,

Duncan.

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


More information about the omniORB-list mailing list