Reputation: 1
Used Apache axis to consume a WSDL which has a column of type="xsd:dateTime"
.
In SOAP UI with plain vanilla request, response has -
<UpdateDateTime>2012-05-08T04:58:00</UpdateDateTime>
However when using axis consumer, for the same value - listOfValues[pos].getUpdateDateTime().getTime()
returns a different time -
2012-05-07 21:58:00
.
getUpdateDateTime()
in the above returns instance of java.util.Calendar.
Is it a timezone problem or the 'T' in between is parsed incorrect? How can I resolve this?
Upvotes: 0
Views: 1993
Reputation: 1
Here is the Eclipse debug with date time value in Inspect -
http://i45.tinypic.com/157zpy1.jpg
& the plain request in soap UI gives -
2012-05-08T04:58:00 Bombay,India
Sorry, i meant UTC in my first reply.
Upvotes: 0
Reputation: 1503080
How are you displaying the "2012-05-07 21:58:00"? It's almost certainly just a time zone issue. I suspect it's treating 2012-05-08T04:58:00 as a universal time, and applying your local time zone to that. It's hard to say without seeing any code or where your diagnostics have come from, but I'd be surprised if it weren't just a time zone issue.
Of course, if you can use Joda Time instead of java.util.Date/Calendar
, you can use LocalDateTime
which is what I suspect is represented here (given the lack of time zone information in the response). I don't know if Axis supports that, but it would be worth looking into.
Upvotes: 2