You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Jim Ma <ji...@iona.com> on 2006/10/18 14:19:49 UTC
RE: Databinding issues - JAXB Validation in EndpointImpl? Also, JAX
Hi Dan,
I am working on this issue now. I want to know if it is sufficient we
configure and turn on schema validation at service level and port level .
I think configuration file cxf.xml can be this :
<bean id="cxf.{http://apache.org/hello_world_soap_http}SOAPService"
class="org.apache.schemavlidation.ServiceConfigBean">
<property name="enableSchemaValidationForAllPort" value="false"/>
<bean id="cxf.{http://apache.org/hello_world_soap_http}/SoapPort1"
class="org.apache.cxf.schemavalidation.PortConfigBean">
<property name="enableSchemaValidation" value="true"/>
</bean>
<bean id="cxf.{http://apache.org/hello_world_soap_http}/SoapPort2"
class="org.apache.cxf.schemavalidation.PortConfigBean">
<property name="enableSchemaValidation" value="false"/>
</bean>
</bean>
Do we need to turn on at operation level ?
If we turn on the schema validation on request level , where can we set the
enable flag ? In SoapHeader?
Thanks
Jim
> -----Original Message-----
> From: Dan Diephouse [mailto:dan@envoisolutions.com]
> Sent: Saturday, September 23, 2006 4:31 AM
> To: cxf-dev@incubator.apache.org
> Subject: Databinding issues - JAXB Validation in EndpointImpl? Also, JAX
>
>
> 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().getDataReaderFact
> ory()).setSchema(schema);
> }
>
> if (service.getDataBinding().getDataWriterFactory() instanceof
> JAXBDataWriterFactory) {
>
> ((JAXBDataWriterFactory)service.getDataBinding().getDataWriterFact
> ory()).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
>
> --
> Dan Diephouse
> (616) 971-2053
> Envoi Solutions LLC
> http://netzooid.com
>