Sunday 15 May 2011

java - CXF - Json schema validation -



java - CXF - Json schema validation -

i think first question should inquire - possible validate json payload xsd? illustration given cxf using xsd, anyway.

i follow instruction cxf - http://cxf.apache.org/docs/jax-rs-data-bindings.html#jax-rsdatabindings-schemavalidation

(1) @ first complains

"cvc-elt.1: cannot find declaration of element 'osdcreateappointmentrequest'"

(2) prepare that, suggestion add together name space json object, since there no "namespace" concept json xsd has that

(3) add together name space json object follows

<property name="intransformelements"> <map> <entry key="osdcreateappointmentrequest" value="{http://www.w3.org/2001/xmlschema}osdcreateappointmentrequest"/> </map> </property>

now complains

cvc-elt.1: cannot find declaration of element 'ps1:osdcreateappointmentrequest'

well "ps1" looks namespace prefix, no thought comes from.

any suggestions? experience on highly appreciated!

w3c xml schemas (xsd) can used validate xml files.

json not xml. so, no xml technologies applicable json (at least, without conversions corresponding xml). is, xsd cannot used validate json.

instead, json has own schemas (written in json, of course), see: http://json-schema.org

java xml json web-services xsd

No comments:

Post a Comment