|
If you're trying to validate the input message part on the
client, the question is where does the client get it? If the part is
generated by serializing a Java stub object that has been produced using
WSDL2Java, presumably such an object should reflect (to whatever extent
WSDL2Java-generated classes embody the constraints imposed by the schema) the
schema's constraints. Then you would only need validation of the
serialized form as a test of the serializer or of the WSDL2Java code generation
quality -- you would not need it in production. If you did not need it in
production, you could snarf up the serialized messages produced by your test
inputs and run them through a separate validator (see the Xerces
documentation).
If the encoding is literal and the input part is some random
DOM Element produced by the client, you certainly might need to validate it
either in the client or server. One way you could do this is to produce a
slightly altered serializer. The serializer would look like whatever
serializer is currently being used (possibly the ElementSerializer), but would
run the Xerces parser on the serialized form first and throw an exception for
invalid input. The serializer for the part would make its own stream,
serialize to that, validate, and then copy to the real serialization stream if
there were no validation errors. (I'm just guessing about
this.)
To use Xerces 2 for validation, you have to set several
features and properties, including a specification of the location of the
schema. See the Features, Properties and XML Schema how-to pages
in the Xerces documents.
Jeff
|
- RE: help - axis and schema validation Tom Jordahl
- RE: help - axis and schema validation Naveen Srinivasa Murthy
- Re: help - axis and schema validation Mehmet Birgi
- Re: help - axis and schema validation Steve Loughran
- wsdl2Java - an observation Naveen Srinivasa Murthy
- RE: wsdl2Java - an observation Alex Huang
- RE: wsdl2Java - an observati... Naveen Srinivasa Murthy
- Re: help - axis and schema validation Steve Loughran
- Jeff Greif
