axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@apache.org
Subject svn commit: r537370 - in /webservices/axis2/trunk/java/modules/addressing: src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
Date Sat, 12 May 2007 09:57:35 GMT
Author: pradine
Date: Sat May 12 02:57:34 2007
New Revision: 537370

URL: http://svn.apache.org/viewvc?view=rev&rev=537370
Log:
Resolve JIRA issue AXIS2-2646.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java?view=diff&rev=537370&r1=537369&r2=537370
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
Sat May 12 02:57:34 2007
@@ -77,8 +77,25 @@
 
     protected void setDefaults(ArrayList alreadyFoundAddrHeader, MessageContext messageContext)
{
         //According to the WS-Addressing spec, we should default the wsa:To header to the
-        //anonymous URL. Doing that, however, might prevent a different value from being
-        //used instead, such as the transport URL.
+        //anonymous URI. Doing that, however, might prevent a different value from being
+        //used instead, such as the transport URL. Therefore, we only apply the default
+        //on the inbound response side of a synchronous request-response exchange.
+        if (!alreadyFoundAddrHeader.contains(WSA_TO) && !messageContext.isServerSide())
{
+            Options messageContextOptions = messageContext.getOptions();
+            EndpointReference epr = messageContextOptions.getTo();
+
+            if (epr == null) {
+                epr = new EndpointReference("");
+                messageContextOptions.setTo(epr);
+            }
+
+            if (log.isTraceEnabled()) {
+                log.trace(messageContext.getLogIDString() +
+                        " setDefaults: Setting WS-Addressing default value for the To property.");
+            }
+
+            epr.setAddress(Final.WSA_ANONYMOUS_URL);
+        }
 
         if (!alreadyFoundAddrHeader.contains(WSA_REPLY_TO)) {
             Options messageContextOptions = messageContext.getOptions();

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java?view=diff&rev=537370&r1=537369&r2=537370
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
Sat May 12 02:57:34 2007
@@ -167,8 +167,10 @@
         try {
             Options options = testMessageWithOmittedHeaders("noTo");
             EndpointReference epr = options.getTo();
+            String address = epr.getAddress();
 
-            assertNull("The To endpoint reference is not null.", epr);
+            assertEquals("The address of the To endpoint reference is not the anonymous URI.",
+                         AddressingConstants.Final.WSA_ANONYMOUS_URL, address);
         }
         catch (AxisFault af) {
             af.printStackTrace();



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