Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB Validation in REST Jax-RS  RSS feed

 
Karan Kapoor Singhal
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an input xsd as below

When I provide the xml as below to the REST Service as input..whats happening write now is on the server side am getting null value when any value other than ADD/DELETE/UPDATE is passed in <operation> tag.
Is there a way that validation can be done on the client side and return error specifying what are the allowed values for <operation> tag when some other value is passed.



 
g tsuji
Ranch Hand
Posts: 697
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all you have to show your schema where you declare the common prefix and targetNamespace (at the xs:schema element) and some other attributes too in the xs:schema opening tag because anything wrong there means the schema itself could already be incorrect.

And then, the "xml as below" itself is incorrect disregarding the fact whether your schema is properly written or not. It would be the xml that the properly made schema is incapable of validating. This is a deduction before even considering the type with xs:enumeration.

So if you want to get help, show the more faithful version of the schema and the xml message you actually use,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!