Hi,

I have a SOAP endpoint and want to validate incoming requests against the
WSDL. The problem is that WSDL imports multiple XSDs using the same
namespace that results with error:

Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the
declaration of element 'TestRQ'.
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source) ~[xercesImpl-2.11.0.jar:?]
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
~[xercesImpl-2.11.0.jar:?]
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source) ~[xercesImpl-2.11.0.jar:?]
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source) ~[xercesImpl-2.11.0.jar:?]
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source) ~[xercesImpl-2.11.0.jar:?]
        at
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source) ~[xercesImpl-2.11.0.jar:?]
        at
org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
~[xercesImpl-2.11.0.jar:?]
        at
org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown
Source) ~[xercesImpl-2.11.0.jar:?]
        at
com.sun.xml.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:101)
~[jaxb-impl-2.2.11.jar:2.2.11]
        at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:246)
~[jaxb-impl-2.2.11.jar:2.2.11]
        at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:180)
~[jaxb-impl-2.2.11.jar:2.2.11]
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415)
~[jaxb-impl-2.2.11.jar:2.2.11]
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:394)
~[jaxb-impl-2.2.11.jar:2.2.11]
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:854)
~[cxf-rt-databinding-jaxb-3.2.1.jar:3.2.1]
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:102)
~[cxf-rt-databinding-jaxb-3.2.1.jar:3.2.1]
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:893)
~[cxf-rt-databinding-jaxb-3.2.1.jar:3.2.1]
        at java.security.AccessController.doPrivileged(Native Method)
~[?:1.8.0_191]
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:891)
~[cxf-rt-databinding-jaxb-3.2.1.jar:3.2.1]
        ... 29 more


This could be fixed by setting the feature "
http://apache.org/xml/features/honour-all-schemaLocations"; (
https://xerces.apache.org/xerces2-j/features.html). Is there a way to set
this feature via CXF (I'm using version 3.2)?

Reply via email to