CXF and validation - schema restrictions are ignored

I was working on a CXF web service and had some problems . With the help of SO, I have my service, checking for a rather complex scheme - the requirement of the project. However, I noticed some strange validation problems.

While data types are checked, for example, a random alphanumeric string is captured instead of a date and returned as limits on the length of the SOAP error and patterns. If the string xs: has a maximum length of 20 sets, and I enter 25 'a, the service is happy to oblige.

I am using 2.2.7-SNAPSHOT. I am stuck in a non-release due to another problem in 2.2.6 that images images. Does anyone have any ideas? I added more information about the project on other issues, but let me know if the configuration files or the output will help.

+4
source share
1 answer

We talked to IRC, but for the record, the solution is to provide the wsdlLocation attribute on the jaxws: end endpoint to get the original wsdl (and therefore the schema). Without this, it checks the schema that jaxb will generate from the classes. Since JAXB does not record face lengths, etc., they will be "lost" and therefore will not be checked.

+4
source

Source: https://habr.com/ru/post/1300789/


All Articles