You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2016/01/05 17:33:06 UTC
cxf git commit: Fix returning secured faults when MTOM is enabled
Repository: cxf
Updated Branches:
refs/heads/master db865dece -> 19b53fc0d
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/19b53fc0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/19b53fc0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/19b53fc0
Branch: refs/heads/master
Commit: 19b53fc0db0dd96a824ab83b53b65e0a26835eda
Parents: db865de
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Jan 5 16:32:46 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Jan 5 16:32:46 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/19b53fc0/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/19b53fc0/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 e2e01e0..0539476 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;
@@ -64,6 +65,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();