[omniORB] setting return type to be an array

Sveta Shasharina sveta@txcorp.com
Mon Sep 23 22:12:00 2002


Duncan,

Maybe it is a bug in omniifr?  As I mentioned in my previous
e-mail, if I use IFR methods to figure out the length
of the array, it gives (length-1)!  So to trick omniifr,
I created a type corresponding to the array with the correct
length, then the parameter was accepted and the invocation
completed.  This means that I should do the same with return
type.  If I know that it is an array, then I should create
the correct typecode and use it as a return type, rather
just taking the typecode given by IFR methods...

Sveta

-----Original Message-----
From: dpg1@grisby.org [mailto:dpg1@grisby.org]On Behalf Of Duncan Grisby
Sent: Saturday, September 21, 2002 3:45 PM
To: sveta@txcorp.com
Cc: omniorb-list@omniorb-support.com
Subject: Re: [omniORB] setting return type to be an array 


On Monday 9 September, "Sveta Shasharina" wrote:

> After I query an Interface Repository and fugure out that the return
> type is an array, I want to set this type to return type in my request
> object:

OK.

> CORBA::TypeCode_var retType = method.result;
> //I check on this to see that retType->kind() is CORBA::tk_alias
> //and I know that it is of type
> //typedef long LongArray [3]
> //so I do this:
> retType = retType->content_type();

You shouldn't need to do this, but it shouldn't hurt.

> //At this point it of kind CORBA::tk_array.
> //After that I create request object req: skipped here
> //And set the return type
> 
> req->set_return_type(retType);
> 
> When I try to invoke, I get an exception as if the IFR does not
> recongnize the return type as the correct return type of the method.

What exception do you get?  The IfR is not involved at all in a DII
call, so you can't be getting an exception from that. I've just tried
an example, by modifying the omniORB DII example, and it works fine
for me.

Can you post a more complete code example that shows the problem?

Cheers,

Duncan.

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