[ 
https://issues.apache.org/jira/browse/AXIS2-5028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen resolved AXIS2-5028.
------------------------------------

    Resolution: Invalid

Axis2 provides integration with XmlBeans, but issues in the deserialization 
logic should be reported to the XmlBeans project directly.

> XmlBeans DateOrTimeOrDateTime generated from OTA simple type does not comply 
> with W3C standard
> ----------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-5028
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5028
>             Project: Axis2
>          Issue Type: Bug
>          Components: databinding
>    Affects Versions: 1.5.4
>         Environment: Windows XP, Eclispe IDE
>            Reporter: Yoann Guerro
>            Priority: Critical
>
> The generated type DateOrTimeOrDateTime from OTA simple type 
> DateOrTimeOrDateTimeType (OTA_SimpleTypes.xsd) doesn't accept 24 as a valid 
> value for the hour field.
> W3C XML Schema Part 2: Datatypes Second Edition (ref. 
> http://www.w3.org/TR/xmlschema-2/#dateTime) states that "'24' is permitted if 
> the minutes and seconds represented are zero, and the dateTime value so 
> represented is the first instant of the following day".
> Code below raises an exception: "union value '24:00:00' does not match any 
> members of 'DateOrTimeOrDateTimeType in namespace 
> http://www.opentravel.org/OTA/2003/05'"
> java.util.Calendar calendar = java.util.Calendar.getInstance();
> calendar.set(2000, 1, 1, 24, 0, 0);
> java.text.SimpleDateFormat format= new SimpleDateFormat("kk:mm:ss");
> org.opentravel.www.ota._2003._05.DateOrTimeOrDateTimeType aDate = 
> org.opentravel.www.ota._2003._05.DateOrTimeOrDateTimeType.Factory.newInstance();
> aDate.setStringValue(format.format(calendar.getTime()));
> Full stacktrace:
> org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: union value 
> '24:00:00' does not match any members of 'DateOrTimeOrDateTimeType in 
> namespace http://www.opentravel.org/OTA/2003/05'
>       at 
> org.apache.xmlbeans.impl.values.XmlUnionImpl.set_text(XmlUnionImpl.java:154)
>       at 
> org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(XmlObjectBase.java:1135)
>       at 
> org.apache.xmlbeans.impl.values.XmlObjectBase.set_String(XmlObjectBase.java:1080)
>       at 
> org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1637)
>       at 
> org.apache.xmlbeans.impl.values.XmlObjectBase.setStringValue(XmlObjectBase.java:1533)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to