Ask a Question

[Resolved] Schema validation fails for MockService

TimHurkmans
Not applicable

[Resolved] Schema validation fails for MockService

I have created a MockService in soapUI 4.0.1 (and 4.5), based on an existing WSDL. Now that I'm connecting to this webservice through my application, it errors on the following line:

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?
3 REPLIES 3
bhamail
New Contributor

Did you ever find a cause/solution for this problem? I'm seeing the same sort of url being generated by SoapUI for my mock service:


schemaLocation="mockMyServicePortBinding?WSDL&interface=MyServicePortBinding&part=myservice.xsd"


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.
bhamail
New Contributor

I am having a similar problem.

My workaround was to use double escapes in the pom.xml property that specified my schemaLocation="" value. For example, instead of:
&amp;


I used:
&amp;amp;


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.

cancel
Showing results for 
Search instead for 
Did you mean: