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/06/09 20:14:04 UTC

git commit: [CXF-5793] A better error message than an NPE if the "message" attribute isn't there.

Repository: cxf
Updated Branches:
  refs/heads/master 1900e1f4a -> db470d74b


[CXF-5793] A better error message than an NPE if the "message" attribute isn't there.


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

Branch: refs/heads/master
Commit: db470d74ba946246428168d3c50c60ff0116cbe6
Parents: 1900e1f
Author: Daniel Kulp <dk...@apache.org>
Authored: Mon Jun 9 13:42:50 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Mon Jun 9 14:13:42 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/cxf/binding/soap/SoapBindingFactory.java   | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/db470d74/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
index 9019a04..1319936 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
@@ -495,6 +495,12 @@ public class SoapBindingFactory extends AbstractWSDLBindingFactory {
 
         ServiceInfo serviceInfo = bop.getBinding().getService();
 
+        if (header != null && header.getMessage() == null) {
+            throw new RuntimeException("Problem with WSDL: soap:header element" 
+                + " for operation " + bop.getName() + " under binding " + bop.getBinding().getName()
+                + " does not contain a valid message attribute.");
+        }
+        
         if (header != null && serviceInfo.getMessage(header.getMessage()) == null) {
             Definition def = (Definition)serviceInfo.getProperty(WSDLServiceBuilder.WSDL_DEFINITION);
             SchemaCollection schemas = serviceInfo.getXmlSchemaCollection();