Validating xml schema java
Another option is to return/accept a JAXBElement directly from/in a given method.Another option is to register one or more JAX-RS Context Resolver providers capable of creating JAXBContexts for a number of different types.
For example: Alternatively to using @Xml Root Element and Collection wrappers, one can provide an Object factory which will tell JAXB how to marshal a given type (in case of Collections - its template type).The default JAXB provider can be configured in a number of ways.For example, here's how to set up marshall properties : Individual marshal properties can be injected as simple properties. JAXB_SCHEMA_LOCATION can be injected as "schema Location" property.Following code returns a Customer object that is marshaled to JSON format:" deserialized into a bean by using a "wrapper Name" JSONProvider property with a value like "list" which identifies a bean field and an "in Append Map" property with a name of the bean (ex, "book") being appended before the "list", thus effectively turning the original JSON sequence into "".
Starting from CXF 2.6.0 it is possible to control the depth of large XML and JSON payloads on the per-endpoint basis in order to limit the risk of the denial of service attacks.APPLICATION_JSON) public Response add Book(@Context final Uri Info uri Info, Json Object obj) The Jsr Jsonp Provider provider could be used on server side or on a client side.