[omniORB] Problem with extraction from Any

Lukasz Czekierda luke@ics.agh.edu.pl
Fri, 28 Jan 2000 15:36:30 +0100 (MET)


Hello omniORBers!

I have the following problem:

//IDL
interface A
{
...
};

interface B : A
{
}

//C++
B_ptr b = ...;
...
A_ptr a = b;
I inserted next the 'a' object reference to CORBA::Any. In another
omniORB server (via PropertyService::PropertySet) I tried to extract
the reference writing:
A_ptr a;
CORBA::Any any1 = initialized from PropertyService
if ( any1 >>= a )
//...

If a inserting server is a omniORB one, extraction succeeded. But in the
case of Java1.2-ORB server doing insertion in an analog way, it is
impossible to extract the reference (operator >>= returned false). On the
other hand, when I'm instead doing the extraction to CORBA::Object
(CORBA::Any::to_object(any1)), the reference is not nil, moreover
narrowing to A succeeded and I'm able to successfully invoke any operation
from A interface on the remote object.

I looked in *DynSK.cc: 
CORBA::Boolean operator>>=(const CORBA::Any& _a, A_ptr& _s) {
...
    if( _a.PR_unpackTo(_tc_A, &tcd) ) { //when any1 comes from Java1.2-ORB
this returnes 0; and 1 when from omniORB 
 
I'm using omniORB_2.8.0 under Solaris 2.7.

Thanks,

Lukasz Czekierda