Author: dkulp
Date: Sat Sep 19 12:05:24 2009
New Revision: 816899

URL: http://svn.apache.org/viewvc?rev=816899&view=rev
Log:
Merged revisions 816896 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r816896 | dkulp | 2009-09-19 07:52:42 -0400 (Sat, 19 Sep 2009) | 9 lines
  
  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.1.x-fixes/   (props changed)
    
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
    
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java

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

Modified: 
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties?rev=816899&r1=816898&r2=816899&view=diff
==============================================================================
--- 
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
 (original)
+++ 
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
 Sat Sep 19 12:05:24 2009
@@ -30,4 +30,5 @@
 MISSING_DESTINATION_FACTORY = Cannot find the destination factory, check the 
port //wsdl:po...@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.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=816899&r1=816898&r2=816899&view=diff
==============================================================================
--- 
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
 (original)
+++ 
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
 Sat Sep 19 12:05:24 2009
@@ -780,7 +780,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) {
@@ -793,6 +793,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);
+                
             }
         }
     }


Reply via email to