views:

411

answers:

1

Hey guys,

I've been working on a CXF web service and have had some trouble. With the help of SO, I've got my service validating against a fairly complex schema- a requirement of the project. I've noticed some weird issues with the validation, however.

While datatypes are validated- eg, a random alphanumeric string instead of a date is caught and returned as a SOAP fault- length and pattern restrictions aren't. If an xs:string has a maxLength of 20 set, and I enter 25 'a's, the service is happy to oblige.

I'm using 2.2.7-SNAPSHOT- I'm stuck with a non-release because of another issue in 2.2.6 that the snapshot addresses. Anyone have any ideas? I've posted more details on the project in my other questions, but let me know if config files or output would help.

+1  A: 

We chatted on IRC, but for recording purposes, the solution is to provide a wsdlLocation attribute on the jaxws:endpoint so that the original wsdl (and thus schemas) get picked up. Without that, it's validating against the schema that jaxb would generate from the classes. Since JAXB doesn't record the lenght facets and such, those would be "lost" and thus wouldn't be validated.

Daniel Kulp