You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by am...@apache.org on 2009/03/31 09:58:27 UTC

svn commit: r760356 - /webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java

Author: amilas
Date: Tue Mar 31 07:58:26 2009
New Revision: 760356

URL: http://svn.apache.org/viewvc?rev=760356&view=rev
Log:
removing transport headers if the transport is mail

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java?rev=760356&r1=760355&r2=760356&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java Tue Mar 31 07:58:26 2009
@@ -116,6 +116,17 @@
 			//says that the inbound msg of this was a LastMessage - so the new msg will also be a LastMessage
 			outMessageContext.setProperty(Sandesha2Constants.MessageContextProperties.INBOUND_LAST_MESSAGE, Boolean.TRUE);
 			outMessageContext.setProperty(RequestResponseTransport.TRANSPORT_CONTROL, msgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL));
+
+			// when sending mail messages mail transport first check whether the "TO" header
+			// is present in the headers and if present use it.
+			// "TO" header of the incomming message actually represents the server itself. this causes
+			// reply to send to the servers mail address again.
+			// but if there is not transport headers it get the outtransport info target address.
+			if (msgContext.isServerSide()
+					&& (msgContext.getTransportIn() != null)
+					&& (msgContext.getTransportIn().getName().equals(Constants.TRANSPORT_MAIL))){
+				 outMessageContext.setProperty(MessageContext.TRANSPORT_HEADERS, null);
+			}
 			
 			AxisEngine.send(outMessageContext);
 			TransportUtils.setResponseWritten(msgContext, true);



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