axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Larry D \(LJOHNSON\)" <LJOHN...@arinc.com>
Subject TimeZone Not Handled Properly In java.util.Date Conversions
Date Thu, 15 Feb 2007 17:59:11 GMT
It seems the conversions of the java.util.Date class are not being
handled properly.  I have defined a server return value of a
java.util.Date.  The WSDL automatically generated for that value is as
follows:

 

  <xs:element name="departureTime" type="xs:dateTime"/>

 

The client stub is generated using the provided WSDL2Java.  The client
stub returns a java.util.Calendar object for this value.  So far all is
well.  The problem comes in when you start looking into the handling of
the TimeZone from server to client.  Lets say both client and server are
within the "Central Standard Time" zone.  When the server provides the
Date object to the POJO interface, the time is
"1970-01-01T23:55:00.000".  Axis2 then converts that time to a GMT time.
The SOAP message contains "1970-01-02T05:55:00.000Z".  Again all is
well.  When the client gets the Calendar object from the stub classes,
the value is: 01/02/1970 11:55:00 Greenwich Mean Time.  The time value
is incorrect for the TimeZone indicate; however, it is correct for the
local TimeZone.

 

The client simply performs the following:

 

    responeData.getDepartureTime();

 

Am I missing something here?  Should the returned Calendar either keep
the time consistent with GMT or convert the time to local time while
changing the TimeZone to indicate the local TimeZone?

 

Regards,

Larry Johnson


Mime
View raw message