[Resolved] Schema validation fails for MockService
SchemaValidationFeature feature = new SchemaValidationFeature();
WSInterface connection = cdctService.getWSPort(feature);
I'm getting the following error:
org.xml.sax.SAXParseException: The reference to entity "interface" must end with the ';' delimiter.
After some searching, I found that the generated WSDL of the MockService contains these lines:
<xsd:import namespace="http://schemas.company.com/Messages/ServiceRequest-v0103" schemaLocation="/MockService?WSDL&interface=WS-Binding&part=ServiceRequest-v0103-b00.xsd" />
Now the keen eyes sees that it contains &interface=, where & should be & amp;. I did not generate this, soapUI does and the original WSDL does not have this either. How can I make soapUI generate a proper WSDL? Or what am I doing wrong?
and I'm getting a parsing error when trying to generate a client from the wsdl (using axis2-wsdl2code-maven-plugin:1.6.1):
[Fatal Error] myservice.wsdl:5:73: The reference to entity "interface" must end with the ';' delimiter.
org.xml.sax.SAXParseException; systemId: file:/.../target/classes/myservice.wsdl; lineNumber: 5; columnNumber: 73; The reference to entity "interface" must end with the ';' delimiter.
My workaround was to use double escapes in the pom.xml property that specified my schemaLocation="" value. For example, instead of:
This allowed a filtered wsdl file to work with axis2 (1.6.1) wsdl2code.
Has anyone found a solution that does not involve pom.xml? We do not use that. The xsd:import statement in our wsdl does not contain any ampersands. SoapUI is rewriting the import specified in the wsdl and adding the unescaped ampersand. This worked fine with Java 6. We noticed the SaxParseException only after upgrading to Java 7 with the same version of SoapUI.