This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of React Cookbook: Recipes for Mastering the React Framework and have David Griffiths & Dawn Griffiths on-line!
See this thread for details.
Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

java.util.Date in axis

 
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all

i am new to sopa/ws/axis and trying to implement a simple time service. i have built an working service which returns the time in milliseconds (a long) which works but when i try to return a java.util.Date object, then i get a class cast exception (i use springframework and its webservice support proxies).

after some searching i found an article that says that axis will serialize Date objects perfectly but will create a java.util.Calendar on deserializing. is this true ? how can i change this ? any hints for how to do this in spring ?

thanks for your help

k
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of returning time in milliseconds, can you format the date in W3C format and return a string?

--
Joe
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

yes, since this is just a test i can format the return in whatever format i want to....
but i want to return a java util date (this is a test of several remoting mechanism including springs httpinvoker, hessian, burlap and rmi and they all work without any troubles with java.util.Date).
this is more a "i'm sure this is possible; i must be doing something wrong" thing :-)

so how do i return a java.util.Date with axis ? the doco says it's supported but i found this article http://www-128.ibm.com/developerworks/xml/library/ws-tip-roundtrip1.html which says that Date does not roundtrip.

but again since this is just a demo i might swallow my prode and use java.util.Calendar instead :-)


thanks for your help....

karl
 
a wee bit from the empire
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic