You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2015/06/02 20:00:50 UTC
[2/2] cxf git commit: [CXF-6434] SOAPAction value may not be
extracted correctly for SOAP 1.2 with Attachments
[CXF-6434] SOAPAction value may not be extracted correctly for SOAP 1.2 with Attachments
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/35b0312b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/35b0312b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/35b0312b
Branch: refs/heads/3.0.x-fixes
Commit: 35b0312b16bef9c924dcbb3cfb3aaa81d6700897
Parents: 78e556b
Author: Akitoshi Yoshida <ay...@apache.org>
Authored: Tue Jun 2 18:35:46 2015 +0200
Committer: Akitoshi Yoshida <ay...@apache.org>
Committed: Tue Jun 2 20:00:31 2015 +0200
----------------------------------------------------------------------
.../soap/interceptor/SoapActionInInterceptor.java | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/35b0312b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
index 8a257c7..ede1404 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
+import org.apache.cxf.attachment.AttachmentDeserializer;
import org.apache.cxf.binding.soap.Soap11;
import org.apache.cxf.binding.soap.Soap12;
import org.apache.cxf.binding.soap.SoapBindingConstants;
@@ -80,11 +81,25 @@ public class SoapActionInInterceptor extends AbstractSoapInterceptor {
}
int start = ct.indexOf("action=");
+ if (start == -1 && ct.indexOf("multipart/related") == 0) {
+ // the action property may not be found at the package's content-type for non-mtom multipart message
+ List<String> cts = CastUtils.cast((List<?>)(CastUtils.cast(
+ (Map<?, ?>)message.get(AttachmentDeserializer.ATTACHMENT_PART_HEADERS)).get(Message.CONTENT_TYPE)));
+ if (cts != null && cts.size() > 0) {
+ ct = cts.get(0);
+ start = ct.indexOf("action=");
+ }
+ }
if (start != -1) {
int end;
- if (ct.charAt(start + 7) == '\"') {
+ char c = ct.charAt(start + 7);
+ // handle the extraction robustly
+ if (c == '\"') {
start += 8;
end = ct.indexOf('\"', start);
+ } else if (c == '\\' && ct.charAt(start + 8) == '\"') {
+ start += 9;
+ end = ct.indexOf('\\', start);
} else {
start += 7;
end = ct.indexOf(';', start);