Set unique system id onto the in-memory DOMs representing XSDs to avoid conflicts as reported by TUSCANY-2465
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@675013 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
360d827ce6
commit
78c0e27338
1 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
||||||
package org.apache.tuscany.sca.binding.ws.wsdlgen;
|
package org.apache.tuscany.sca.binding.ws.wsdlgen;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -266,6 +267,7 @@ public class Interface2WSDLGenerator {
|
||||||
// generate schema elements for wrappers that aren't defined in the schemas
|
// generate schema elements for wrappers that aren't defined in the schemas
|
||||||
if (wrappers.size() > 0) {
|
if (wrappers.size() > 0) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
int index = 0;
|
||||||
Map<String, XSDefinition> wrapperXSDs = new HashMap<String, XSDefinition>();
|
Map<String, XSDefinition> wrapperXSDs = new HashMap<String, XSDefinition>();
|
||||||
Map<Element, Map<String, String>> prefixMaps = new HashMap<Element, Map<String, String>>();
|
Map<Element, Map<String, String>> prefixMaps = new HashMap<Element, Map<String, String>>();
|
||||||
for (Map.Entry<QName, List<ElementInfo>> entry: wrappers.entrySet()) {
|
for (Map.Entry<QName, List<ElementInfo>> entry: wrappers.entrySet()) {
|
||||||
|
@ -292,6 +294,9 @@ public class Interface2WSDLGenerator {
|
||||||
xsDef.setUnresolved(true);
|
xsDef.setUnresolved(true);
|
||||||
xsDef.setNamespace(targetNS);
|
xsDef.setNamespace(targetNS);
|
||||||
xsDef.setDocument(schemaDoc);
|
xsDef.setDocument(schemaDoc);
|
||||||
|
// TUSCANY-2465: Set the system id to avoid schema conflict
|
||||||
|
xsDef.setLocation(URI.create("xsd_" + index + ".xsd"));
|
||||||
|
index++;
|
||||||
wrapperXSDs.put(targetNS, xsDef);
|
wrapperXSDs.put(targetNS, xsDef);
|
||||||
}
|
}
|
||||||
Element wrapper = schemaDoc.createElementNS(SCHEMA_NS, "xs:element");
|
Element wrapper = schemaDoc.createElementNS(SCHEMA_NS, "xs:element");
|
||||||
|
|
Loading…
Add table
Reference in a new issue