When encoding zero length String, Jacorb is creating a String of length one with the terminating zero character. However, when you switch on the null String encoding (jacorb.interop.null_string_encoding=on), it generates a zero length String, that can break the server ORB which can not unmarshall it. in CDROutputStream, encoding of a zero length stream: if (valueLength == 0) { // Blank string; just write size and terminator. Don't need to // align here as these methods will do it for us. write_long( 1 ); write_octet( (byte)0 ); } null string encoding: if (nullStringEncoding) { write_long(0); return; }
What server are you testing against?
We have JacORB, OmniORB and Orbix servers. JacORB is no problem. For OmniORB, we found a parameter that might help working around the problem. Did not look into the Orbix server yet, but it complains about zero length String.
As the interop property description says this was primarily aimed at Visibroker. Other ORBs may or may not have this facility. Turning it on does violate the spec. I would recommend you turn it off in your case.