You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2006/01/03 06:33:35 UTC

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

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";
     }
 }



Re: 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

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Tue, 2006-01-03 at 05:33 +0000, chinthaka@apache.org wrote:
> 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.

Saminda/Paul, I believe this will meet the Synapse requirement to turn
off addressing on a per service basis for outgoing messages.

Sanjiva.



Re: 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

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Tue, 2006-01-03 at 05:33 +0000, chinthaka@apache.org wrote:
> 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.

Saminda/Paul, I believe this will meet the Synapse requirement to turn
off addressing on a per service basis for outgoing messages.

Sanjiva.