Repository: cxf Updated Branches: refs/heads/master ec3a49b09 -> c4bd350b3
[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/c4bd350b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c4bd350b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c4bd350b Branch: refs/heads/master Commit: c4bd350b3c98d52a360b738834aa02035718e7e3 Parents: ec3a49b Author: Akitoshi Yoshida <[email protected]> Authored: Tue Jun 2 18:35:46 2015 +0200 Committer: Akitoshi Yoshida <[email protected]> Committed: Tue Jun 2 18:36:26 2015 +0200 ---------------------------------------------------------------------- .../soap/interceptor/SoapActionInInterceptor.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/c4bd350b/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 9c4d853..c2ddd43 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);
