views:

43

answers:

1

Hi All, I'm doing Sprimg WS at my workplace. We run into some strange validation problems, where if a user passes "Dog" for a boolean value. It still accepts it and blows up. I would like to know what's the best way to handle this kind of problem.

Requirement:

Based on the SOAP request, If there are any validation errors, return the set of customized errors back to the user.

Technology used, XMLObject for XML to Object translation.

Current way to validate (Which I feel can be improved) Checking if the element is Nil and is Set for each and every element in the XML.

What I tried?

I tried to use XMLObject Validate method, Which I suppose just returns one error at a time. Which is not feasible for us. I want to send the list of errors which the request forgot to comply with the XML Schema.

Please suggest me some ways to proceed with this , which could be efficient.

+1  A: 

Hello,

You should validate against your XSD schema(s) in your WSDL.

I have written a tutorial with server validation here and a tutorial with client validation here that hopefully gives you some suggestions!

Espen
Thanks Espen. I'll suggest this solution, But, is there a way we can make the server side validation errors more user friendly. We don't expect the users to be technically sufficient to understand those kind of errors. Please let me know.
Vanchinathan Chandrasekaran
Hello, I'm not sure. Post it as a new question and I will try to look at it.
Espen