[omniORB] DSI server problem

OKeeffe, Michael K MOKEEFFE at amfam.com
Tue Jul 19 12:46:42 BST 2005


Wouldn't another workaround would be to use _request instead of
_create_request?  I found this useful article by Steve Vinoski and
Douglas Schmidt

http://www.cuj.com/documents/s=7981/cujcexp2007vinoski/

Some of the articles are subscriber only so here's an excert:

"As our example shows, using _create_request can be more complicated
than creating a Request using the _request operation. This is because
the Request interface supplies a number of short-cut operations that
make setting arguments, exception types, and return types easier than
setting them individually on the underlying NVList, ExceptionList, and
NamedValue. We therefore recommend using the _request operation in
preference to _create_request."

-Mike

-----Original Message-----
From: omniorb-list-bounces at omniorb-support.com
[mailto:omniorb-list-bounces at omniorb-support.com] On Behalf Of Duncan
Grisby
Sent: Tuesday, July 19, 2005 10:53 AM
To: Ondrej Bosik
Cc: omniorb-list at omniorb-support.com
Subject: Re: [omniORB] DSI server problem 


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 --

_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list



More information about the omniORB-list mailing list