cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jan.minarovi...@external.t-mobile.at
Subject xml validation - only for logging [Virus checked]
Date Tue, 15 Jul 2008 11:10:22 GMT
Hello,

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 
            u.setEventHandler(validationEventHandler);
after each
            u.setSchema(schema);

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 
errors

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