[
https://issues.apache.org/jira/browse/AXIS2-3048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761106#action_12761106
]
Amila Chinthaka Suriarachchi commented on AXIS2-3048:
-----------------------------------------------------
commited a fix with revision 820534.
added this fix. please have a look
// if source uri does not contain any / then it should match
// with the final part of the system ID
if (schema.getSourceURI().indexOf("/") == -1){
String systemIDFinalPath =
systemId.substring(systemId.indexOf("/") + 1);
if
(!systemIDFinalPath.equals(schema.getSourceURI())){
continue;
}
}
> wsdl2java exception with xmlbeans bindings - Imported schema has a target
> namespace that does not match the specified
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-3048
> URL: https://issues.apache.org/jira/browse/AXIS2-3048
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.2
> Reporter: Michael Mattox
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
>
> When using the ANT task & Eclipse plugin for wsdl2java, I get this exception:
> Caused by: org.apache.xmlbeans.XmlException:
> D:\projects\MediaMetrie\projects\pam\workspace\MEDIAMAT2-ADM-SERVICE-WEBSERVICE\AdminProduction.xsd:2:1:
> error: Imported schema has a target namespace
> "http://www.mediametrie.fr/mediamat2/operation/production/definitions/v1"
> that does not match the specified
> "http://www.mediametrie.fr/mediamat2/gisement/production/v1"
> at
> org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
> at
> org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:174)
> ... 23 more
> I have verified my xsd with XML spy & Eclipse WTP and they are valid:
> The xsd that includes the other one:
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:tns="http://www.mediametrie.fr/mediamat2/operation/production/definitions/v1"
> xmlns:pref="http://www.mediametrie.fr/mediamat2/gisement/production/v1"
> xmlns:adm="http://www.mediametrie.fr/mediamat2/gisement/commons/v1"
> targetNamespace="http://www.mediametrie.fr/mediamat2/operation/production/definitions/v1"
> elementFormDefault="qualified">
> <import
> namespace="http://www.mediametrie.fr/mediamat2/gisement/production/v1"
> schemaLocation="Production.xsd"/>
> The xsd being included:
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:tns="http://www.mediametrie.fr/mediamat2/gisement/production/v1"
> xmlns:Q1="http://www.mediametrie.fr/mediamat2/gisement/commons/v1"
> targetNamespace="http://www.mediametrie.fr/mediamat2/gisement/production/v1"
> elementFormDefault="qualified">
> If I change the namespace in the including xsd to anything else, my xsd
> doesn't validate.
> Now here is where it gets interesting, I can generate the xmlbeans classes
> using the xmlbeans ANT task without any errors. So I think this has
> something to do with axis2. When I search for the message on google, I find
> the source code for xmlbeans:
> http://jsourcery.com/output/apache/xml/xmlbeans/1.0.3/org/apache/xmlbeans/impl/schema/StscImporter.source.html
> look in the method public SchemaToProcess[] resolveImportsAndIncludes()
> I put this as critical because we can't generate any server files. If there
> is a way to not generate the xmlbeans classes, this would be a suitable
> workaround for me and we can lower the priority. I have a jar of my xmlbeans
> classes but I don't know how to tell wsdl2java to not generate them.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.