Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 18872 invoked from network); 18 Sep 2009 20:38:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Sep 2009 20:38:00 -0000 Received: (qmail 24492 invoked by uid 500); 18 Sep 2009 20:38:00 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 24416 invoked by uid 500); 18 Sep 2009 20:38:00 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 24405 invoked by uid 99); 18 Sep 2009 20:38:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2009 20:38:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2009 20:37:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A430F23888FF; Fri, 18 Sep 2009 20:37:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r816778 - in /cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11: Messages.properties WSDLServiceBuilder.java Date: Fri, 18 Sep 2009 20:37:35 -0000 To: commits@cxf.apache.org From: bimargulies@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090918203735.A430F23888FF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bimargulies Date: Fri Sep 18 20:37:35 2009 New Revision: 816778 URL: http://svn.apache.org/viewvc?rev=816778&view=rev Log: Change NPE to Runtime error for part with no content. CXF-2438. Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties?rev=816778&r1=816777&r2=816778&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties Fri Sep 18 20:37:35 2009 @@ -30,4 +30,5 @@ MISSING_DESTINATION_FACTORY = Cannot find the destination factory, check the port //wsdl:port[@name=''{0}''] MISSING_SERVICE= No definition of service {0} in the WSDL. WSDL4J_BAD_ELEMENT_PART= Part {0} defined as element {1} which is not in the schema. +PART_NO_NAME_NO_TYPE= Part {0} defined with no element and no type. NO_MESSAGE=No {0} message was found for operation {1} and input named {2}. Check the wsdl for errors. Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=816778&r1=816777&r2=816778&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Fri Sep 18 20:37:35 2009 @@ -797,7 +797,7 @@ pi.setTypeQName(part.getTypeName()); pi.setElement(false); pi.setXmlSchema(schemas.getTypeByQName(part.getTypeName())); - } else { + } else if (part.getElementName() != null) { pi.setElementQName(part.getElementName()); XmlSchemaElement schemaElement = schemas.getElementByQName(part.getElementName()); if (null == schemaElement) { @@ -810,6 +810,13 @@ } pi.setElement(true); pi.setXmlSchema(schemaElement); + } else { + org.apache.cxf.common.i18n.Message errorMessage = + new org.apache.cxf.common.i18n.Message("PART_NO_NAME_NO_TYPE", + LOG, + part.getName()); + throw new WSDLRuntimeException(errorMessage); + } } }