cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject xml validation - only for logging [Virus checked]
Date Tue, 15 Jul 2008 11:10:22 GMT

i have requirement to do xml schema validation, but in case of problem 
only to log it, but continue serialization/deserialization. This is 
beacause after enabling validation we found that some clients are not 
sending requests valid against schema (e.g. are not sending elements, 
instead of sending nil atribute, or are sending elements in wrong order 
etc). So we want to log all such problems and tell then client developer 
where are problems....

I did following:
in JaxBEncoderDecoder i set 
after each

and declared (this will be extended):

    private static final ValidationEventHandler validationEventHandler = 
new ValidationEventHandler() {
        public boolean handleEvent(ValidationEvent event) {
                LOG.log(Level.SEVERE, "Validation Error: 
[severity="+event.getSeverity()+", message='"+event.getMessage()+"', 
location='"+event.getLocator()+"'].", event.getLinkedException());
                return true;

my question is if i can in general return true from handleEvent method. 
Because i'm afraid, that this method is called also in case of different 

best regards
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message