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 di...@apache.org on 2006/08/14 19:51:22 UTC

svn commit: r431387 - in /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema: SchemaCompiler.java i18n/resource.properties

Author: dims
Date: Mon Aug 14 10:51:22 2006
New Revision: 431387

URL: http://svn.apache.org/viewvc?rev=431387&view=rev
Log:
fix for AXIS2-1011 - WSDL2Java addMissingQNames Nullpointer (RE: axis2-906)


Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/resource.properties

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=431387&r1=431386&r2=431387&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Mon Aug 14 10:51:22 2006
@@ -710,10 +710,11 @@
     /**
      * Finds a class name from the given Qname
      *
-     * @param schemaType
-     * @return
+     * @param qName
+     * @param isArray
+     * @return FQCN
      */
-    private String findClassName(QName qName, boolean isArray) {
+    private String findClassName(QName qName, boolean isArray) throws SchemaCompilationException {
 
         //find the class name
         String className;
@@ -724,6 +725,10 @@
         } else if (baseSchemaTypeMap.containsKey(qName)) {
             className = (String) baseSchemaTypeMap.get(qName);
         } else {
+            if(isSOAP_ENC(qName.getNamespaceURI())) {
+                throw new SchemaCompilationException(SchemaCompilerMessages.getMessage("schema.soapencoding.error", qName.toString())); 
+                
+            }
             // We seem to have failed in finding a class name for the
             //contained schema type. We better set the default then
             //however it's better if the default can be set through the
@@ -740,7 +745,20 @@
         }
         return className;
     }
-
+    /**
+     * Returns true if SOAP_ENC Namespace.
+     *
+     * @param s a string representing the URI to check
+     * @return true if <code>s</code> matches a SOAP ENCODING namespace URI,
+     *         false otherwise
+     */
+    public static boolean isSOAP_ENC(String s) {
+        if (s.equals(Constants.URI_SOAP11_ENC))
+            return true;
+        if (s.equals(Constants.URI_SOAP12_ENC))
+            return true;
+        return false;
+    }
 
     /**
      * Process a schema element which has been refered to by an element
@@ -1108,7 +1126,7 @@
     * @param extBaseType
     * @param metaInfHolder
     */
-    public void processSimpleExtensionBaseType(QName extBaseType,BeanWriterMetaInfoHolder metaInfHolder) {
+    public void processSimpleExtensionBaseType(QName extBaseType,BeanWriterMetaInfoHolder metaInfHolder) throws SchemaCompilationException {
     	
         //find the class name
         String className = findClassName(extBaseType, false);
@@ -1131,22 +1149,22 @@
      * @param resBaseType
      * @param metaInfHolder
      */
-    public void processSimpleRestrictionBaseType(QName resBaseType,BeanWriterMetaInfoHolder metaInfHolder) {
-    	
+    public void processSimpleRestrictionBaseType(QName resBaseType,BeanWriterMetaInfoHolder metaInfHolder) throws SchemaCompilationException {
+
         //find the class name
         String className = findClassName(resBaseType, false);
 
         //this means the schema type actually returns a different QName
         if (changedTypeMap.containsKey(resBaseType)) {
-        	metaInfHolder.registerMapping(resBaseType,
+            metaInfHolder.registerMapping(resBaseType,
                     (QName) changedTypeMap.get(resBaseType),
                     className,SchemaConstants.ELEMENT_TYPE);
         } else {
-        	metaInfHolder.registerMapping(resBaseType,
-        			resBaseType,
+            metaInfHolder.registerMapping(resBaseType,
+                    resBaseType,
                     className,SchemaConstants.ELEMENT_TYPE);
         }
-        
+
         metaInfHolder.setRestrictionBaseType(resBaseType);
     }
     

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/resource.properties?rev=431387&r1=431386&r2=431387&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/resource.properties Mon Aug 14 10:51:22 2006
@@ -31,4 +31,5 @@
 schema.templateLoadException=Error loading the template
 schema.templateNotFoundException=template for this writer is not found
 schema.typeMissing=Type {0} missing!
-schema.docuement.error=Error in creating the document
\ No newline at end of file
+schema.docuement.error=Error in creating the document
+schema.soapencoding.error={0} is not supported.
\ No newline at end of file



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