Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 635FE200CF8 for ; Thu, 31 Aug 2017 08:20:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6178516AA25; Thu, 31 Aug 2017 06:20:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A7E7E16AA1E for ; Thu, 31 Aug 2017 08:20:09 +0200 (CEST) Received: (qmail 37991 invoked by uid 500); 31 Aug 2017 06:20:08 -0000 Mailing-List: contact dev-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list dev@olingo.apache.org Received: (qmail 37966 invoked by uid 99); 31 Aug 2017 06:20:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2017 06:20:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 436791A23BB for ; Thu, 31 Aug 2017 06:20:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id M7_-pPhA9DIU for ; Thu, 31 Aug 2017 06:20:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A22125FDB8 for ; Thu, 31 Aug 2017 06:20:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DB614E04F7 for ; Thu, 31 Aug 2017 06:20:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id E7E0324147 for ; Thu, 31 Aug 2017 06:20:00 +0000 (UTC) Date: Thu, 31 Aug 2017 06:20:00 +0000 (UTC) From: "Punith DG (JIRA)" To: dev@olingo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (OLINGO-1173) CLONE - EdmDateTime format validation while parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 31 Aug 2017 06:20:10 -0000 [ https://issues.apache.org/jira/browse/OLINGO-1173?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Punith DG updated OLINGO-1173: ------------------------------ Attachment: EdmDateTime.java Comments are transforming to emoticans. Attached the fix java source file. > CLONE - EdmDateTime format validation while parsing > --------------------------------------------------- > > Key: OLINGO-1173 > URL: https://issues.apache.org/jira/browse/OLINGO-1173 > Project: Olingo > Issue Type: Question > Components: odata2-core > Affects Versions: V2 2.0.6 > Reporter: Punith DG > Assignee: Christian Amend > Attachments: EdmDateTime.java > > > Hi Olingo Dev, > I am using olingo(for OData2 ) as a client to access some OData providers= ' APIs . > I am using below jars=20 > olingo-odata2-core-2.0.6.jar > olingo-odata2-api-2.0.6.jar > Olingo fails to parse the EdmDateTime field when the OData provider sends= it with a wrong data format=20 > e.g. > 2016-03-22T08:36:24Z d= ata for a Edm.DateTime field. > Microsoft dynamics CRM sends all its EdmDateTime in this wrong format. > Form the olingo code it looks like you force the data type to have the ex= act same format that of the primitive types supported by OData. As defined = here http://www.odata.org/documentation/odata-version-2-0/overview/#Abstrac= tTypeSystem > So this way an EdmDateTime should be always of this type --> 2000-12-12T1= 2:00 > while parsing this date we are getting below exception > Caused by: org.apache.olingo.odata2.api.edm.EdmSimpleTypeException: The = literal '2016-04-04T21:53:44Z' is not formatted properly. > at org.apache.olingo.odata2.core.edm.EdmDateTime.parseLiteral(EdmDa= teTime.java:116) > at org.apache.olingo.odata2.core.edm.EdmDateTime.internalValueOfStr= ing(EdmDateTime.java:91) > at org.apache.olingo.odata2.core.edm.AbstractSimpleType.valueOfStri= ng(AbstractSimpleType.java:91) > at org.apache.olingo.odata2.core.ep.consumer.XmlPropertyConsumer.co= nvert(XmlPropertyConsumer.java:206) > at org.apache.olingo.odata2.core.ep.consumer.XmlPropertyConsumer.re= adStartedElement(XmlPropertyConsumer.java:192) > at org.apache.olingo.odata2.core.ep.consumer.XmlEntryConsumer.readP= roperties(XmlEntryConsumer.java:591) > at org.apache.olingo.odata2.core.ep.consumer.XmlEntryConsumer.readC= ontent(XmlEntryConsumer.java:544) > at org.apache.olingo.odata2.core.ep.consumer.XmlEntryConsumer.handl= eStartedTag(XmlEntryConsumer.java:137) > at org.apache.olingo.odata2.core.ep.consumer.XmlEntryConsumer.readE= ntry(XmlEntryConsumer.java:89) > As a consumer/client this is stopping us from using a major part of the A= PI specially query.=20 > Question: > 1) Is there any kind of configuration in olingo that allows olingo client= s to avoid this validation ? > 2) Is there any way I can override those classes to relax validation? > I do not see any way to override EdmDateTime class (package org.apac= he.olingo.odata2.core.edm) > As org.apache.olingo.odata2.core.edm.EdmDateTime.parseLiteral(String= , EdmFacets, Calendar) being a static method. Looks like you don=E2=80=99t = want anyone to override them. > 3) Do you regard this as an issue or is it Working as design ? If it is w= orking as designed, then is there a way to work around this, =20 > so that as a client we will still be able to parse wrong formatted dat= a? > 4) If there is no step taken yet and in case it is a well-known issue(?),= is there any near future plan to address this issue ? > Thanks, > Rahul -- This message was sent by Atlassian JIRA (v6.4.14#64029)