wood burning stoves 2.0*
The moose likes Web Services and the fly likes overriding the web service validation message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "overriding the web service validation message" Watch "overriding the web service validation message" New topic

overriding the web service validation message

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312

I have implemented web service schema validation in our web service project. We have implemented a web service handler class, xml handler chain and added annotations in the web service class. All this works fine and I am able to see the schema validation in action.
However one question I have is how can I override the validation message which is generated out of the box. I want to provide for a more user intuitive message in the error say something like if column DOB is missing then I want to state the error message saying DOB is missing from the input rather than something cryptic in xml jargon.

Let me know your thoughts.


Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Have you had a look at the interface org.xml.sax.ErrorHandler?
If you use a javax.xml.validation.Validator, you can set a custom error hander and receive notifications of validation errors and generate your own messages.
I am not sure that you will receive the detailed information you are looking for, but you can give it a try.
Best wishes!

My free books and tutorials: http://www.slideshare.net/krizsan
It is sorta covered in the JavaRanch Style Guide.
subject: overriding the web service validation message
Similar Threads
XML Schema Validation
SAX XSD Validation. Error callback is called twice.
wsdl schema validation and validation message
WebSphere webservice
Trigger handleFault method in jax-rpc message handler