Question

This is the XSD I am trying to make from a WSDL File: Why exactly I want to do this? I want to extract inline schemas from the WSDL and put them in an XSD file, Next I will capture the Request XML Payload and then use my XSD Validation code to validate the Request XML against this XSD. Before my Validation step, this fails due to the parsing exception mentioned below:

Getting an exception at Line 2,3

Detailed Exception:

Exception: Element or attribute do not match QName production: QName::=(NCName':')?NCName. 
    org.xml.sax.SAXParseException; systemId: file:/D:/Test3/Inline_xsd.xsd; lineNumber: 3; columnNumber: 23; Element or attribute do not match QName production: QName::=(NCName':')?NCName. 
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.scanQName(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
        at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
        at org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
        at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:591)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:607)
        a

Pardon me for posting only the necessary part of the XSD.

Was it helpful?

Solution

You're missing the actual name of the special prefix declaration attribute.

xmlns:= should be xmlns:something= (right after the version attribute)

I would remove this wrongfully constructed attribute; it seems this alias is not needed in your XSD, since it points to the WSDL namespace.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top