-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wsdl files fail to load if they contain schemas that have complexType elements with restriction elements that reference built in types #180
Comments
@longsonr can you please attach the WSDL that causes the error here? It will be much easy to locate the error. Thx |
Needs to be fixed in soa-model dependency. We should upgrade soa-model to version 1.5.0 and test if it is also affected by this bug. |
This does not appear to be fixed in 4.0.19. My testcase fails on the 4.0.19 I've just downloaded. |
Strange, just tested using your test.wsdl |
Using the filebin test.wsdl I get this... 14:55:52,161 INFO Router:247 - Starting Membrane Service Proxy 4.0.19 |
It works when you leave the interceptor out. The error is from the SAX parser used for the validation. And maybe the SAX parser is right. Have a careful look at the error message: It was detected that 'anyType' has no namespace, but components with no target namespace are not referenceable from schema document 'file:///Users/bjss/membrane-service-proxy-4.0.19/examples/validation/soap-Proxy/test.wsdl'. If 'anyType' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'anyType' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:///Users/bjss/membrane- |
If I add in an Caused by: com.predic8.soamodel.WrongGrammarException: Expected root element '{http://www.w3.org/2001/XMLSchema}schema' for the schema document but was '{http://schemas.xmlsoap.org/wsdl/}definitions'. if I add Note that anyType is a built in type (http://www.w3.org/TR/xmlschema-0/#anyType) so I don't see why it should need importing in the first place. |
@longsonr I found the bug in the SOA Model and fixed it. Can I add your test.wsdl to the project as a test resource to prevent regression? I will push the changes to the soa-model git as version 1.5.1 and send you a copy of the jar. You can substitute the JAR in the lib folder of Membrane to fix your installation. The next bugfix release of Membrane will contain the fix. |
Feel free to use my testcase in this bug. If you check in the soa-model changes I can build it from https://github.com/membrane/soa-model. |
Implemented support for complexContent/restriction Fixed: membrane/api-gateway#180 SchemaCreator: Added support for complexContent/@mixed Added support for anyType restriction
@longsonr thx for the testcase I added it to the project. The modifications are pushed and taged as 1.5.1 |
fix confirmed |
The presence of a schema containing a complexType element that has a restriction element child with a base of anyType, boolean or string or other built in primitive type causes membrane to fail to start. If the schema is moved to an external file and imported into the wsdl then it works as expected.
Having a restriction element as a child of a simpleType seems to work OK.
Caused by: org.xml.sax.SAXParseException; systemId: file:///membrane-service-proxy-4.0.17/examples/validation/soap-Proxy/test.wsdl; lineNumber: 4; columnNumber: 41; src-resolve.4.1: Error resolving component 'anyType'. It was detected that 'anyType' has no namespace, but components with no target namespace are not referenceable from schema document 'file:///membrane-service-proxy-4.0.17/examples/validation/soap-Proxy/test.wsdl'. If 'anyType' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'anyType' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:///membrane-service-proxy-4.0.17/examples/validation/soap-Proxy/test.wsdl'.
Consider this schema (schema.xsd)
If I embed it into test.wsdl then membrane won't start. If I import it instead it's ok (adjust the data below to uncomment the import and comment the embedded schema to test).
proxies.xml
The text was updated successfully, but these errors were encountered: