I'm writing an EJB as a contract first SOAP service and I generate the java classes and SEI from the WSDL. The WSDL specifies several types with constraints (max length, pattern, etc). The generated java classes are JAXB annotated but lack the contraints metadata because the JAXB annotations don't support those. This means that input validation only occurs when the service is called through the SOAP endpoint.
The problem is that when the EJB is called by another EJB the validation is bypassed since it is located in the XML stack. I would like to disable XML Schemavalidation and use Bean Validation instead so validation works for both ways (SOAP and RMI) of calling the EJB.
Question: How can I generate not only JAXB annotations but also Bean Validation annotations on the Java classes?
You can generate Bean Validation annotations from xsd using this plugin https://github.com/krasa/krasa-jaxb-tools