axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r365545 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java core/src/org/apache/axis2/Constants.java
Date Tue, 03 Jan 2006 05:33:35 GMT
Author: chinthaka
Date: Mon Jan  2 21:33:22 2006
New Revision: 365545

URL: http://svn.apache.org/viewcvs?rev=365545&view=rev
Log:
Adding a way to skip the AddressingOutHandler dynamically. So one can set msgContext.setProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,
Boolean.TRUE) and this will switch the AddressingOutHandler off.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=365545&r1=365544&r2=365545&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
Mon Jan  2 21:33:22 2006
@@ -30,6 +30,8 @@
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPHeader;
 import org.apache.axis2.soap.SOAPHeaderBlock;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.wsdl.WSDLConstants;
 
 import javax.xml.namespace.QName;
@@ -38,8 +40,18 @@
 
 public class AddressingOutHandler extends AddressingHandler {
 
+    private Log log = LogFactory.getLog(getClass());
+
 
     public void invoke(MessageContext msgContext) throws AxisFault {
+
+        // it should be able to disable addressing by some one.
+        Boolean
+                property = (Boolean) msgContext.getProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
+        if (property != null && property.booleanValue()) {
+            log.info("Addressing is disbaled .....");
+            return;
+        }
         OMNamespace addressingNamespaceObject = null;
         String addressingNamespace = null;
 
@@ -162,7 +174,7 @@
                             addressingNamespaceObject);
                 }
         }
-        
+
         // We are done, cleanup the references
         addressingNamespaceObject = null;
         addressingNamespace = null;

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java?rev=365545&r1=365544&r2=365545&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java Mon Jan
 2 21:33:22 2006
@@ -207,5 +207,9 @@
         public static final String FORCE_MIME = "ForceMimeBoundary";
         public static final String CONTENT_TYPE = "ContentType";
         public static final String IS_USING_SEPARATE_LISTENER = "IsUsingSeparateListener";
+
+        // this property once set to Boolean.TRUE will make the messages to skip Addressing
Handler.
+        // So you will not see Addressing Headers in the OUT path.
+        public static final String DISABLE_ADDRESSING_FOR_OUT_MESSAGES = "disableAddressingForOutMessages";
     }
 }



Mime
View raw message