[omniORB] type Any

Duncan Grisby duncan@grisby.org
Thu Jul 11 14:02:01 2002


On Tuesday 9 July, Christophe de Vienne wrote:

> The problem occur when we have a string in one the any. If the client is 
> omniORB or JavaORB, everything works perfectly. But if its visibroker, we 
> cannot extract the string from a Any.

Most of the differences in these traces are because the JavaORB is
sending data big endian and Visibroker is sending it little endian.
That's nothing to do with the problem. The problem is that in the
Visibroker trace, we see...

> xfSetRecord(datas) with datas containing (6, 14, "j", "j", 0, 9)

> Visibroker :
> 4749 4f50 0100 0100 8800 0000 0000 0000 GIOP............
> 9000 0000 ff20 2020 1d00 0000 ff6d 7972 .....   .....myr
> 6476 5f70 6f61 0073 655f 345f 315f 6370 dv_poa.se_4_1_cp
> 5f43 464c 5f72 735f 3620 2020 0c00 0000 _CFL_rs_6   ....
> 7866 5365 7452 6563 6f72 6400 0000 0000 xfSetRecord.....

> 0600 0000 0300 0000 0600 0000 0300 0000 ................
  Seq len 6 tk_long   value 6   tk_long     

> 0e00 0000 1200 0000 0100 0000 0200 0000 ................
  value 14  tk_string bound 1!  string len 2

> 6a00 2020 1200 0000 0100 0000 0200 0000 j.  ............
  j \0 pad  tk_string ...


> 6a00 2020 0300 0000 0000 0000 0300 0000 j.  ............
> 0900 0000                               ....

So, the problem is that Visibroker is claiming that it's a bounded
string with bound 1. You are trying to extract it with the unbounded
char* Any operator, so the extraction fails. You can only successfully
extract it with the Any::to_string helper, but to do that, you need to
know the bound. To find the bound, you need to look at the Any's
TypeCode... Easy, huh?

The proper solution is to find out why Visibroker thinks you are
inserting bounded strings.

Cheers,

Duncan.

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