cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1133814 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
Date Thu, 09 Jun 2011 11:58:23 GMT
Author: coheigea
Date: Thu Jun  9 11:58:23 2011
New Revision: 1133814

URL: http://svn.apache.org/viewvc?rev=1133814&view=rev
Log:
Add the ability to configure BSP compliance for the outbound policy-based case.

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java?rev=1133814&r1=1133813&r2=1133814&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
Thu Jun  9 11:58:23 2011
@@ -40,6 +40,7 @@ import org.apache.cxf.phase.PhaseInterce
 import org.apache.cxf.ws.policy.AssertionInfo;
 import org.apache.cxf.ws.policy.AssertionInfoMap;
 import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.model.AsymmetricBinding;
 import org.apache.cxf.ws.security.policy.model.Binding;
@@ -151,6 +152,7 @@ public class PolicyBasedWSS4JOutIntercep
                     if (config == null) {
                         config = WSSConfig.getNewInstance();
                     }
+                    translateProperties(message, config);
 
                     if (transport instanceof TransportBinding) {
                         new TransportBindingHandler(config, (TransportBinding)transport,
saaj,
@@ -209,5 +211,14 @@ public class PolicyBasedWSS4JOutIntercep
         getAdditionalInterceptors() {
             return null;
         }
+        
+        private void translateProperties(SoapMessage msg, WSSConfig config) {
+            String bspCompliant = (String)msg.getContextualProperty(SecurityConstants.IS_BSP_COMPLIANT);
+            if ("1".equals(bspCompliant) || "true".equals(bspCompliant)) {
+                config.setWsiBSPCompliant(true);
+            } else if ("0".equals(bspCompliant) || "false".equals(bspCompliant)) {
+                config.setWsiBSPCompliant(false);
+            }
+        }
     }
 }



Mime
View raw message