JBoss Community

Re: Deployment error with @SchemaValidation

created by Erik Pelgrim in JBoss Web Services - View the full discussion

Apparently wsimport used XMLGregorianCalender java attributes which caused the SchemaValidation problem.

 

I solved it using a jaxb binding file so Calender java objects are used instead.

 

binding file "bindings.xml":

 

<?xml version="1.0" encoding="UTF-8" ?>

<jaxb:bindings

version="2.0"

xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"

xmlns:xs="http://www.w3.org/2001/XMLSchema">

<jaxb:globalBindings>

<jaxb:javaType name="java.util.Calendar" xmlType="xs:dateTime"

parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"

printMethod="javax.xml.bind.DatatypeConverter.printDateTime"/>

<jaxb:javaType name="java.util.Calendar" xmlType="xs:time"

parseMethod="javax.xml.bind.DatatypeConverter.parseTime"

printMethod="javax.xml.bind.DatatypeConverter.printTime"/>

<jaxb:javaType name="java.util.Calendar" xmlType="xs:date"

parseMethod="javax.xml.bind.DatatypeConverter.parseDate"

printMethod="javax.xml.bind.DatatypeConverter.printDate"/>

<jaxb:serializable uid="1"/>

</jaxb:globalBindings>

</jaxb:bindings>

 

and added "-b bindings.xml" to the wsimport command:

 

wsimport -keep -Xnocompile -b bindings.xml some.wsdl

 

Extra adapter.java files are generated for the conversion, don't forget to use them in your java project.

 

 

Hope someone else will find this useful as well!

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community