users@jaxb.java.net

Re: xsd:date and default binding

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 05 Feb 2007 10:53:48 -0800

Henri Gomez wrote:
> Hi to all,
>
> I'm using JAX-WS 2.1EA3 and JAXB2 to developp some webservices.
>
> My Business Bean are using java.util.Date where only the Date part is usefull.
>
> The WSDL/Schema bind them as xsd:datetime where I'd like to see xsd:date.
>
> I see that we should use XMLGregorianCalendar to have xsd:date but all
> my business logic is using Date.
>
> How could I make JAXB2 use xsd:date for Date ?

@XmlSchemaType. See its javadoc and it has the exact example for your case.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com