You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/09/19 13:52:43 UTC

svn commit: r816896 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java

Author: dkulp
Date: Sat Sep 19 11:52:42 2009
New Revision: 816896

URL: http://svn.apache.org/viewvc?rev=816896&view=rev
Log:
Merged revisions 816778 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r816778 | bimargulies | 2009-09-18 16:37:35 -0400 (Fri, 18 Sep 2009) | 1 line
  
  Change NPE to Runtime error for part with no content. CXF-2438.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties?rev=816896&r1=816895&r2=816896&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties Sat Sep 19 11:52:42 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/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=816896&r1=816895&r2=816896&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Sat Sep 19 11:52:42 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);
+                
             }
         }
     }