axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@apache.org
Subject svn commit: r631988 - in /webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing: AddressingInHandler.java AddressingOutHandler.java
Date Thu, 28 Feb 2008 15:03:39 GMT
Author: pradine
Date: Thu Feb 28 07:03:27 2008
New Revision: 631988

URL: http://svn.apache.org/viewvc?rev=631988&view=rev
Log:
Add support for disabling the WS-Addressing outbound handler using
a parameter.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.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=631988&r1=631987&r2=631988&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
Thu Feb 28 07:03:27 2008
@@ -64,6 +64,7 @@
         Parameter param = handlerdesc.getParameter(DISABLE_REF_PARAMETER_EXTRACT);
         String value = Utils.getParameterValue(param);
         disableRefparamExtract = JavaUtils.isTrueExplicitly(value);
+
         if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug("disableRefparamExtract=" + disableRefparamExtract);
         }

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=631988&r1=631987&r2=631988&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
Thu Feb 28 07:03:27 2008
@@ -61,7 +61,8 @@
 
     private static final Log log = LogFactory.getLog(AddressingOutHandler.class);
 
-    private boolean includeOptionalHeaders = false;
+    private boolean includeOptionalHeaders;
+    private boolean disableAddressing;
 
     public void init(HandlerDescription arg0) {
         super.init(arg0);
@@ -71,11 +72,27 @@
         Parameter param = arg0.getParameter(INCLUDE_OPTIONAL_HEADERS);
         String value = Utils.getParameterValue(param);
         includeOptionalHeaders = JavaUtils.isTrueExplicitly(value);
+
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+            log.debug("includeOptionalHeaders=" + includeOptionalHeaders);
+        }
+
+        //Determine whether to disable the handler by default.
+        param = arg0.getParameter(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
+        value = Utils.getParameterValue(param);
+        disableAddressing = JavaUtils.isTrueExplicitly(value);
+
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+            log.debug("disableAddressing=" + disableAddressing);
+        }
     }
 
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
-        // it should be able to disable addressing by some one.
-        if (msgContext.isPropertyTrue(DISABLE_ADDRESSING_FOR_OUT_MESSAGES)) {
+        //determine whether outbound addressing has been disabled or not.
+        boolean disableAddressing =
+            msgContext.isPropertyTrue(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, this.disableAddressing);
+
+        if (disableAddressing) {
             if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
                 log.trace(msgContext.getLogIDString() +
                         " Addressing is disabled. Not adding WS-Addressing headers.");
@@ -93,8 +110,8 @@
                 Submission.WSA_NAMESPACE.equals(addressingVersionFromCurrentMsgCtxt);
 
         // Determine whether to include optional addressing headers in the output.
-        boolean includeOptionalHeaders = this.includeOptionalHeaders ||
-                                            msgContext.isPropertyTrue(INCLUDE_OPTIONAL_HEADERS);
+        boolean includeOptionalHeaders =
+            msgContext.isPropertyTrue(INCLUDE_OPTIONAL_HEADERS, this.includeOptionalHeaders);
 
         if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug("includeOptionalHeaders=" + includeOptionalHeaders);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message