Hello,

Say, we have a JAX-RS method like this:

@PUT
@Path("/foo")
@Produces(MediaType.TEXT_XML)
@Consumes(MediaType.TEXT_XML)
public static A create(A a);

In a negative test, I send some XML to this service, which is wrong XML for 
type A. Let's say the XML is of type B. The XML passes the schema validation, 
because of it is valid for type B but this method expects type A and so we get 
a UnmarshalException instead of the SchemaValidationException complaining about 
the wrong element found.

Is it a bug, that the schema validation is not using the schema for type A? It 
looks like it is using the schema, which is responsible for the root element of 
the passed XML if found.

best,


-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische 
Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.


Reply via email to