Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 5ca477dfd -> 5f8685e5e
Fix returning secured faults when MTOM is enabled Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5f8685e5 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5f8685e5 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5f8685e5 Branch: refs/heads/3.0.x-fixes Commit: 5f8685e5e0976afdd5b4f52a4f84b36b49b2dcb5 Parents: 5ca477d Author: Colm O hEigeartaigh <[email protected]> Authored: Tue Jan 5 16:32:46 2016 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Tue Jan 5 16:36:41 2016 +0000 ---------------------------------------------------------------------- .../java/org/apache/cxf/binding/soap/SoapBindingFactory.java | 1 + .../apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java | 5 +++++ 2 files changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/5f8685e5/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 1319936..aafa648 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 @@ -396,6 +396,7 @@ public class SoapBindingFactory extends AbstractWSDLBindingFactory { sb.getOutFaultInterceptors().add(new StaxOutInterceptor()); sb.getOutFaultInterceptors().add(new SoapOutInterceptor(getBus())); + sb.getOutFaultInterceptors().add(new AttachmentOutInterceptor()); sb.getInInterceptors().add(new AttachmentInInterceptor()); sb.getInInterceptors().add(new StaxInInterceptor()); http://git-wip-us.apache.org/repos/asf/cxf/blob/5f8685e5/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java index 28896b3..53c5658 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java @@ -33,6 +33,7 @@ import javax.security.auth.callback.UnsupportedCallbackException; import org.apache.cxf.attachment.AttachmentDataSource; import org.apache.cxf.binding.soap.SoapMessage; +import org.apache.cxf.message.Attachment; import org.apache.wss4j.common.ext.AttachmentRequestCallback; import org.apache.wss4j.common.ext.AttachmentResultCallback; @@ -66,6 +67,10 @@ public class AttachmentCallbackHandler implements CallbackHandler { loadAttachments(attachmentList, attachmentId); } else if (callback instanceof AttachmentResultCallback) { AttachmentResultCallback attachmentResultCallback = (AttachmentResultCallback) callback; + + if (soapMessage.getAttachments() == null) { + soapMessage.setAttachments(new ArrayList<Attachment>()); + } final Collection<org.apache.cxf.message.Attachment> attachments = soapMessage.getAttachments();
