[jboss-user] [JBoss Web Services] - Re: jaxb version used by JBoss AS 7.0Final (date issue/timezone issue)

Peter Fry do-not-reply at jboss.com
Wed Aug 22 08:57:16 EDT 2012


Peter Fry [https://community.jboss.org/people/peterfry] created the discussion

"Re: jaxb version used by JBoss AS 7.0Final (date issue/timezone issue)"

To view the discussion, visit: https://community.jboss.org/message/755129#755129

--------------------------------------------------------------
This only seems to be a problem when using a DateConverter i.e. 

<bindings version="2.1"
          xmlns=" http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb"
          xmlns:xs=" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema">
          xmlns:xsi=" http://www.w3.org/2000/10/XMLSchema-instance http://www.w3.org/2000/10/XMLSchema-instance"
          xmlns:xjc=" http://java.sun.com/xml/ns/jaxb/xjc http://java.sun.com/xml/ns/jaxb/xjc"
          xsi:schemaLocation=" http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb  http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
  <globalBindings>               
     <javaType name="java.util.Date" xmlType="xs:date"             
           parseMethod="uk.co.abusiness.webservices.DateConverter.parseDate"             
           printMethod="uk.co.abusiness.webservices.DateConverter.printDate"/>           
     <javaType name="java.util.Date" xmlType="xs:time"             
           parseMethod="uk.co.abusiness.webservices.DateConverter.parseTime"             
           printMethod="uk.co.abusiness.webservices.DateConverter.printTime"/>           
     <javaType name="java.util.Date" xmlType="xs:dateTime"             
           parseMethod="uk.co.abusiness.webservices.DateConverter.parseDateTime"             
           printMethod="uk.co.abusiness.webservices.DateConverter.printDateTime"/>
     <serializable uid="1" />
  </globalBindings>
</bindings>

And specifically the printDate, printDateTime, printTime methods. Previously we had followed the various suggestions on the internet and implemented:

        Calendar cal = new GregorianCalendar();
        cal.setTime( dt );
        return DatatypeConverter.printDateTime( cal );

It seemed the calls to DatatypeConverter introduced the problem.

Our resolution was to use the JAXB 2.2.1 implementations of the printDate, printDateTime and printTime methods directly/inline (the reference implementation includes the source).


--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/755129#755129]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120822/b86968ab/attachment.html 


More information about the jboss-user mailing list