Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues

Bug 1020

Summary: Null String encoding is not following strict IIOP
Product: JacORB Reporter: david.shay
Component: ORBAssignee: Mailinglist to track bugs <jacorb-bugs>
Status: RESOLVED INVALID    
Severity: normal CC: jacorb
Priority: P5    
Version: 3.5   
Hardware: PC   
OS: Windows NT   

Description david.shay 2015-09-04 04:57:08 UTC
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;
}
Comment 1 Nick Cross 2015-09-04 05:34:38 UTC
What server are you testing against?
Comment 2 david.shay 2015-09-04 05:58:16 UTC
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.
Comment 3 Nick Cross 2015-09-04 08:20:13 UTC
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.