Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 79531 invoked from network); 14 Aug 2006 17:51:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Aug 2006 17:51:45 -0000 Received: (qmail 12951 invoked by uid 500); 14 Aug 2006 17:51:44 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 12865 invoked by uid 500); 14 Aug 2006 17:51:44 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 12854 invoked by uid 500); 14 Aug 2006 17:51:44 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 12851 invoked by uid 99); 14 Aug 2006 17:51:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2006 10:51:44 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2006 10:51:43 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 7A60A1A981A; Mon, 14 Aug 2006 10:51:23 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r431387 - in /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema: SchemaCompiler.java i18n/resource.properties Date: Mon, 14 Aug 2006 17:51:22 -0000 To: axis2-cvs@ws.apache.org From: dims@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060814175123.7A60A1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 s 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