Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
Bug 1020 - Null String encoding is not following strict IIOP
Summary: Null String encoding is not following strict IIOP
Status: RESOLVED INVALID
Alias: None
Product: JacORB
Classification: Unclassified
Component: ORB (show other bugs)
Version: 3.5
Hardware: PC Windows NT
: P5 normal
Assignee: Mailinglist to track bugs
URL:
Depends on:
Blocks:
 
Reported: 2015-09-04 04:57 UTC by david.shay
Modified: 2015-09-04 08:20 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.