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 2008/08/06 18:31:09 UTC

svn commit: r683318 - in /cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator: Messages.properties UniqueBodyValidator.java

Author: dkulp
Date: Wed Aug  6 09:31:08 2008
New Revision: 683318

URL: http://svn.apache.org/viewvc?rev=683318&view=rev
Log:
[CXF-1723] Output error message if fault has multple parts instead of generating bogus code.

Modified:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties?rev=683318&r1=683317&r2=683318&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties (original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/Messages.properties Wed Aug  6 09:31:08 2008
@@ -19,4 +19,5 @@
 #
 #
 NON_UNIQUE_BODY = Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations \"{1}\" and \"{2}\" have the same request body block {3}  
-WRAPPER_STYLE_NAME_COLLISION = Element {0} has Having the same name with different types[{1} -- {2}],  In wrapper style, there is a collision as per the spec.
\ No newline at end of file
+WRAPPER_STYLE_NAME_COLLISION = Element {0} has Having the same name with different types[{1} -- {2}],  In wrapper style, there is a collision as per the spec.
+FAULT_WITH_MULTIPLE_PARTS = Fault message {0} has multiple parts which is against WSDL specification.
\ No newline at end of file

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java?rev=683318&r1=683317&r2=683318&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java (original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java Wed Aug  6 09:31:08 2008
@@ -27,6 +27,7 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.service.model.BindingFaultInfo;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -86,6 +87,16 @@
                     uniqueNames.put(mName, op.getName());
                 }
             }
+            
+            for (BindingFaultInfo fault : bo.getFaults()) {
+                if (fault.getFaultInfo().getMessageParts().size() > 1) {
+                    Message msg = new Message("FAULT_WITH_MULTIPLE_PARTS", LOG, 
+                                              fault.getFaultInfo().getName()
+                                                  .getLocalPart());
+                    addErrorMessage(msg.toString());
+                    return false;
+                }
+            }
         }
         return true;
     }