cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <daniel.k...@iona.com>
Subject Re: JAXB Validation in EndpointImpl?
Date Mon, 25 Sep 2006 20:14:54 GMT

+1 to all of it.

We should be able to schema validate with any of the databindings and 
frontends without having to update all the frontends.  

Dan


On Friday September 22 2006 4:34 pm, Dan Diephouse wrote:
> Well it would help if I actually checked my subject before I sent it...
> Here we go again :-D
> - Dan
>
> Dan Diephouse wrote:
> > I was surprised to see this in EndpointImpl today:
> >
> >    private void addSchemaValidation() {
> >        Schema schema =
> > EndpointReferenceUtils.getSchema(service.getServiceInfo());
> >              if (service.getDataBinding().getDataReaderFactory()
> > instanceof JAXBDataReaderFactory) {
> >
> > ((JAXBDataReaderFactory)service.getDataBinding().getDataReaderFactory()).
> >setSchema(schema);
> >
> >        }
> >              if (service.getDataBinding().getDataWriterFactory()
> > instanceof JAXBDataWriterFactory) {
> >
> > ((JAXBDataWriterFactory)service.getDataBinding().getDataWriterFactory()).
> >setSchema(schema);
> >
> >        }
> >    }
> >
> > I'm not sure when it got added, but I'm pretty sure this is NOT the
> > right place for it.  I think this is a much more general feature than
> > just JAX-WS or just JAXB, and hence should be part of the core
> > functionality.
> >
> > I think that to solve this we probably want to
> > a) Give a service reference to the databinding. One way we could do
> > this is add the Service to the constructor of the JAXBDataBinding.
> > Same would go for an XmlBeansDatabinding.
> > b) Create a configuration property to turn on schema validation. This
> > can then be checked by doing
> > Boolean.TRUE.equals(message.getContextualProperty(SCHEMA_VALIDATE)).
> > This way schema validation can be turned on at the  request,
> > operation, or service level.
> >
> > Cheers,
> > - Dan

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194   F:781-902-8001
daniel.kulp@iona.com

Mime
View raw message