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 2014/10/27 20:48:24 UTC

[2/4] git commit: [CXF-6059] Add a better error message if an invalid wsdl is used.

[CXF-6059] Add a better error message if an invalid wsdl is used.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/fe24026b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fe24026b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fe24026b

Branch: refs/heads/2.7.x-fixes
Commit: fe24026bba8cc9afef9cd672255285a194f997f0
Parents: ead72c5
Author: Daniel Kulp <dk...@apache.org>
Authored: Mon Oct 27 13:46:43 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Mon Oct 27 14:04:04 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/cxf/binding/AbstractBindingFactory.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/fe24026b/api/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java b/api/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java
index c0df284..42f700d 100644
--- a/api/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java
+++ b/api/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java
@@ -31,6 +31,7 @@ import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.service.model.AbstractPropertiesHolder;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -101,6 +102,10 @@ public abstract class AbstractBindingFactory extends AbstractBaseBindingFactory
                     copyExtensors(bop2.getOutput(), bop.getBindingOutput(), bop2);
                 }
                 for (BindingFault f : cast(bop.getBindingFaults().values(), BindingFault.class)) {
+                    if (StringUtils.isEmpty(f.getName())) {
+                        throw new IllegalArgumentException("wsdl:fault and soap:fault elements"
+                                                           + " must have a name attribute.");
+                    }
                     copyExtensors(bop2.getFault(new QName(service.getTargetNamespace(), f.getName())),
                                   bop.getBindingFault(f.getName()), bop2);
                 }