You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2006/11/29 03:26:15 UTC

svn commit: r480337 - in /webservices/axis2/branches/java/1_1/modules: adb-codegen/src/org/apache/axis2/schema/ adb-codegen/src/org/apache/axis2/schema/writer/ codegen/src/org/apache/axis2/wsdl/codegen/ codegen/src/org/apache/axis2/wsdl/util/ kernel/sr...

Author: dims
Date: Tue Nov 28 18:26:14 2006
New Revision: 480337

URL: http://svn.apache.org/viewvc?view=rev&rev=480337
Log:
Fix for AXIS2-1784 - [ADB] Suppress prefixes in the soap request/response for performance

Modified:
    webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java
    webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
    webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
    webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
    webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
    webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java

Modified: webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java?view=diff&rev=480337&r1=480336&r2=480337
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java (original)
+++ webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java Tue Nov 28 18:26:14 2006
@@ -168,4 +168,17 @@
 	public void setBackwordCompatibilityMode(boolean backwordCompatibilityMode) {
 		this.backwordCompatibilityMode = backwordCompatibilityMode;
 	}
+
+    /**
+     * Should we suppress namespace prefixes
+     */
+    private boolean suppressPrefixesMode = false;
+
+    public boolean isSuppressPrefixesMode() {
+        return suppressPrefixesMode;
+    }
+
+    public void setSuppressPrefixesMode(boolean suppressPrefixesMode) {
+        this.suppressPrefixesMode = suppressPrefixesMode;
+    }
 }

Modified: webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java?view=diff&rev=480337&r1=480336&r2=480337
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java (original)
+++ webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java Tue Nov 28 18:26:14 2006
@@ -426,6 +426,10 @@
         if (configuration.isBackwordCompatibilityMode()) {
             options.setBackwordCompatibilityMode(true);
         }
+
+        if (configuration.isSuppressPrefixesMode()) {
+            options.setSuppressPrefixesMode(true);
+        }
     }
 
 }

Modified: webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?view=diff&rev=480337&r1=480336&r2=480337
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original)
+++ webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Tue Nov 28 18:26:14 2006
@@ -79,6 +79,8 @@
 
     private boolean isHelperMode = false;
 
+    private boolean isSuppressPrefixesMode = false;
+
     /**
      * package for the mapping class
      */
@@ -146,6 +148,9 @@
             this.ns2packageNameMap = options.getNs2PackageMap();
             //set helper mode
             this.isHelperMode = options.isHelperMode();
+            // set suppress prefixes mode
+            this.isSuppressPrefixesMode = options.isSuppressPrefixesMode();
+
             //set mapper class package if present
             if (options.isMapperClassPackagePresent()) {
                 this.mappingClassPackage = options.getMapperClassPackage();
@@ -442,7 +447,7 @@
         XSLTUtils.addAttribute(model, "package", packageName, rootElt);
         XSLTUtils
                 .addAttribute(model, "nsuri", qName.getNamespaceURI(), rootElt);
-        XSLTUtils.addAttribute(model, "nsprefix", getPrefixForURI(qName
+        XSLTUtils.addAttribute(model, "nsprefix", isSuppressPrefixesMode ? "" : getPrefixForURI(qName
                 .getNamespaceURI(), qName.getPrefix()), rootElt);
 
         if (!wrapClasses) {

Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?view=diff&rev=480337&r1=480336&r2=480337
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Tue Nov 28 18:26:14 2006
@@ -469,4 +469,17 @@
 	public void setBackwordCompatibilityMode(boolean backwordCompatibilityMode) {
 		this.backwordCompatibilityMode = backwordCompatibilityMode;
 	}
+
+    /**
+     * Should we suppress namespace prefixes
+     */
+    private boolean suppressPrefixesMode = false;
+
+    public boolean isSuppressPrefixesMode() {
+        return suppressPrefixesMode;
+    }
+
+    public void setSuppressPrefixesMode(boolean suppressPrefixesMode) {
+        this.suppressPrefixesMode = suppressPrefixesMode;
+    }
 }

Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java?view=diff&rev=480337&r1=480336&r2=480337
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java Tue Nov 28 18:26:14 2006
@@ -205,6 +205,14 @@
 			config.setBackwordCompatibilityMode(true);
 		}
 
+        commandLineOption = loadOption(
+                WSDL2JavaConstants.SUPPRESS_PREFIXES_OPTION,
+                WSDL2JavaConstants.SUPPRESS_PREFIXES_OPTION_LONG,
+                optionMap);
+        if (commandLineOption != null) {
+            config.setSuppressPrefixesMode(true);
+        }
+
         // loop through the map and find parameters having the extra prefix.
         //put them in the property map
         Iterator keyIterator = optionMap.keySet().iterator();

Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java?view=diff&rev=480337&r1=480336&r2=480337
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java Tue Nov 28 18:26:14 2006
@@ -53,6 +53,7 @@
                     (WSDL2JavaConstants.FLATTEN_FILES_OPTION).equalsIgnoreCase(optionType) ||
                     (WSDL2JavaConstants.UNWRAP_PARAMETERS).equalsIgnoreCase(optionType) ||
                     (WSDL2JavaConstants.BACKWORD_COMPATIBILITY_OPTION).equalsIgnoreCase(optionType) ||
+                    (WSDL2JavaConstants.SUPPRESS_PREFIXES_OPTION).equalsIgnoreCase(optionType) ||
                     (WSDL2JavaConstants.SOURCE_FOLDER_NAME_OPTION).equalsIgnoreCase(optionType) ||
                     (WSDL2JavaConstants.RESOURCE_FOLDER_OPTION).equalsIgnoreCase(optionType) ||
 
@@ -78,7 +79,8 @@
                     (WSDL2JavaConstants.REPOSITORY_PATH_OPTION_LONG).equalsIgnoreCase(optionType)||
                     (WSDL2JavaConstants.SOURCE_FOLDER_NAME_OPTION_LONG).equalsIgnoreCase(optionType)||
                     (WSDL2JavaConstants.RESOURCE_FOLDER_OPTION_LONG).equalsIgnoreCase(optionType)||
-                    (WSDL2JavaConstants.BACKWORD_COMPATIBILITY_OPTION_LONG).equalsIgnoreCase(optionType)
+                    (WSDL2JavaConstants.BACKWORD_COMPATIBILITY_OPTION_LONG).equalsIgnoreCase(optionType) ||
+                    (WSDL2JavaConstants.SUPPRESS_PREFIXES_OPTION_LONG).equalsIgnoreCase(optionType)
             );
 
         }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java?view=diff&rev=480337&r1=480336&r2=480337
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java (original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java Tue Nov 28 18:26:14 2006
@@ -43,6 +43,7 @@
         String FLATTEN_FILES_OPTION = "f";
         String UNWRAP_PARAMETERS = "uw";
         String BACKWORD_COMPATIBILITY_OPTION = "b";
+        String SUPPRESS_PREFIXES_OPTION = "sp";
         String SOURCE_FOLDER_NAME_OPTION = "S";
         String RESOURCE_FOLDER_OPTION = "R";
 
@@ -68,9 +69,10 @@
         String SERVER_SIDE_INTERFACE_OPTION_LONG = "serverside-interface";
         String EXTERNAL_MAPPING_OPTION_LONG = "external-mapping";
         String WSDL_VERSION_OPTION_LONG = "wsdl-version";
-        String FLATTEN_FILES_OPTION_LONG = "flatten-filess";
+        String FLATTEN_FILES_OPTION_LONG = "flatten-files";
         String UNWRAP_PARAMETERS_LONG = "unwrap-params";
         String BACKWORD_COMPATIBILITY_OPTION_LONG = "backword-compatible";
+        String SUPPRESS_PREFIXES_OPTION_LONG = "suppress-prefixes";
         String SOURCE_FOLDER_NAME_OPTION_LONG = "source-folder";
         String RESOURCE_FOLDER_OPTION_LONG = "resource-folder";
 



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