Hi Sergey,
Thanks for the reply.
I added below property to the section.
And I wrote CustomerValidationEventHanlder Class. I want to give specific
error message to the client..So i wrote Cutomer validation handler class.As
of now schema is validating the request and giving "SAXParseException:
cvc-enumeration-valid" errror.
Dont worry about the schema.Its working now..(My previous email thread
-issue is working now) . Schema is validating the request and giving the
error ...( with linked exception:
[org.xml.sax.SAXParseException: cvc-enumeration-valid: Value 'Plg' is not
facet-valid with respect to enumeration '[Stopped, Paused, Playing]'. It
must be a value from the enumeration.]..).
Please find the custom event handler class:
public class CustomValidationEventHandler implements ValidationEventHandler
{
@Override
public boolean handleEvent(ValidationEvent ve) {
if (ve.getSeverity() == ve.FATAL_ERROR || ve .getSeverity() ==
ve.ERROR) {
ValidationEventLocator locator = ve.getLocator();
//print message from valdation event
System.out.println("Message is " + ve.getMessage());
//output line and column number
System.out.println("Column is " + locator.getColumnNumber() + " at
line number " + locator.getLineNumber());
}
return true;
}
}
Please find the cxf-spring config xml below:
classpath:/schemas/schema1.xsd
--
View this message in context:
http://cxf.547215.n5.nabble.com/How-to-setup-Custom-Validation-Event-Handler-COnfiguration-in-CXF-spring-xml-tp4271097p4271149.html
Sent from the cxf-user mailing list archive at Nabble.com.