cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r945653 - in /cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap: SOAPHandlerFaultOutInterceptor.java SOAPHandlerInterceptor.java
Date Tue, 18 May 2010 13:56:46 GMT
Author: dkulp
Date: Tue May 18 13:56:46 2010
New Revision: 945653

URL: http://svn.apache.org/viewvc?rev=945653&view=rev
Log:
[CXF-2815] Fix getHeader calls for J2EE tck
Patch from Guillaume Sauthier applied

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java?rev=945653&r1=945652&r2=945653&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
Tue May 18 13:56:46 2010
@@ -36,6 +36,7 @@ import javax.xml.ws.soap.SOAPFaultExcept
 
 import org.w3c.dom.Node;
 
+import org.apache.cxf.binding.soap.HeaderUtil;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
@@ -96,6 +97,8 @@ public class SOAPHandlerFaultOutIntercep
             return;
         }
 
+        checkUnderstoodHeaders(message);
+
         if (getInvoker(message).isOutbound()) {
             //The SOAPMessage might be set from the outchain, in this case, 
             //we need to clean it up and create a new SOAPMessage dedicated to fault.
@@ -107,6 +110,18 @@ public class SOAPHandlerFaultOutIntercep
         } 
     }
     
+    private void checkUnderstoodHeaders(SoapMessage soapMessage) {
+        Set<QName> paramHeaders = HeaderUtil.getHeaderQNameInOperationParam(soapMessage);
+        if (soapMessage.getHeaders().isEmpty() && paramHeaders.isEmpty()) {
+            //the TCK expects the getHeaders method to always be
+            //called.   If there aren't any headers in the message,
+            //THe MustUnderstandInterceptor quickly returns without
+            //trying to calculate the understood headers.   Thus,
+            //we need to call it here.
+            getUnderstoodHeaders();
+        }
+    }
+
     private void handleMessageInternal(SoapMessage message) {
         MessageContext context = createProtocolMessageContext(message);
         HandlerChainInvoker invoker = getInvoker(message);

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?rev=945653&r1=945652&r2=945653&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
Tue May 18 13:56:46 2010
@@ -43,6 +43,7 @@ import javax.xml.ws.handler.MessageConte
 import javax.xml.ws.handler.soap.SOAPHandler;
 import javax.xml.ws.handler.soap.SOAPMessageContext;
 
+import org.apache.cxf.binding.soap.HeaderUtil;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor;
@@ -114,6 +115,8 @@ public class SOAPHandlerInterceptor exte
             return;
         }
 
+        checkUnderstoodHeaders(message);
+
         if (getInvoker(message).isOutbound()) {
             if (!chainAlreadyContainsSAAJ(message)) {
                 SAAJ_OUT.handleMessage(message);
@@ -143,6 +146,18 @@ public class SOAPHandlerInterceptor exte
         }
     }
 
+    private void checkUnderstoodHeaders(SoapMessage soapMessage) {
+        Set<QName> paramHeaders = HeaderUtil.getHeaderQNameInOperationParam(soapMessage);
+        if (soapMessage.getHeaders().isEmpty() && paramHeaders.isEmpty()) {
+            //the TCK expects the getHeaders method to always be
+            //called.   If there aren't any headers in the message,
+            //THe MustUnderstandInterceptor quickly returns without
+            //trying to calculate the understood headers.   Thus,
+            //we need to call it here.
+            getUnderstoodHeaders();
+        }
+    }
+
     private boolean handleMessageInternal(SoapMessage message) {
         
         MessageContext context = createProtocolMessageContext(message);



Mime
View raw message