cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <sbery...@progress.com>
Subject Re: JAXB ingores @XmlElement(required=true) on unmarshalling in JAX-RS
Date Fri, 20 Feb 2009 17:09:44 GMT
Hi,

May be JAXBElementProvider needs few tweaks (in the AbstractJAXBProvider) ? Schema validation
is supported there, see for ex [1].

But I believe you're talking about different type of validation. May be a proper Validator
can be created if it's required through 
the configuration. For ex, we can add a property which will enable the validation in general,
and if no schemas have been set then a 
default JAXB validator will be created

Cheers, Sergey

[1] http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml

>
> I know this problem is specific to JAXB but I wonder if it's either known
> issue or I have wrong setup. I am trying to force check on required XML
> elements in JAX-RS request using CXF2.2/JAXB2.1. I can still successfully
> pass thru XML doc with missing elements leading to backend logic failing
> with NPEs etc.
> I've found one suggestion on specifying JAXB jars before CXF jar on
> classpath but it's hard to do with webapp classloader.
> Any ideas?
>
> cheers,
> andy.
> -- 
> View this message in context: 
> http://www.nabble.com/JAXB-ingores-%40XmlElement%28required%3Dtrue%29-on-unmarshalling-in-JAX-RS-tp22122276p22122276.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 


Mime
View raw message