Author: amila
Date: Sun Dec 21 21:32:12 2008
New Revision: 27537
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=27537

Log:
set the DISABLE_ADDRESSING_FOR_OUT_MESSAGES status to the orignal state


Modified:
   
branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java

Modified: 
branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java?rev=27537&r1=27536&r2=27537&view=diff
==============================================================================
--- 
branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
   (original)
+++ 
branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
   Sun Dec 21 21:32:12 2008
@@ -256,6 +256,23 @@
                         org.apache.axis2.Constants.VALUE_TRUE);
             }
 
+            // when axis2 receives a soap message without addressing headers 
it users DISABLE_ADDRESSING_FOR_OUT_MESSAGES
+            // property to keep it and hence avoid addressing headers on the 
response.
+            // this causes a problem for synapse if the original message it 
receivs (from client) has addressing and
+            // the synaspse service invocation has not engage addressing.
+            // in this case when synapse receives the response from the server 
addessing In handler dissable addressing
+            // since that response does not have addressing headers.
+            // synapse sends the response to its orignal client using the same 
message context. Then this response does
+            // not have addressing headers since it already disable.
+            // to avoid this we need to set the 
DISABLE_ADDRESSING_FOR_OUT_MESSAGES property state to
+            // original state.
+            if 
(axisOutMsgCtx.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES)
 != null){
+                
response.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,
+                        
axisOutMsgCtx.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES));
+            } else {
+                
response.removeProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
+            }
+
              // copy the message type property thats used by the out message 
to the response message
             
response.setProperty(org.apache.axis2.Constants.Configuration.MESSAGE_TYPE,
                 
axisOutMsgCtx.getProperty(org.apache.axis2.Constants.Configuration.MESSAGE_TYPE));
@@ -282,6 +299,8 @@
                 response.setProperty(NhttpConstants.FORCE_SC_ACCEPTED, 
Constants.VALUE_TRUE);
             }
 
+
+
             // create the synapse message context for the response
             Axis2MessageContext synapseInMessageContext =
                     new Axis2MessageContext(

_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to