Should server side of web service validate the xml using the XSD (worried about performance)?
posted 5 years ago
I'm new to web services but I've read that validating the XML using the XSD is slow and shouldn't be used in production but it seems a lot of applications do it. Our web service needs to be very fast. So is it better to not validate the xml using the XSD and just put all the validation in the application code? OR to just do course grain validation with the XSD and then fine grain with the application code (but I would assume even with this you still have the performance hit)? The validation I am thinking for the XSD would just be the lengths of fields and mins occurs/max occurs type validations. Just high level items. What is the best practice for how this is handled?
Also, even if you don't validate the XML with the XSD, I am assuming that you could still put all of the min occurs/max occurs and fields lengths in the XSD even if you don't use it to validate the XML so that the consumer of the web service has the format of what is expected in the XML?