I have a RESTful service that has a single path parameter and a parameter that is unmarshalled from the request body. The request body parameter is XML for which I have an XSD. I've been trying to validate the XML payload against the XSD but to no avail. I've tried the following, as described here:
<jaxrs:server address="/"
serviceClass="my.endpoint.class">
<jaxrs:schemaLocations>
<jaxrs:schemaLocation>classpath:schema/myschema.xsd</jaxrs:schemaLocation>
</jaxrs:schemaLocations>
</jaxrs:server>
The schemas are being found (there are no errors at least) but what I expect to be an invalid payload is not throwing an exception. Parameters that don't match the XSD contents are coming through as null. It may not be relevant but my auto-generated payload class has three attributes, some of which are required.
I've had a brief go at creating a MessageBodyReader, as described here but I think I'm having scope issues and my schema object is not available when readFrom is called.
Any help or suggestions would be gratefully appreciated!