cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1055567 - in /cxf/branches/2.3.x-fixes: ./ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
Date Wed, 05 Jan 2011 18:20:44 GMT
Author: dkulp
Date: Wed Jan  5 18:20:44 2011
New Revision: 1055567

URL: http://svn.apache.org/viewvc?rev=1055567&view=rev
Log:
Merged revisions 1055566 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1055566 | dkulp | 2011-01-05 13:15:53 -0500 (Wed, 05 Jan 2011) | 1 line
  
  Make sure  the soap action on SOAP 1.2 is also checked
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
    cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan  5 18:20:44 2011
@@ -1 +1 @@
-/cxf/trunk:1055184,1055554
+/cxf/trunk:1055184,1055554,1055566

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java?rev=1055567&r1=1055566&r2=1055567&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
Wed Jan  5 18:20:44 2011
@@ -46,9 +46,14 @@ public class SoapActionInInterceptor ext
         addAfter(EndpointSelectionInterceptor.class.getName());
     }
     
-    public void handleMessage(SoapMessage message) throws Fault {
+    public static String getSoapAction(Message m) {
+        if (!(m instanceof SoapMessage)) {
+            return null;
+        }
+        SoapMessage message = (SoapMessage)m;
         if (message.getVersion() instanceof Soap11) {
-            Map<String, List<String>> headers = CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
+            Map<String, List<String>> headers 
+                = CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
             if (headers != null) {
                 List<String> sa = headers.get(SoapBindingConstants.SOAP_ACTION);
                 if (sa != null && sa.size() > 0) {
@@ -56,14 +61,14 @@ public class SoapActionInInterceptor ext
                     if (action.startsWith("\"")) {
                         action = action.substring(1, action.length() - 1);
                     }
-                    getAndSetOperation(message, action);
+                    return action;
                 }
             }
         } else if (message.getVersion() instanceof Soap12) {
             String ct = (String) message.get(Message.CONTENT_TYPE);
             
             if (ct == null) {
-                return;
+                return null;
             }
             
             int start = ct.indexOf("action=");
@@ -79,10 +84,17 @@ public class SoapActionInInterceptor ext
                         end = ct.length();
                     }
                 }
-                
-                getAndSetOperation(message, ct.substring(start, end));
+                return ct.substring(start, end);
             }
         }
+        return null;
+    }
+    
+    public void handleMessage(SoapMessage message) throws Fault {
+        String action = getSoapAction(message);
+        if (!StringUtils.isEmpty(action)) {
+            getAndSetOperation(message, action);
+        }
     }
 
     private void getAndSetOperation(SoapMessage message, String action) {

Modified: cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java?rev=1055567&r1=1055566&r2=1055567&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
Wed Jan  5 18:20:44 2011
@@ -26,7 +26,6 @@ import java.text.MessageFormat;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.ResourceBundle;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -38,6 +37,7 @@ import javax.xml.ws.WebFault;
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.logging.LogUtils;
@@ -47,7 +47,6 @@ import org.apache.cxf.endpoint.ClientLif
 import org.apache.cxf.endpoint.ClientLifeCycleManager;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
@@ -1154,13 +1153,8 @@ public class MAPAggregator extends Abstr
         
         if (maps != null) {
             //WSAB spec, section 4.2 validation (SOAPAction must match action
-            Map<String, List<String>> headers 
-                = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
-            List<String> s = headers == null ? null : headers.get(Names.SOAP_ACTION_HEADER);
+            String sa = SoapActionInInterceptor.getSoapAction(message);
             String s1 = this.getActionUri(message, false);
-            if (s == null && headers != null) {
-                s = headers.get(Names.SOAP_ACTION_HEADER.toLowerCase());
-            }
             
             if (maps.getAction() == null || maps.getAction().getValue() == null) {
                 String reason =
@@ -1172,9 +1166,8 @@ public class MAPAggregator extends Abstr
                 valid = false;
             }
             
-            if (s != null && s.size() > 0 && valid 
+            if (!StringUtils.isEmpty(sa) && valid 
                 && !MessageUtils.isTrue(message.get(MAPAggregator.ACTION_VERIFIED)))
{
-                String sa = s.get(0);
                 if (sa.startsWith("\"")) {
                     sa = sa.substring(1, sa.lastIndexOf('"'));
                 }



Mime
View raw message