users@jax-rpc.java.net

Re: 4.2.1 Simple Types (java.util.Date)

From: Doug Kohlert <doug.kohlert_at_sun.com>
Date: Fri, 30 May 2003 14:41:13 -0700

Ow,
The reason this mapping exists is because xsd:dateTime contains both date
and time. If the mapping were use java.util.Date, the time would be lost
for applications that require the time.

If you notice in section 5.3.2, that both Date and Calendar are mapped
to xsd:dateTime. Thus if you write an application in Java that uses
Date, it will transfer that Date as xsi:dateTime. However, as you have
noted, because of the mapping in 4.2.1, clients generated from the WSDL will
use Calendar, not Date.

I hope this clarifies things for you.

ow wrote:
> Hi,
>
> Somehow it is not clear to me why xsd:dateTime is mapped to java.util.Calendar instead of java.util.Date.
>
> Why force people who do not need the functionality of Calendar to go through conversion from java.util.Date (say, 5000 records for every call)? People who want to use Calendar will also have to go through conversion since, e.g., they can't store Calendar in the database and the rest of JDK expects Date all over the place, not Calendar.
>
> Sounds like a very strange design choice to me.
>
> Thanks


-- 
Doug Kohlert
Java Software Division
Sun Microsystems, Inc.
phone: 503 345-9806