You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by easternwahoo <ja...@siemens.com> on 2009/11/02 17:23:57 UTC

Can schema validation detect more than one error?

In CXF 2.2.4, can "schema validation" validate for more than one error, and
return a list of validation errors in its soap fault?  It seems like it
fails after the first error.  
-- 
View this message in context: http://old.nabble.com/Can-schema-validation-detect-more-than-one-error--tp26157728p26157728.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Can schema validation detect more than one error?

Posted by Benson Margulies <bi...@gmail.com>.
The underlying schema validation technology, AFAIK, can't do what you want.

On Mon, Nov 2, 2009 at 11:23 AM, easternwahoo <ja...@siemens.com>wrote:

>
> In CXF 2.2.4, can "schema validation" validate for more than one error, and
> return a list of validation errors in its soap fault?  It seems like it
> fails after the first error.
> --
> View this message in context:
> http://old.nabble.com/Can-schema-validation-detect-more-than-one-error--tp26157728p26157728.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Can schema validation detect more than one error?

Posted by Daniel Kulp <dk...@apache.org>.
On Fri November 6 2009 9:54:33 am easternwahoo wrote:
> In JAXB, you can use the ValidationEventHandler to store up a set of
>  errors.

Cool.   That's good to know.   :-)    Thanks!

Dan

> 
> dkulp wrote:
> > On Mon November 2 2009 11:23:57 am easternwahoo wrote:
> >> In CXF 2.2.4, can "schema validation" validate for more than one error,
> >> and
> >> return a list of validation errors in its soap fault?  It seems like it
> >> fails after the first error.
> >
> > Well, with JAXB, you MIGHT be able to do this.   I'm not really sure.
> > The
> > JAXBDataBinding allows a ValidationEventHandler to be registered.     You
> > MAY
> > be able to have the ValidationEventHandler store the problematic
> > validation
> > events in a ThreadLocal or something and then have an interceptor that
> > runs
> > later to check the ThreadLocal to see if there are events there and throw
> > an
> > exception at that point.
> >
> > Honestly, I'm not sure if that would work.   I really don't know if JAXB
> > catches the exceptions from the underlying schema validator and forwards
> > them
> > in properly or if they are just bubbled up.   I've never really looked.
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Can schema validation detect more than one error?

Posted by easternwahoo <ja...@siemens.com>.
In JAXB, you can use the ValidationEventHandler to store up a set of errors.  


dkulp wrote:
> 
> On Mon November 2 2009 11:23:57 am easternwahoo wrote:
>> In CXF 2.2.4, can "schema validation" validate for more than one error,
>> and
>> return a list of validation errors in its soap fault?  It seems like it
>> fails after the first error.
> 
> Well, with JAXB, you MIGHT be able to do this.   I'm not really sure.  
> The 
> JAXBDataBinding allows a ValidationEventHandler to be registered.     You
> MAY 
> be able to have the ValidationEventHandler store the problematic
> validation 
> events in a ThreadLocal or something and then have an interceptor that
> runs 
> later to check the ThreadLocal to see if there are events there and throw
> an 
> exception at that point.
> 
> Honestly, I'm not sure if that would work.   I really don't know if JAXB 
> catches the exceptions from the underlying schema validator and forwards
> them 
> in properly or if they are just bubbled up.   I've never really looked.
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/Can-schema-validation-detect-more-than-one-error--tp26157728p26230786.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Can schema validation detect more than one error?

Posted by Daniel Kulp <dk...@apache.org>.
On Mon November 2 2009 11:23:57 am easternwahoo wrote:
> In CXF 2.2.4, can "schema validation" validate for more than one error, and
> return a list of validation errors in its soap fault?  It seems like it
> fails after the first error.

Well, with JAXB, you MIGHT be able to do this.   I'm not really sure.   The 
JAXBDataBinding allows a ValidationEventHandler to be registered.     You MAY 
be able to have the ValidationEventHandler store the problematic validation 
events in a ThreadLocal or something and then have an interceptor that runs 
later to check the ThreadLocal to see if there are events there and throw an 
exception at that point.

Honestly, I'm not sure if that would work.   I really don't know if JAXB 
catches the exceptions from the underlying schema validator and forwards them 
in properly or if they are just bubbled up.   I've never really looked.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog