Post by EXT-Pennington, Dale KThey are placing arbitrary values into enumated members of a CORBA IDL
derived structure and passing it through the CORBA interface. These
values fail the sanity check in the generated .hh files while
unmarshalling in the server, hence causing the CORBA MARSHALLING
exception to be passed back to the client.
That is definitely an invalid thing to do. The only permitted values for
an enum are the ones implied by the enum's definition in IDL. Sending
any other numeric value is an error, and it's right for omniORB to throw
an exception.
It is a coincidence that the C++ mapping to C++ enum permits numeric
values other than the enum values -- other language mappings, for
example Python, use symbolic names for the enum values, and cannot
possibly support values outside those in the IDL.
Post by EXT-Pennington, Dale KNow we are in no position to change how the existing app does things.
Also what they do gets by their ORB (as well as TAO orb, which we are
also evaluating) with no complaints. Sanity checking seems unique to
OmniORB at this point.
omniORB is often more strict about following the specifications than
other ORBs.
Post by EXT-Pennington, Dale KThe next question on my list is : Is there a way to disable the sanity
checking in the enumation unmarshalling code, other than manually
editing the .hh files generated by the IDL Compiler. I read the IDL
chapter of the documentation, and did not see anything.
There's no omniidl switch, and I don't think it's good to add one and
encourage people to do invalid things like this. That said, it's really
easy for you to modify the omniidl back-end to remove the checking code.
Look at src/lib/omniORB/omniidl_be/cxx/header/template.py, line 1577, in
the definition of enum_operators. If you edit that to remove the check,
that will prevent it being generated.
If you don't fancy that approach, the other thing you can do is change
the IDL to use an unsigned long instead on an enum. As long as the
values aren't put inside Anys, the marshalled form will be identical.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --