[jboss-jira] [JBoss JIRA] Commented: (JBXB-99) marshalDate appends timezone

Alexey Loubyansky (JIRA) jira-events at lists.jboss.org
Mon Mar 26 07:23:04 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBXB-99?page=comments#action_12357281 ] 
            
Alexey Loubyansky commented on JBXB-99:
---------------------------------------

The schema format seems to allow the timezone for the date type http://www.w3.org/TR/xmlschema-2/#date-lexical-representation. The JAXB spec says the date format should follow the ISO8601 standard which seems to include only the year, month and the day. So, maybe it's ok to drop the timezone.

> marshalDate appends timezone
> ----------------------------
>
>                 Key: JBXB-99
>                 URL: http://jira.jboss.com/jira/browse/JBXB-99
>             Project: JBoss XML Binding (JBossXB)
>          Issue Type: Bug
>    Affects Versions: JBossXB-1.0.0.CR9
>            Reporter: Thomas Diesler
>
>    /**
>     * [-]yyyy-mm-dd
>     *
>     * @param value string date value
>     * @return equivalent date as an instance of java.util.Calendar.
>     */
>    public static String marshalDate(Calendar value)
>    {
>       String result = String.valueOf(value.get(Calendar.YEAR));
>       result += '-';
>       result += marshalInt(value.get(Calendar.MONTH) + 1, 2);
>       result += '-';
>       result += marshalInt(value.get(Calendar.DAY_OF_MONTH), 2);
>       result += marshalTimeZone(value);
>       return result;
>    }
> Given these CTS calendars 
>     public final static GregorianCalendar GregorianCalendar_data[] = {
> 	new GregorianCalendar(6,5,1,10,0,0),
> 	new GregorianCalendar(9,10,25,1,30,0),
> 	new GregorianCalendar(96,5,1,2,0,30),
> 	new GregorianCalendar(99,10,25,3,15,15),
> 	new GregorianCalendar(996,5,1,6,6,6),
> 	new GregorianCalendar(999,10,25,7,7,7),
> 	new GregorianCalendar(1996,5,1,8,8,8),
> 	new GregorianCalendar(1999,10,25,9,9,9),
> 	null
>     };
> jbossxb generates a string that cannot be parsed on the server side
> 12:12:36,027 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception
> org.jboss.xb.binding.JBossXBValueFormatException: Date value does not follow the format '-'? yyyy '-' mm '-' dd: 6-06-01-05:00
>         at org.jboss.xb.binding.SimpleTypeBindings.parseDate(SimpleTypeBindings.java:2088)
>         at org.jboss.xb.binding.SimpleTypeBindings.unmarshalDate(SimpleTypeBindings.java:1701)
>         at org.jboss.ws.core.jaxrpc.binding.CalendarDeserializer.deserialize(CalendarDeserializer.java:61)
>         at org.jboss.ws.core.jaxrpc.binding.CalendarDeserializer.deserialize(CalendarDeserializer.java:47)
>         at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:175)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list