[omniORB] problems with omnipy and argument types

jnye@micro-optics.com jnye@micro-optics.com
Mon, 12 Feb 2001 13:39:52 -0400

Hi All,

I've just started using omnipy and I think it is great so far, but I'm
having a bit of trouble with a call on one of my interfaces. The IDL is
below (note that I've just shown what is necessary in the context of the
problem I am having):


module Reporting

struct Date
	unsigned long dMonth;
	unsigned long dDay;
	unsigned long dYear;

struct Time
	unsigned long tHour;
	unsigned long tMinute;
	unsigned long tSecond;

struct DateTime 
	Date dtDate;
	Time dtTime;

interface EventLogger 
	... other operations ...

	void log(in unsigned long seqNumber, in DateTime dt, in string
machine, in string category, in string eventText);

}; // End Reporting.

End IDL.

The server that implements the EventLogger is written in C++ and is
constantly running. It is implemented as a persistent object. I've written
clients in C++ that use it with no problem. When using python, I can get
trivial operations to work on it (some basic get/set operations), but I
cannot get the log operation to work. I always get a BAD_PARAM error and it
does not make sense to me why I would get that. Here is my python code:

-------- BEGIN SCRIPT ------------------
from omniORB import CORBA
import Reporting
import sys

.... Orb initialization, retrieving an ior for the EventLogger (this part

el = obj._narrow(Reporting.EventLogger)
if el is None:
	print "Error"	# this does not get printed, so the narrow worked.

.... Some trivial operations on el work ...

dt = Reporting.DateTime(Reporting.Date(1, 2, 3), Reporting.Time(1, 2, 3))
# a hypothetical date and time.
machine = "My Machine"
category = "Test"
event = "Just a test event"

el.log(1, dt, machine, category, event)

.... This throws a BAD_PARAM error and this does not make any sense to me
whatsoever why it would do so.
-------- END SCRIPT ------------------

Can someone point out what is wrong with my python code?