And if I call this method with a null parameter, ORB will fail in
serializing this parameter and report a org.omg.CORBA.BAD_PARAM.
But why CORBA has such a limitation? What's the history?
And how can I avoid this? Always check the parameter before CORBA
method invoke?
BTW:
My environment is JDK1.5 and the ORB is inline JAVA IDL.
The same thing happens in ORBACUS 4.3.
Passing 'null' means you don't want to send data. If you don't want to
pass data, there is no reason to specify parameters.
What you actually want is 2 functions:
string echoString(in string mesg);
and another
void echoString();
Unfortunately, CORBA does not allow overloading (to allow mappings to
programming languages with this limitation)
Further, since the string is passed by value (deep copied) you can not
pass 'null'.
But I still think it's a little strange. Actually, when doing remote
data transfering, it's possible to mark a null value. In my memory,
this limitation does not exist in RMI.
>b> Thanks Yakov!
>b> But I still think it's a little strange. Actually, when doing remote
>b> data transfering, it's possible to mark a null value. In my memory,
>b> this limitation does not exist in RMI.
In Corba you can use a valuetype (if the implementation you are using
supports them). A valuetype can accept null values.
--
Piet van Oostrum <pi...@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: pi...@vanoostrum.org