Yea... this is a JAXB thing. You need to create a binding in either a
separate file in inline in the xsd file. I prefer an external file as
some xsd files. Here's one I use for the xsd date to java date mapping
<jxb:bindings version="1.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="vehicleLookupRequest.xsd"
node="/xs:schema">
<jxb:globalBindings>
<jxb:javaType name="java.util.Date"
xmlType="xs:dateTime"
parseMethod="com.autoreturn.util.DateConversionUtility.parseCustomDateTi
me"
printMethod="com.autoreturn.util.DateConversionUtility.printCustomDateTi
me" />
<jxb:javaType name="java.util.Date" xmlType="xs:date"
parseMethod="com.autoreturn.util.DateConversionUtility.parseCustomDateTi
me"
printMethod="com.autoreturn.util.DateConversionUtility.printCustomDateTi
me" />
</jxb:globalBindings>
</jxb:bindings>
</jxb:bindings>
You then need to apply this binding when building your class files. If
you are using ant it would look something like this.
<xjc schema="${jaxb.schema}/vehicleLookupRequest.xsd"
package="com.autoreturn.service.model"
binding="${jaxb.schema}/vehicleLookupRequestBinding.xjb"
destdir="${gen.src}" extension="true">
<produces dir="${gen.src}/vehicleLookupRequest"
includes="**/*.java" />
</xjc>
More info
http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html - see
chapter 2
<http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html%20-%20
see%20chapter%202>
-- deno
________________________________
From: Sebastien Cesbron [mailto:[EMAIL PROTECTED]
Sent: Monday, December 18, 2006 11:52 PM
To: [email protected]
Subject: Re: [xfire-user] Register jaxb 2.0 adapter
I've tried the @XmlSchemaType annotation and does not seem to work. I
will try to combine both to see if it works.
I've seen another discussion thread about
http://jira.codehaus.org/browse/XFIRE-739 and maybe there is some
problems around jaxb annotation processing ?
I will tell you later if I could use these annotations
Thanx for the help
Seb
On 12/18/06, Dan Everton <[EMAIL PROTECTED]> wrote:
This is more of a JAXB 2.0 problem than an Xfire issue. Take a look at
something like
http://weblogs.java.net/blog/kohsuke/archive/2006/03/how_do_i_map_xs.htm
l
Which should give you some ideas on how to customise the binding. If
you're using the Xfire wsgen task, you can also use a bindings file to
customise the mapping from POJO to XSD.
If you're using JAXB annotated pojos it's even easier.
@XmlJavaTypeAdapter(XsdDateAdapter.class)
@XmlSchemaType(name = "date")
protected Calendar endDate;
Where XsdDateAdapter is a type adapter that does what you need on
(un)marshall.
Dan
OAG Best Low Cost Airline Of The Year
The content of this e-mail, including any attachments, is a confidential
communication between Virgin Blue, Pacific Blue or a related entity (or
the sender if this email is a private communication) and the intended
addressee and is for the sole use of that intended addressee. If you are
not the intended addressee, any use, interference with, disclosure or
copying of this material is unauthorized and prohibited. If you have
received this e-mail in error please contact the sender immediately and
then delete the message and any attachment(s). There is no warranty that
this email is error, virus or defect free. This email is also subject to
copyright. No part of it should be reproduced, adapted or communicated
without the written consent of the copyright owner. If this is a private
communication it does not represent the views of Virgin Blue, Pacific
Blue or their related entities. Please be aware that the contents of any
emails sent to or from Virgin Blue, Pacific Blue or their related
entities may be periodically monitored and reviewed. Virgin Blue,
Pacific Blue and their related entities respect your privacy. Our
privacy policy can be accessed from our website: www.virginblue.com.au
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
<http://xircles.codehaus.org/manage_email>