You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by am...@apache.org on 2006/12/18 06:03:23 UTC

svn commit: r488122 - /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java

Author: amilas
Date: Sun Dec 17 21:03:22 2006
New Revision: 488122

URL: http://svn.apache.org/viewvc?view=rev&rev=488122
Log:
applied the patch for issue AXIS2_1881.

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java?view=diff&rev=488122&r1=488121&r2=488122
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java Sun Dec 17 21:03:22 2006
@@ -116,7 +116,6 @@
     }
 
 
-
     /**
      * Writes the Skel.
      *
@@ -499,7 +498,6 @@
         addAttribute(doc, "type", typeMappingStr, paramElement);
         addAttribute(doc, "caps-type", typeMappingStr.toUpperCase(), paramElement);
 
-
         //adds the short type
         addShortType(paramElement,paramType);
 
@@ -557,74 +555,79 @@
         return paramElement;  //*/
     }
     /**
-         * @param doc
-         * @param operation
-         * @param param
-         */
-        protected void addCSpecifcAttributes(Document doc, AxisOperation operation, Element param) {
-            String typeMappingStr;
-            Map typeMap = CTypeInfo.getTypeMap();
-            Iterator typeMapIterator = typeMap.keySet().iterator();
-
-            AxisMessage message = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-            QName typeMapping = message.getElementQName();
-
-            String paramType = this.mapper.getTypeMappingName(message.getElementQName());
-            if (doc == null || paramType == null || param == null) {
-                return;
-            }
+     * @param doc
+     * @param operation
+     * @param param
+     */
+    protected void addCSpecifcAttributes(Document doc, AxisOperation operation, Element param, String messageType) {
+        String typeMappingStr;
+        Map typeMap = CTypeInfo.getTypeMap();
+        Iterator typeMapIterator = typeMap.keySet().iterator();
+        AxisMessage message;
 
-            if (message != null) {
-                String type = this.mapper.getTypeMappingName(message.getElementQName());
-                typeMappingStr = (type == null)
-                        ? ""
-                        : type;
-            } else {
-                 typeMappingStr = "";
-            }
+        if (messageType.equals(WSDLConstants.MESSAGE_LABEL_IN_VALUE))
+            message = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+        else
+            message = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
 
-            addAttribute(doc, "caps-type", paramType.toUpperCase(), param);
-            boolean isOurs = true;
-            while (typeMapIterator.hasNext()) {
-                if (typeMapIterator.next().equals(typeMapping)) {
-                    isOurs = false;
-                    break;
-                }
-            }
+        QName typeMapping = message.getElementQName();
 
-            if (isOurs && !paramType.equals("") && !paramType.equals("void") &&
-                    !paramType.equals("org.apache.axiom.om.OMElement") &&
-                    !typeMappingStr.equals(C_DEFAULT_TYPE)) {
-                addAttribute(doc, "ours", "yes", param);
-            }
+        String paramType = this.mapper.getTypeMappingName(message.getElementQName());
+        if (doc == null || paramType == null || param == null) {
+            return;
         }
 
-        /**
-         * @param doc
-         * @param operation
-         * @return Returns the parameter element.
-         */
-        protected Element[] getInputParamElement(Document doc, AxisOperation operation) {
-            Element[] param = super.getInputParamElement(doc, operation);
-            for (int i = 0; i < param.length; i++) {
-                addCSpecifcAttributes(doc, operation, param[i]);
-            }
+        if (message != null) {
+            String type = this.mapper.getTypeMappingName(message.getElementQName());
+            typeMappingStr = (type == null)
+                    ? ""
+                    : type;
+        } else {
+            typeMappingStr = "";
+        }
 
-            return param;
+        addAttribute(doc, "caps-type", paramType.toUpperCase(), param);
+        boolean isOurs = true;
+        while (typeMapIterator.hasNext()) {
+            if (typeMapIterator.next().equals(typeMapping)) {
+                isOurs = false;
+                break;
+            }
         }
 
-        /**
-         * @param doc
-         * @param operation
-         * @return Returns Element.
-         */
-        protected Element getOutputParamElement(Document doc, AxisOperation operation) {
-            Element param = super.getOutputParamElement(doc, operation);
-            addCSpecifcAttributes(doc, operation, param);
+        if (isOurs && !paramType.equals("") && !paramType.equals("void") &&
+                !paramType.equals("org.apache.axiom.om.OMElement") &&
+                !typeMappingStr.equals(C_DEFAULT_TYPE)) {
+            addAttribute(doc, "ours", "yes", param);
+        }
+    }
 
-            return param;
+    /**
+     * @param doc
+     * @param operation
+     * @return Returns the parameter element.
+     */
+    protected Element[] getInputParamElement(Document doc, AxisOperation operation) {
+        Element[] param = super.getInputParamElement(doc, operation);
+        for (int i = 0; i < param.length; i++) {
+            addCSpecifcAttributes(doc, operation, param[i], WSDLConstants.MESSAGE_LABEL_IN_VALUE);
         }
-    
+
+        return param;
+    }
+
+    /**
+     * @param doc
+     * @param operation
+     * @return Returns Element.
+     */
+    protected Element getOutputParamElement(Document doc, AxisOperation operation) {
+        Element param = super.getOutputParamElement(doc, operation);
+        addCSpecifcAttributes(doc, operation, param, WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+
+        return param;
+    }
+
     /**
      * Gets the output directory for source files.
      *



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org