aspose file tools*
The moose likes Web Services and the fly likes Date Problem in Webservices Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Date Problem in Webservices" Watch "Date Problem in Webservices" New topic
Author

Date Problem in Webservices

maoushuk Imran
Greenhorn

Joined: Jul 01, 2009
Posts: 6
I ve a weird problem while sending date through webservices. whatever date i'm setting is not sent properly. its always 1 day less than the original. Cod eis below with example.

calender = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
calender.setTime(objDocHeaderBean.getCreationDate());

if i print 'objDocHeaderBean.getCreationDate()' its correct (2009-06-30) . but when i send in webservices its one day less than the original (2009-06-29T00:00:00.000+00:00).

Please Help me @ the earliest. I think there is some problem with the UTC thing. Can any1 help me???
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Have you checked the serialized message on the wire (ie. the SOAP message, if it is a SOAP web service)?
Is the date correct there or do the error occur when the data is being serialized?
Have you seen the class javax.xml.datatype.XMLGregorianCalendar, which, as far as I know, is more suitable for use with web services? Perhaps giving this class a try can solve your problem.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date Problem in Webservices
 
Similar Threads
UTC format date in XML- Help!!
issue with datetimepicker & autocompleter in struts 2
Problem or bug with the method getTime() from java.util.Date
Convert Local time to UTC and vice versa
Util package date