[omniORB] [newbie] Python long type problem

Jerome Bouat jerome.bouat@xrce.xerox.com
Fri, 20 Jul 2001 17:56:26 +0200


Hello,

I can't get the Python long type
from a Python server.

I use omniORBpy on both sides.

With the 3 available IDL mapping
of the Python long type
(unsigned long, long long, unsigned long long),

I always get the following trace :
--------------------------------------------
merveilles{88} python1.5.2 client.py
Traceback (innermost last):
  File "client.py", line 13, in ?
    r = eo.getLong() # this method call raises an exception
  File "Test_idl.py", line 57, in getLong
    return _omnipy.invoke(self, "getLong",
_0_Test.ValueProvider._d_getLong, args)
omniORB.CORBA.BAD_PARAM: Minor: 0, Completed: COMPLETED_MAYBE.
merveilles{89}
--------------------------------------------

Can you give me ways to search in ?

Thanks,
Jerome



IDL declaration :
--------------------------------------------
module Test {
  interface ValueProvider {
    boolean getBoolean();
    long getInteger();
    unsigned long long getLong();
    double getFloat();
    double getDate();
  };
};
--------------------------------------------

Python client :
--------------------------------------------
from omniORB import CORBA
import sys, Test
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
obj = orb.string_to_object('corbaloc::merveilles/valueProviderObj')
eo = obj._narrow(Test.ValueProvider)
if (eo is None): raise 'casted object reference is void'
r = eo.getLong() # this method call raises an exception
--------------------------------------------

Python implementation :
--------------------------------------------
from omniORB import CORBA
import sys, Test__POA

class ValueProviderImpl(Test__POA.ValueProvider):
    def getBoolean(self):
        print 'getBoolean'
        return CORBA.TRUE
    def getInteger(self):
        print 'getInteger'
        return 89781651
    def getLong(self):
        print 'getLong'
        return 684343535468438454665L
    def getFloat(self):
        print 'getFloat'
        return 64654.546
    def getDate(self):
        print 'getDate'
        return 198198084.984946546

orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
vP = ValueProviderImpl()

CorbalocMappingFile = open('omniMap.cfg','w')
if CorbalocMappingFile:
    CorbalocMappingFile.write('valueProviderObj ' +
orb.object_to_string(vP._this()) + \
                              '\nparamUserObj ' +
orb.object_to_string(pU._this()) + '\n')
    CorbalocMappingFile.close()
    print 'Corbaloc mapping file writen. You can lauch omniMapper'
else: raise "can't create corbaloc mapping file"

poa = orb.resolve_initial_references("RootPOA")
poa._get_the_POAManager().activate()
orb.run()