diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-08 20:23:35 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-08 20:23:35 +0000 |
commit | e0f7d1e48167a61f45d0186e2684da12814ad7cb (patch) | |
tree | 1c729716eb5a9841ecd2c850f835234455b41436 /branches/sca-java-1.3/modules/binding-ws-wsdlgen | |
parent | 2aa685b8d6e2df02422b9abd98622276a88e2cf6 (diff) |
Merge the changes from trunk for TUSCANY-2465
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@674938 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.3/modules/binding-ws-wsdlgen')
-rw-r--r-- | branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java b/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java index d1f22ec9be..624dcadb0f 100644 --- a/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java +++ b/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java @@ -152,7 +152,7 @@ public class Interface2WSDLGenerator { throw new WSDLGenerationException(problem.toString(), null, problem); } - private void addDataType(Map<String, List<DataType>> map, DataType type) { + private void addDataType(Map<XMLTypeHelper, List<DataType>> map, DataType type, Map<String, XMLTypeHelper> helpers) { if (type == null) { return; } @@ -164,33 +164,34 @@ public class Interface2WSDLGenerator { DataType dt = (DataType)type.getLogical(); db = dt.getDataBinding(); } - List<DataType> types = map.get(db); + XMLTypeHelper helper = helpers.get(db); + List<DataType> types = map.get(helper); if (types == null) { types = new ArrayList<DataType>(); - map.put(db, types); + map.put(helper, types); } types.add(type); } - private Map<String, List<DataType>> getDataTypes(Interface intf, boolean useWrapper) { - Map<String, List<DataType>> dataTypes = new HashMap<String, List<DataType>>(); + private Map<XMLTypeHelper, List<DataType>> getDataTypes(Interface intf, boolean useWrapper, Map<String, XMLTypeHelper> helpers) { + Map<XMLTypeHelper, List<DataType>> dataTypes = new HashMap<XMLTypeHelper, List<DataType>>(); for (Operation op : intf.getOperations()) { WrapperInfo wrapper = op.getWrapper(); if (useWrapper && wrapper != null) { DataType dt1 = wrapper.getInputWrapperType(); - addDataType(dataTypes, dt1); + addDataType(dataTypes, dt1, helpers); DataType dt2 = wrapper.getOutputWrapperType(); - addDataType(dataTypes, dt2); + addDataType(dataTypes, dt2, helpers); } else { for (DataType dt1 : op.getInputType().getLogical()) { - addDataType(dataTypes, dt1); + addDataType(dataTypes, dt1, helpers); } DataType dt2 = op.getOutputType(); - addDataType(dataTypes, dt2); + addDataType(dataTypes, dt2, helpers); } for (DataType<DataType> dt3 : op.getFaultTypes()) { DataType dt4 = dt3.getLogical(); - addDataType(dataTypes, dt4); + addDataType(dataTypes, dt4, helpers); } } return dataTypes; @@ -244,8 +245,8 @@ public class Interface2WSDLGenerator { // call each helper in turn to populate the wsdl.types element XmlSchemaCollection schemaCollection = new XmlSchemaCollection(); - for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) { - XMLTypeHelper helper = helpers.get(en.getKey()); + for (Map.Entry<XMLTypeHelper, List<DataType>> en: getDataTypes(interfaze, false, helpers).entrySet()) { + XMLTypeHelper helper = en.getKey(); if (helper == null) { continue; } |