cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
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 GMT
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);
+                
             }
         }
     }



Mime
View raw message