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 di...@apache.org on 2006/07/11 18:18:53 UTC

svn commit: r420911 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSSender.java

Author: dims
Date: Tue Jul 11 09:18:52 2006
New Revision: 420911

URL: http://svn.apache.org/viewvc?rev=420911&view=rev
Log:
Fix for AXIS2-886 - New JMS sender should take account of WS-Addressing destination even on the server

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSSender.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSSender.java?rev=420911&r1=420910&r2=420911&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSSender.java Tue Jul 11 09:18:52 2006
@@ -50,26 +50,34 @@
         log.debug("JMSSender invoke()");
 
         JMSOutTransportInfo transportInfo = null;
-        String targetEpr = null;
+        String targetAddress = null;
 
-        if (msgContext.isServerSide()) {
-            // get the replyto information
-            transportInfo = (JMSOutTransportInfo)
-                msgContext.getProperty(Constants.OUT_TRANSPORT_INFO);
+        // is there a transport url? which may be different from the WS-A To..
+        targetAddress = (String) msgContext.getProperty(
+            MessageContextConstants.TRANSPORT_URL);
 
-        } else {
-            // is there a transport url? which may be different from the WS-A To..
-            targetEpr = (String) msgContext.getProperty(
-                MessageContextConstants.TRANSPORT_URL);
-
-            if (targetEpr == null && msgContext.getTo() != null &&
-                !AddressingConstants.Submission.WSA_ANONYMOUS_URL
-                    .equals(msgContext.getTo().getAddress()) &&
-                !AddressingConstants.Final.WSA_ANONYMOUS_URL
-                    .equals(msgContext.getTo().getAddress())) {
-                targetEpr = msgContext.getTo().getAddress();
+        if (targetAddress != null) {
+            transportInfo = new JMSOutTransportInfo(targetAddress);            
+        }
+        else if (targetAddress == null && msgContext.getTo() != null &&
+            !AddressingConstants.Submission.WSA_ANONYMOUS_URL
+                .equals(msgContext.getTo().getAddress()) &&
+            !AddressingConstants.Final.WSA_ANONYMOUS_URL
+                .equals(msgContext.getTo().getAddress())) {
+            targetAddress = msgContext.getTo().getAddress();
+            
+            if (targetAddress.equals(AddressingConstants.Final.WSA_NONE_URI)) {
+                //Don't send the message.
+                return;
+            }
+            else {
+                transportInfo = new JMSOutTransportInfo(targetAddress);
             }
-            transportInfo = new JMSOutTransportInfo(targetEpr);
+        }
+        else if (msgContext.isServerSide()){
+            // get the jms ReplyTo
+            transportInfo = (JMSOutTransportInfo)
+                msgContext.getProperty(Constants.OUT_TRANSPORT_INFO);                
         }
 
         // should we wait and listen for a response?
@@ -97,7 +105,7 @@
 
             if (dest == null) {
                 // if it does not exist, create it
-                String name = JMSUtils.getDestination(targetEpr);
+                String name = JMSUtils.getDestination(targetAddress);
                 try {
                     dest = session.createQueue(name);
                 } catch (JMSException e) {



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