• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Date Problem in Webservices

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic