[
https://issues.apache.org/jira/browse/AXIS2-3048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001367#comment-13001367
]
Massimo Franzoni commented on AXIS2-3048:
-----------------------------------------
I have a similar problem: Axis1.5.4
wsdl2java fails with this error:
Caused by: org.apache.xmlbeans.XmlException: error: Imported schema has a
target namespace "http://www.test.com/xmlmanager/dapr4" that does not match the
specified "http://www.test.com/xmlmanager/apr4"
[java] at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
if I change "http://www.test.com/xmlmanager/dapr4" to
"http://www.test.com/xmlmanager/aaa" in the files everything works fine.
So I think there is a ".endsWith(...)" problem with namespaces.
the xsd that includes the other one:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:apr4="http://www.test.com/xmlmanager/apr4"
xmlns:dapr4="http://www.test.com/xmlmanager/dapr4"
targetNamespace="http://www.test.com/xmlmanager/apr4"
elementFormDefault="qualified" attributeFormDefault="unqualified" >
<import namespace="http://www.test.com/xmlmanager/dapr4"
schemaLocation="DettAPR4.xsd" />
the xsd included:
<schema targetNamespace="http://istatel.ancitel.it/xmlmanager/dapr4"
xmlns:dapr4="http://istatel.ancitel.it/xmlmanager/dapr4"
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified">
Generating beans directly with xmlbeans works fine with both.
> 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: 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.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]