Can schema validation detect more than one error?

View: New views
5 Messages — Rating Filter:   Alert me  

Can schema validation detect more than one error?

by easternwahoo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.  

Re: Can schema validation detect more than one error?

by bimargulies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The underlying schema validation technology, AFAIK, can't do what you want.

On Mon, Nov 2, 2009 at 11:23 AM, easternwahoo <janet.moyer@...>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?

by dkulp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://www.dankulp.com/blog

Re: Can schema validation detect more than one error?

by easternwahoo () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In JAXB, you can use the ValidationEventHandler to store up a set of errors. The the ValidationEventCollector provides an easier way to do this.

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?

by dkulp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://www.dankulp.com/blog