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

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Mon Mar 26 06:44:55 EDT 2007


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