axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r265016 - in /webservices/axis2/trunk/java/modules/wsdl: src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
Date Wed, 31 Aug 2005 11:18:53 GMT
Author: ajith
Date: Wed Aug 31 04:18:35 2005
New Revision: 265016

URL: http://svn.apache.org/viewcvs?rev=265016&view=rev
Log:
Modified MultiLanguageClientEmitter to fix a repeating element issue

Modified:
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
    webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=265016&r1=265015&r2=265016&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
Wed Aug 31 04:18:35 2005
@@ -983,21 +983,29 @@
                 "namespace",
                 operation.getName().getNamespaceURI(),
                 rootElement);
+
+        //Add the parameters to a map with their type as the key
+        //this step is needed to remove repetitions
+        Map parameterMap = new HashMap();
         Element inputParamElement = getInputParamElement(doc, operation);
         if (inputParamElement!=null){
-            rootElement.appendChild(inputParamElement);
+            parameterMap.put(inputParamElement.getAttribute("type"),inputParamElement);
         }
+
         Element outputParamElement = getOutputParamElement(doc, operation);
         if (outputParamElement!=null){
-            rootElement.appendChild(outputParamElement);
+            parameterMap.put(outputParamElement.getAttribute("type"),outputParamElement);
         }
+        Element newChild;
 
         if (bindingOperation!=null) {
             List headerParameterQNameList= new ArrayList();
             addHeaderOperations(headerParameterQNameList,bindingOperation,true);
             List parameterElementList = getParameterElementList(doc,headerParameterQNameList,
"header");
+
             for (int i = 0; i < parameterElementList.size(); i++) {
-                rootElement.appendChild((Element)parameterElementList.get(i));
+                newChild = (Element) parameterElementList.get(i);
+                parameterMap.put(newChild.getAttribute("type"),newChild);
             }
 
             headerParameterQNameList.clear();
@@ -1005,10 +1013,17 @@
             addHeaderOperations(headerParameterQNameList,bindingOperation,false);
             parameterElementList = getParameterElementList(doc,headerParameterQNameList,
"header");
             for (int i = 0; i < parameterElementList.size(); i++) {
-                rootElement.appendChild((Element)parameterElementList.get(i));
+                 newChild = (Element) parameterElementList.get(i);
+                parameterMap.put(newChild.getAttribute("type"),newChild);
             }
         }
 
+        //Now run through the parameters and ad them to the root element
+        Collection parameters = parameterMap.values();
+        for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
+           rootElement.appendChild((Element)iterator.next());
+        }
+
         doc.appendChild(rootElement);
         return doc;
     }
@@ -1072,7 +1087,7 @@
             while (iterator.hasNext()) {
                 WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator.next();
                 if (ExtensionConstants.SOAP_11_ADDRESS.equals(element.getType()) ||
-                     ExtensionConstants.SOAP_12_ADDRESS.equals(element.getType())){
+                        ExtensionConstants.SOAP_12_ADDRESS.equals(element.getType())){
                     address = (org.apache.wsdl.extensions.SOAPAddress) element;
                 }
             }

Modified: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java?rev=265016&r1=265015&r2=265016&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
Wed Aug 31 04:18:35 2005
@@ -173,7 +173,7 @@
         //todo - Still the compilation fails (the original problem of the java.home was settled
by setting fork
         //todo - to true). Now the compiler fails for some unknown reason (inside maven!
works fine in the IDE though)
 
-        //compile(outputLocation);
+//        compile(outputLocation);
     }
 
     /**



Mime
View raw message