Discussion:
[omniORB] Passing object references back to the server
Samuel Abels
2007-05-26 00:07:46 UTC
Permalink
Hi,

Given the following IDL:

module CServer {
interface Action {
void set_name(in string name);
};

interface WorkQueue {
long enqueue(in Action my_action);
};
};


I am trying to pass an Action reference that was previously retrieved
from the server back to the WorkQueue.enqueue() method:

-----------------
[...]
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
action = orb.string_to_object("corbaname:rir:#cserver/Action")
workqueue = orb.string_to_object("corbaname:rir:#cserver/WorkQueue")
action.set_name("Good enough.") # Works.
workqueue.enqueue(action) # This fails.
-----------------

The error is:

-----------------
Traceback (most recent call last):
File "./client.py", line 13, in <module>
workqueue.enqueue(action)
File "/pub/scripts/cserver/cserver_idl.py", line 192, in enqueue
return _omnipy.invoke(self, "enqueue",
_0_CServer.WorkQueue._d_enqueue, args)
omniORB.CORBA.BAD_PARAM: Minor: 0x41540058, COMPLETED_MAYBE.
-----------------

I see that the parameter type is not accepted, but I do not understand
why. Can anyone explain this (or point me to an explanation)? I tried
looking at the docs but could not find how this specific design can be
done.

Thanks,
-Samuel
Duncan Grisby
2007-05-26 22:04:41 UTC
Permalink
On Friday 25 May, Samuel Abels wrote:

[...]
Post by Samuel Abels
omniORB.CORBA.BAD_PARAM: Minor: 0x41540058, COMPLETED_MAYBE.
-----------------
I see that the parameter type is not accepted, but I do not understand
why. Can anyone explain this (or point me to an explanation)? I tried
looking at the docs but could not find how this specific design can be
done.
Actually, the completion status of COMPLETED_MAYBE means that the
request was successfully sent to the server, but the server threw the
BAD_PARAM exception. You should check that the server correctly returns
a long integer, which is the type specified in the IDL.

As an aside, you must be using quite an old version of omniORBpy since
it is not showing human-readable names for the minor codes. I'd strongly
suggest you upgrade. It's nothing to do with the current issue, but it's
best to be on the latest stable release.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Samuel Abels
2007-05-28 02:00:18 UTC
Permalink
Post by Duncan Grisby
[...]
Post by Samuel Abels
omniORB.CORBA.BAD_PARAM: Minor: 0x41540058, COMPLETED_MAYBE.
-----------------
I see that the parameter type is not accepted, but I do not understand
why. Can anyone explain this (or point me to an explanation)? I tried
looking at the docs but could not find how this specific design can be
done.
Actually, the completion status of COMPLETED_MAYBE means that the
request was successfully sent to the server, but the server threw the
BAD_PARAM exception. You should check that the server correctly returns
a long integer, which is the type specified in the IDL.
Ouch, I have been looking the wrong way all along. Thanks, it works.
Post by Duncan Grisby
As an aside, you must be using quite an old version of omniORBpy since
it is not showing human-readable names for the minor codes. I'd strongly
suggest you upgrade.
Cool, nice to hear that the new version makes this easier.

Thanks again!
-Samuel

Continue reading on narkive:
Loading...