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 2007/06/20 22:52:56 UTC

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

Author: amilas
Date: Wed Jun 20 13:52:55 2007
New Revision: 549229

URL: http://svn.apache.org/viewvc?view=rev&rev=549229
Log:
apply the patch AXIS2-2810

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

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=549229&r1=549228&r2=549229
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Wed Jun 20 13:52:55 2007
@@ -65,6 +65,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.StringWriter;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -2126,6 +2127,11 @@
         addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(messageExchangePattern) + "",
                 methodElement);
         addAttribute(doc, "mepURI", messageExchangePattern, methodElement);
+        Parameter wsdl2StyleParameter = axisOperation.getParameter(WSDL2Constants.OPERATION_STYLE);
+        if (wsdl2StyleParameter != null) {
+        	// provide WSDL2 styles to allow templates to take advantage of them, if desired 
+            addAttribute(doc, "wsdl2Styles", arrayToString((URI[])wsdl2StyleParameter.getValue()), methodElement);
+        }
 
         // check for this operation to be handled directly by databinding code generation
         Parameter dbmethname = axisOperation.getParameter(Constants.DATABINDING_GENERATED_RECEIVER);
@@ -2295,6 +2301,28 @@
 
         }
         return methodElement;
+    }
+
+    /**
+     * Returns a comma-separated list of the string representations of the array elements.
+     * @param array the array to be processed
+     * @return the empty string "" if array is null or empty, the array element if size is 1,
+     * or a comma-separated list when size > 1.
+     */
+    private String arrayToString(Object[] array) {
+    	if (array == null || array.length == 0) {
+    		return "";
+    	}
+    	int size = array.length;
+    	if (size == 1) {
+    		return String.valueOf(array[0]);
+    	}
+    	StringBuffer result = new StringBuffer(String.valueOf(array[0]));
+    	for (int i=1; i<size; i++) {
+    		result.append(",");
+    		result.append(String.valueOf(array[i]));
+    	}
+    	return result.toString();
     }
 
     /**



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