cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1528937 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
Date Thu, 03 Oct 2013 16:59:22 GMT
Author: coheigea
Date: Thu Oct  3 16:59:22 2013
New Revision: 1528937

URL: http://svn.apache.org/r1528937
Log:
A fix to get inbound security processing working with the streaming STS

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

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java?rev=1528937&r1=1528936&r2=1528937&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
Thu Oct  3 16:59:22 2013
@@ -508,25 +508,26 @@ public class PolicyBasedWSS4JStaxInInter
                 }
             }
             SoapOperationInfo soapOperationInfo = bindingOperationInfo.getExtensor(SoapOperationInfo.class);
-
-            String soapNS;
-            BindingInfo bindingInfo = bindingOperationInfo.getBinding();
-            if (bindingInfo instanceof SoapBindingInfo) {
-                soapNS = ((SoapBindingInfo)bindingInfo).getSoapVersion().getNamespace();
-            } else {
-                //no idea what todo here...
-                //most probably throw an exception:
-                throw new IllegalArgumentException("BindingInfo is not an instance of SoapBindingInfo");
+            if (soapOperationInfo != null) {
+                String soapNS;
+                BindingInfo bindingInfo = bindingOperationInfo.getBinding();
+                if (bindingInfo instanceof SoapBindingInfo) {
+                    soapNS = ((SoapBindingInfo)bindingInfo).getSoapVersion().getNamespace();
+                } else {
+                    //no idea what todo here...
+                    //most probably throw an exception:
+                    throw new IllegalArgumentException("BindingInfo is not an instance of
SoapBindingInfo");
+                }
+                
+                //todo: I think its a bug that we handover only the localPart of the operation.

+                // Needs to be fixed in ws-security-policy-stax
+                OperationPolicy operationPolicy = new OperationPolicy(localName);
+                operationPolicy.setPolicy(policy.getPolicy());
+                operationPolicy.setOperationAction(soapOperationInfo.getAction());
+                operationPolicy.setSoapMessageVersionNamespace(soapNS);
+                
+                operationPolicies.add(operationPolicy);
             }
-            
-            //todo: I think its a bug that we handover only the localPart of the operation.

-            // Needs to be fixed in ws-security-policy-stax
-            OperationPolicy operationPolicy = new OperationPolicy(localName);
-            operationPolicy.setPolicy(policy.getPolicy());
-            operationPolicy.setOperationAction(soapOperationInfo.getAction());
-            operationPolicy.setSoapMessageVersionNamespace(soapNS);
-            
-            operationPolicies.add(operationPolicy);
         }
         
         String soapAction = SoapActionInInterceptor.getSoapAction(msg);



Mime
View raw message