You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/06/01 19:01:03 UTC
svn commit: r950165 - in /cxf/branches/2.2.x-fixes: ./
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptor.java
Author: dkulp
Date: Tue Jun 1 17:01:02 2010
New Revision: 950165
URL: http://svn.apache.org/viewvc?rev=950165&view=rev
Log:
Merged revisions 950156 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r950156 | dkulp | 2010-06-01 12:49:21 -0400 (Tue, 01 Jun 2010) | 1 line
Make sure the MTOM policy assertion works on client side
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptor.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
svn:mergeinfo = /cxf/trunk:950156
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptor.java?rev=950165&r1=950164&r2=950165&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptor.java Tue Jun 1 17:01:02 2010
@@ -23,6 +23,7 @@ import java.util.Collection;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageUtils;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import org.apache.cxf.ws.policy.AssertionInfo;
@@ -40,13 +41,18 @@ public class MTOMPolicyInterceptor exten
if (aim != null) {
Collection<AssertionInfo> ais = aim.get(MetadataConstants.MTOM_ASSERTION_QNAME);
for (AssertionInfo ai : ais) {
-
- // set mtom enabled and assert the policy if we find an mtom request
- String contentType = (String)message.getExchange().getInMessage()
- .get(Message.CONTENT_TYPE);
- if (contentType != null && contentType.contains("type=\"application/xop+xml\"")) {
- ai.setAsserted(true);
+ if (MessageUtils.isRequestor(message)) {
+ //just turn on MTOM
message.put(Message.MTOM_ENABLED, Boolean.TRUE);
+ ai.setAsserted(true);
+ } else {
+ // set mtom enabled and assert the policy if we find an mtom request
+ String contentType = (String)message.getExchange().getInMessage()
+ .get(Message.CONTENT_TYPE);
+ if (contentType != null && contentType.contains("type=\"application/xop+xml\"")) {
+ ai.setAsserted(true);
+ message.put(Message.MTOM_ENABLED, Boolean.TRUE);
+ }
}
}
}