You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by am...@apache.org on 2011/08/18 11:23:46 UTC

svn commit: r1159110 - in /axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema: ExtensionUtility.java SchemaCompiler.java

Author: amilas
Date: Thu Aug 18 09:23:46 2011
New Revision: 1159110

URL: http://svn.apache.org/viewvc?rev=1159110&view=rev
Log:
adding back the processed types since some meta data is required for -uw option

Modified:
    axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
    axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

Modified: axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java?rev=1159110&r1=1159109&r2=1159110&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java Thu Aug 18 09:23:46 2011
@@ -146,6 +146,26 @@ public class ExtensionUtility {
 
         }
 
+        //replace the Axis2 schemas with the processed ones.
+        //otherwise it gives some problems if we try to code generate with multiple
+        //services with the -uw option.
+        //inorder to work for -uw option there must be some metadata with the schema list
+
+        Map<String, XmlSchema> loadedSchemaMap = schemaCompiler.getLoadedSchemaMap();
+        for (AxisService service : configuration.getAxisServices()) {
+            List<XmlSchema> serviceSchemaList = service.getSchema();
+            List<XmlSchema> schemaListToAdd = new ArrayList<XmlSchema>();
+            for (XmlSchema xmlSchema : serviceSchemaList){
+                if (loadedSchemaMap.containsKey(xmlSchema.getTargetNamespace())){
+                    schemaListToAdd.add(loadedSchemaMap.get(xmlSchema.getTargetNamespace()));
+                } else {
+                    schemaListToAdd.add(xmlSchema);
+                }
+            }
+            service.releaseSchemaList();
+            service.addSchema(schemaListToAdd);
+        }
+
         //process the unwrapped parameters
         if (!configuration.isParametersWrapped()) {
             //figure out the unwrapped operations

Modified: axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=1159110&r1=1159109&r2=1159110&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Thu Aug 18 09:23:46 2011
@@ -2809,4 +2809,8 @@ public class SchemaCompiler {
         }
        return isExists;
     }
+
+    public Map<String, XmlSchema> getLoadedSchemaMap(){
+        return this.loadedSchemaMap;
+    }
 }