Repository: cxf Updated Branches: refs/heads/2.7.x-fixes 2de3120bf -> 97cf76998
[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/97cf7699 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/97cf7699 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/97cf7699 Branch: refs/heads/2.7.x-fixes Commit: 97cf76998603603b59d5e89bb0a1ae61ef73ccd1 Parents: 2de3120 Author: Daniel Kulp <[email protected]> Authored: Mon Jun 9 13:42:50 2014 -0400 Committer: Daniel Kulp <[email protected]> Committed: Mon Jun 9 14:46:40 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/97cf7699/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 aa4e0a5..70961ef 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 @@ -496,6 +496,12 @@ public class SoapBindingFactory extends AbstractBindingFactory { 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();
