Author: davidillsley
Date: Fri Nov  2 03:37:42 2007
New Revision: 591295

URL: http://svn.apache.org/viewvc?rev=591295&view=rev
Log:
Fix AddressingInHandler soap role=none processing. If all
addressing headers are in that role they should be ignored.

Currently this isn't happening and a fault is generated because
the action is 'missing'.

Thanks to Matthew Golby-Kirk for pointing this out.

Modified:
    
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java

Modified: 
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=591295&r1=591294&r2=591295&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
 Fri Nov  2 03:37:42 2007
@@ -65,7 +65,7 @@
     
     public InvocationResponse invoke(MessageContext msgContext) throws 
AxisFault {
         // if another handler has already processed the addressing headers, do 
not do anything here.
-        if (msgContext.isPropertyTrue(IS_ADDR_INFO_ALREADY_PROCESSED)) {
+        if 
(JavaUtils.isTrueExplicitly(msgContext.getLocalProperty(IS_ADDR_INFO_ALREADY_PROCESSED),
 false)) {
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(
                         "Another handler has processed the addressing headers. 
Nothing to do here.");
@@ -109,9 +109,9 @@
                 log.debug(addressingVersion +
                         " Headers present in the SOAP message. Starting to 
process ...");
             }
-
-            extractAddressingInformation(header, msgContext, 
addressingHeaders, namespace);
-            msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, 
Boolean.TRUE);
+            if(extractAddressingInformation(header, msgContext, 
addressingHeaders, namespace)){
+               msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, 
Boolean.TRUE);
+            }
         } else {
             msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, 
Boolean.TRUE);
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
@@ -124,7 +124,8 @@
     
     protected static final int TO_FLAG = 1, FROM_FLAG = 2, REPLYTO_FLAG = 3,
        FAULTO_FLAG = 4, MESSAGEID_FLAG = 6, ACTION_FLAG = 0;
-    protected Options extractAddressingInformation(SOAPHeader header, 
MessageContext messageContext,
+    /** @return true if addressing information was found */
+    protected boolean extractAddressingInformation(SOAPHeader header, 
MessageContext messageContext,
                                                    ArrayList 
addressingHeaders, String namespace)
             throws AxisFault {
 
@@ -181,6 +182,14 @@
                        }
                }
         }
+        
+        if (actionBlock == null && toBlock == null && messageIDBlock == null
+                               && replyToBlock == null && faultToBlock == null
+                               && fromBlock == null && relatesToHeaders == 
null) {
+                       // All of the headers must have had the none role so 
further
+                       // processing should be skipped.
+                       return false;
+               }
 
         if (actionBlock!=null && !ignoreHeaders[ACTION_FLAG]) {
             extractActionInformation(actionBlock, messageContext);
@@ -223,7 +232,7 @@
         // provide default values for headers that have not been found.
         setDefaults(checkedHeaderNames, messageContext);
 
-        return messageContextOptions;
+        return true;
     }
 
     protected abstract void checkForMandatoryHeaders(boolean[] 
alreadyFoundAddrHeader,



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to