On 07/26/2010 06:41 AM, Glen Mazza wrote:
Very puzzling...your parse and print methods should not be ignored, unless
you're somehow identifying them incorrectly in the binding file. Perhaps(?)
when Kohsuke wrote that in 2006, you may have needed to manually create your
own parse functions...but that is such a common request today perhaps JAXB
creates that adapter class for you automatically now, and for some reason
your override is not being activated?
At any rate, doesn't matter, if you search on "Q: How to map xsd:dateTime to
java.util.Date?" on this page:
http://cxf.apache.org/docs/wsdl-to-java.html, you'll see CXF has its own
internal classes you can use for that conversion. Apparently you'll need to
place this configuration in a JAX-WS binding file and not a JAXB one.
Indeed, works like a charm.
But I've put it in a JAXB file, like this :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings version="2.0"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:globalBindings localScoping="nested"
collectionType="java.util.ArrayList"
generateValueClass="true">
<jaxb:javaType name="java.util.Date" xmlType="xs:dateTime"
parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime"
printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/>
<xjc:serializable uid="2"/>
</jaxb:globalBindings>
</jaxb:bindings>
Thanks a lot.
--
Bruno Dusausoy
YP5 Software
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.