If talking to a SAP LARA system, an a Entity key is datetime, the <id> tag
cannot be parsed correctly, because the representation of the date
(ReadingDate=datetime'2014-02-06T00%3A00%3A00') contains the URL encoding
character ":".
A quick fix is to shadow the org.odata4j.internal.InternalUtil class and
replace the method parseDateTimeFromXml:
public static LocalDateTime parseDateTimeFromXml(final String value)
{
/*
* XXX Hack to url encoded data format (ReadingDate=datetime'2014-01-06T00%3A00%3A00).
*/
String decoded;
try
{
decoded = URLDecoder.decode(value, StandardCharsets.ISO_8859_1.name());
}
catch (UnsupportedEncodingException e)
{
@SuppressWarnings("deprecation")
String tmp = URLDecoder.decode(value);
decoded = tmp;
}
Matcher matcher = DATETIME_XML_PATTERN.matcher(decoded);
...
Original issue reported on code.google.com by hannes.a...@gmail.com on 7 Feb 2014 at 7:09
Original issue reported on code.google.com by
hannes.a...@gmail.com
on 7 Feb 2014 at 7:09