Hello Matteo, For most of the basic types, this information should be in the third chapter of the CORBA spec, under IDL Syntax and Semantics. The information is a bit spread out over the chapter but it does give a good idea of the valid ranges for each of the types.
Cheers, Darren On 2/12/07, Vescovi, Matteo <[EMAIL PROTECTED]> wrote:
That's great, thanks Darren. I debugged into that part of code and saw the char being assigned an out of range value, but I wasn't sure what the appropriate encoding should have been. For future reference, where would I find that kind of information? Would it be in the CORBA spec? The CDR encoding maybe? Cheers, - Matteo Darren Middleman wrote: > Hello Matteo, > > I think I've tracked down the cause of the problem. > > The reason this was happening was due to the way the conversion from the > Byte object to the Character object was being made. Using a negative > byte > value to create a new character resulted in the value of the character > wrapping > within its range and causing a large character value. (i.e. byte > value of > -128 > resulted in a character with value 65408). When this value was passed to > the > ORB, the stream checked to ensure that the value was not greater than 255 > (the > OMG range for a character is 0 to 255) and since it was, threw a > DATA_CONVERSION exception. > > I'm going to add something to the PrimitiveHandler so that the correct > conversion > from a byte value to a character value is performed. This should > solve the > issues > you are seeing with the failing character test. > > Cheers, > Darren > > > On 2/12/07, Vescovi, Matteo <[EMAIL PROTECTED]> wrote: >> >> Hi, >> I am trying to fix some of the (currently disabled) idltowsdl corba >> binding type tests. >> >> The tests involve invoking an operation with the following corba >> binding: >> <wsdl:operation name="testChar"> >> <corba:operation name="testChar"> >> <corba:param mode="in" name="inChar" idltype="corba:char" /> >> <corba:param mode="inout" name="inoutChar" >> idltype="corba:char" /> >> <corba:param mode="out" name="outChar" idltype="corba:char" /> >> <corba:return name="return" idltype="corba:char" /> >> </corba:operation> >> >> In the client process, during the marshalling of the request, a >> CORBA.DATA_CONVERSION exception is thrown when we attempt to write out >> the character. >> >> I think the problem lies in the fact that the type mapping for a char is >> corba:char <-> xs:byte <-> java byte (or Byte). >> Class org.apache.yoko.bindings.corba.CorbaObjectWriter casts the object >> to be marshalled to a Character in its writeChar method. >> Should this be cast to a Byte instead? Or should the Byte be >> appropriately converted to a Character before being written out? >> >> I am not sure what the right approach to fix it is. >> Perhaps someone with a better understanding of the runtime can help me >> here? >> >> Any help or pointers to relevant resources will be appreciated. >> >> To reproduce this failure, enable the test by commenting out the >> testChar method in >> >> bindings/src/test/java/org/apache/yoko/bindings/corba/IdlToWsdlTypeTest.java >> >> >> >> Cheers, >> - Matteo >> >> >
