[omniORB] how to pass python list through CORBA IDL?

Deepan N Seeralan nsdeeps at gmail.com
Tue Jan 6 15:48:19 GMT 2009


Hi All,

I am trying to communicate between a client and server located in different
address spaces using the CORBA Naming service. Since I am a newbie to
omniORB and CORBA, I tried the example given in the page
http://omniorb.sourceforge.net/omnipy2/omniORBpy/omniORBpy002.html . The IDL
definition of this example goes like this:

module Example {
  interface Echo {
    string echoString(in string mesg);
  };
};

The definition of echoString is given by,

class Echo_i (Example__POA.Echo):
    def echoString(self, mesg):
        print "echoString() called with message:", mesg
        return mesg

This example works just fine without any modifications. However, if i try to
change the parameters of the method 'echoString' from string to a sequence,
I get CORBA_BAD_PARAM error.
Here is the new IDL and piece of client code where i invoke the method
echoString.
module Example {
  typedef sequence<string> sample;
  interface Echo {
    void echoString(inout sample mesg);
  };
};
.. client code:
message = ["hello"] #python list
result  = eo.echoString(message)
print "I said '%s'. The object said '%s'." % (message,result)

I referred to the CORBA-Python mapping document which says that list and
tuples are the equivalent objects of CORBA sequence. However, when I run the
server and client, it throws the error omniORB.CORBA.BAD_PARAM:
CORBA.BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType, CORBA.COMPLETED_MAYBE).

Could anyone please help me in getting rid of this error? I would like to
know how to pass python list objects between CORBA client and server through
omniORB.

Thank you,
Deepan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090106/91d75fe3/attachment.htm


More information about the omniORB-list mailing list