axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r312879 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2: databinding/schema/SchemaCompiler.java wsdl/codegen/extension/Axis2DatabindingExtension.java wsdl/codegen/extension/SimpleDBExtension.java
Date Tue, 11 Oct 2005 13:44:00 GMT
Author: ajith
Date: Tue Oct 11 06:43:49 2005
New Revision: 312879

URL: http://svn.apache.org/viewcvs?rev=312879&view=rev
Log:
slightly modified the SimpleDBExtension to suit the current code. Now the simple DBExtension
works for a very limited set of WSDL's. However feeding the namespace map to the schema compiler
is absolutely needed to make it work

Removed:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/Axis2DatabindingExtension.java
Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java?rev=312879&r1=312878&r2=312879&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
Tue Oct 11 06:43:49 2005
@@ -32,6 +32,10 @@
     private Map baseSchemaTypeMap = TypeMap.getTypeMap();
 
 
+    public HashMap getProcessedElementmap() {
+        return processedElementmap;
+    }
+
     /**
      *
      * @param options

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java?rev=312879&r1=312878&r2=312879&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
Tue Oct 11 06:43:49 2005
@@ -29,6 +29,7 @@
 import org.apache.wsdl.extensions.Schema;
 import org.w3c.dom.Element;
 
+import javax.xml.namespace.QName;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -62,6 +63,7 @@
                 extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
 
                 XmlSchemaCollection schemaColl = new XmlSchemaCollection();
+                //add the namespace map here. it is absolutely needed
                 Schema schema = null;
 
                 if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
@@ -84,13 +86,21 @@
 
                 //call the schema compiler
                 CompilerOptions options = new CompilerOptions().setOutputLocation(configuration.getOutputLocation());
-                new SchemaCompiler(options)
+                SchemaCompiler schemaCompiler = new SchemaCompiler(options);
+                schemaCompiler
                         .compile(xmlSchemaTypeVector);
 
-                //the schema compiler needs to populate a typemap also
-                
                 //create the type mapper
                 JavaTypeMapper mapper = new JavaTypeMapper();
+                //get the processed element map and transfer it to the type mapper
+                Map processedMap = schemaCompiler.getProcessedElementmap();
+                Iterator keys = processedMap.keySet().iterator();
+                QName key;
+                while (keys.hasNext()) {
+                   key =(QName)keys.next();
+                   mapper.addTypeMapping(key,processedMap.get(key));
+                }
+
                 //set the type mapper to the config
                 configuration.setTypeMapper(mapper);
 



Mime
View raw message