cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Ma" <jim...@iona.com>
Subject RE: Databinding issues - JAXB Validation in EndpointImpl? Also, JAX
Date Wed, 18 Oct 2006 12:19:49 GMT
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
>


Mime
View raw message