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 pr...@apache.org on 2007/09/10 21:56:53 UTC

svn commit: r574350 - in /webservices/axis2/branches/java/jaxws21/modules: addressing/src/META-INF/ addressing/src/org/apache/axis2/addressing/ addressing/src/org/apache/axis2/handlers/addressing/ kernel/src/org/apache/axis2/addressing/

Author: pradine
Date: Mon Sep 10 12:56:52 2007
New Revision: 574350

URL: http://svn.apache.org/viewvc?rev=574350&view=rev
Log:
Add support for new parameters to the AddressingInHandler, and tidy up the existing support for parameters in the AddressingOutHandler.

Removed:
    webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/addressing/AddressingModule.java
Modified:
    webservices/axis2/branches/java/jaxws21/modules/addressing/src/META-INF/module.xml
    webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java

Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/META-INF/module.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/META-INF/module.xml?rev=574350&r1=574349&r2=574350&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/META-INF/module.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/META-INF/module.xml Mon Sep 10 12:56:52 2007
@@ -16,7 +16,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-<module name="addressing" class="org.apache.axis2.addressing.AddressingModule">
+<module name="addressing">
     <Description>This is the WS-Addressing implementation on Axis2, supporting the WS-Addressing 1.0 Recommendation, as well as the Submission version (2004/08).</Description>
     <InFlow>
         <handler name="AddressingFinalInHandler" class="org.apache.axis2.handlers.addressing.AddressingFinalInHandler">

Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=574350&r1=574349&r2=574350&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Mon Sep 10 12:56:52 2007
@@ -31,8 +31,11 @@
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.handlers.AbstractHandler;
+import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.LoggingControl;
+import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -48,6 +51,18 @@
 
 
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
+    	//Determine if we want to ignore addressing headers.
+    	Parameter disableParam = msgContext.getParameter(DISABLE_ADDRESSING_HANDLERS);
+        String value = Utils.getParameterValue(disableParam);
+        if (JavaUtils.isTrueExplicitly(value)) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+                log.debug(
+                        "The handler has been disabled. No further processing will take place.");
+            }
+            msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
+            return InvocationResponse.CONTINUE;        	
+        }
+
         // if another handler has already processed the addressing headers, do not do anything here.
         if (msgContext.isPropertyTrue(IS_ADDR_INFO_ALREADY_PROCESSED)) {
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
@@ -58,18 +73,24 @@
         }
 
         // check whether someone has explicitly set which addressing handler should run.
-        String namespace = (String)msgContext.getProperty(WS_ADDRESSING_VERSION);
+    	Parameter namespaceParam = msgContext.getParameter(WS_ADDRESSING_VERSION);
+        String namespace = Utils.getParameterValue(namespaceParam);
         if (namespace == null) {
-            namespace = addressingNamespace;
-        } else if (!namespace.equals(addressingNamespace)) {
-            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                log.debug("This addressing handler does not match the specified namespace, " +
-                        namespace);
-            }
-
-            return InvocationResponse.CONTINUE;
+        	namespace = (String)msgContext.getProperty(WS_ADDRESSING_VERSION);
+        	if (namespace == null) {
+        		namespace = addressingNamespace;
+        	}
         }
-
+        
+        if (!namespace.equals(addressingNamespace)) {
+    		if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+    			log.debug("This addressing handler does not match the specified namespace, " +
+    					namespace);
+    		}
+    		
+    		return InvocationResponse.CONTINUE;
+    	}
+        
         SOAPHeader header = msgContext.getEnvelope().getHeader();
 
         // if there are not headers put a flag to disable addressing temporary

Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=574350&r1=574349&r2=574350&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Mon Sep 10 12:56:52 2007
@@ -38,7 +38,6 @@
 import org.apache.axis2.addressing.i18n.AddressingMessages;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.util.JavaUtils;
@@ -56,20 +55,6 @@
 
     private static final Log log = LogFactory.getLog(AddressingOutHandler.class);
 
-    /** This variable should only be updated inside the {@link #init(HandlerDescription)} method. */
-    private boolean includeOptionalHeaders = false;
-
-    /** Initialize the addressing out handler. */
-    public void init(HandlerDescription arg0) {
-        super.init(arg0);
-
-        //Determine whether to include optional addressing headers in the output message.
-        //The default is not to include any headers that can be safely omitted.
-        Parameter param = arg0.getParameter(INCLUDE_OPTIONAL_HEADERS);
-        String value = Utils.getParameterValue(param);
-        includeOptionalHeaders = JavaUtils.isTrueExplicitly(value);
-    }
-
     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)) {
@@ -90,7 +75,9 @@
                 Submission.WSA_NAMESPACE.equals(addressingVersionFromCurrentMsgCtxt);
 
         // Determine whether to include optional addressing headers in the output.
-        boolean includeOptionalHeaders = this.includeOptionalHeaders ||
+        Parameter param = msgContext.getParameter(INCLUDE_OPTIONAL_HEADERS);
+        String value = Utils.getParameterValue(param);
+        boolean includeOptionalHeaders = JavaUtils.isTrueExplicitly(value) ||
                                             msgContext.isPropertyTrue(INCLUDE_OPTIONAL_HEADERS);
 
         // Determine if a MustUnderstand attribute will be added to all headers in the

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java?rev=574350&r1=574349&r2=574350&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java Mon Sep 10 12:56:52 2007
@@ -44,6 +44,7 @@
     static final String PARAM_SERVICE_GROUP_CONTEXT_ID =
             "ServiceGroupContextIdFromAddressing";
     static final String IS_ADDR_INFO_ALREADY_PROCESSED = "IsAddressingProcessed";
+    static final String DISABLE_ADDRESSING_HANDLERS = "disableAddressingHandlers";
     static final String ADDR_VALIDATE_ACTION = "addressing.validateAction";
 
     // ====================== WSDL Binding Constants ========================



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