From 2aa685b8d6e2df02422b9abd98622276a88e2cf6 Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 8 Jul 2008 20:05:06 +0000 Subject: Fix for TUSCANY-2465 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@674933 13f79535-47bb-0310-9956-ffa450edef68 --- .../ws/wsdlgen/Interface2WSDLGenerator.java | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'java/sca/modules') diff --git a/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java b/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java index d1f22ec9be..624dcadb0f 100644 --- a/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java +++ b/java/sca/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> map, DataType type) { + private void addDataType(Map> map, DataType type, Map helpers) { if (type == null) { return; } @@ -164,33 +164,34 @@ public class Interface2WSDLGenerator { DataType dt = (DataType)type.getLogical(); db = dt.getDataBinding(); } - List types = map.get(db); + XMLTypeHelper helper = helpers.get(db); + List types = map.get(helper); if (types == null) { types = new ArrayList(); - map.put(db, types); + map.put(helper, types); } types.add(type); } - private Map> getDataTypes(Interface intf, boolean useWrapper) { - Map> dataTypes = new HashMap>(); + private Map> getDataTypes(Interface intf, boolean useWrapper, Map helpers) { + Map> dataTypes = new HashMap>(); 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 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> en: getDataTypes(interfaze, false).entrySet()) { - XMLTypeHelper helper = helpers.get(en.getKey()); + for (Map.Entry> en: getDataTypes(interfaze, false, helpers).entrySet()) { + XMLTypeHelper helper = en.getKey(); if (helper == null) { continue; } -- cgit v1.2.3