When new line char is encountered inside <DATA> tag (COMPACT DECODED format), the JRETSC API crashes.
According to Real Estate Transaction Specification Version 1.5 (Second Edition), CRLF is a legal char in the field-data content (as part of the LWS entity):
compact-data ::= <DATA> field-delimiter *( field-data field-delimiter ) </DATA> CRLF
field-data ::= *TEXT
TEXT ::= <any OCTET except CTLs, but including LWS>
CTL ::= <any US-ASCII control character (octets 0 - 31) and DEL (127)>
LWS ::= [CRLF] 1*( SP | HT )
CRLF or ↵ ::= CR LF
Single record containing CRLF in any of its fields makes the data parsing from that particular server impossible. CRLF can usually be found inside Remarks/Description fields.
Hope that this issue will get some attention.
Thanks
Dusko
Fixed attached in case someone is interested. The fix is based on a reverse code engineering not the original code. Ready to integrate the original code if provided.
The fix is as follow:
1- replace all the \r\n with just $#13; (although not needed)
2- in case a line starts with <DATA but="" doesn't="" end="" with="" <="" DATA="">
2.a Go into a loop, read line and append till it finds the </DATA>
2.b if the </DATA> not found (due to reading from stream didn't reach yet, push back what was read onto the source stringbuffer and keep reading from string
To compile, just include the attached file into a source folder/pacakge com.mris.platinum.client.rets so they are part of your build and remove the .class from the original .jar file.