Hello, I'm trying to implement validation of a WS payload in Axis2.
Messages are expected to follow a know location schema, which includes <xsd:any> (strict) elements. The code I'm using is: <code> XMLStreamReader reader = message.getXMLStreamReader(); OMFactory doomFactory = DOOMAbstractFactory.getOMFactory(); StAXOMBuilder doomBuilder = new StAXOMBuilder(doomFactory, reader); OMElement omElement = doomBuilder.getDocumentElement(); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema xsd = factory.newSchema(); Validator validator = xsd.newValidator(); validator.setResourceResolver(new LSResourceResolverImplementation()); validator.validate(new DOMSource((Element) omElement)); </code> The main schema validation works, since schemaLocation info is included in the payload, but I need to be able to register a set of know schemas that will be considered valid for the <xsd:any> elements, and that will be referenced in the message by the elements namespace (and also supposed to be part of the validation). So I sorted to use a resolver implementation. The issue is that the resolver is never called, and a "cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element" is always thrown. Can anyone shed some light? Thanks, João --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
