[omniORB] DSI server problem

Duncan Grisby duncan at grisby.org
Tue Jul 19 17:53:29 BST 2005


On Saturday 18 June, Ondrej Bosik wrote:

> When I create the parameter list and call
> server_request->arguments() within _invoke() member function, I get a
> parameter list with length of 2. The list is created by statement
> 
> CORBA::NVList_ptr args; //btw, why not CORBA::NVList_var ???
> orb->create_list(1,args);
> CORBA::NamedValue_ptr nv = args->add(CORBA::ARG_IN);
> nv->value()->replace(Middleware::_tc_Service_1_Request, 0);
> 
> And what I get is the list of length 2, where the first item is a
> CORBA::Any with type of tk_null. 

The problem is that create_list is wrong. It interprets the count
argument as being a length to pre-initialise the list to, whereas the
spec says it is a hint about how long the list will become. That means
that before you add a value, the list already has length 1, when it
should be 0.

I'll fix this in omniORB 4.1, but I don't want to change it in 4.0.x
because there may be code out there that relies on the incorrect
behaviour. The workaround is to call create_list with a first argument
of zero, then it'll work fine.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list