synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r556136 - in /webservices/synapse/trunk/java/modules: core/src/main/java/org/apache/synapse/core/axis2/ core/src/main/java/org/apache/synapse/mediators/transform/ nhttp/src/org/apache/axis2/transport/nhttp/
Date Fri, 13 Jul 2007 20:24:21 GMT
Author: asankha
Date: Fri Jul 13 13:24:20 2007
New Revision: 556136

URL: http://svn.apache.org/viewvc?view=rev&rev=556136
Log:
fix SYNAPSE-109, SYNAPSE-108
copy properties into the clone being sent

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
    webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java?view=diff&rev=556136&r1=556135&r2=556136
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
Fri Jul 13 13:24:20 2007
@@ -282,6 +282,9 @@
         newMC.setProperty(MessageContext.TRANSPORT_HEADERS,
             ori.getProperty(MessageContext.TRANSPORT_HEADERS));
 
+        // copy axis properties from the original to the copy
+        newMC.setProperties(ori.getProperties());
+
         return newMC;
     }
     

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java?view=diff&rev=556136&r1=556135&r2=556136
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
Fri Jul 13 13:24:20 2007
@@ -21,6 +21,7 @@
 
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axiom.om.impl.llom.OMTextImpl;
 import org.apache.axiom.om.impl.llom.OMElementImpl;
@@ -454,17 +455,21 @@
         if (getMessageID() != null)
             sb.append(separator + "MessageID: " + getMessageID());
 
-        Iterator iter = getEnvelope().getHeader().examineAllHeaderBlocks();
-        if (iter.hasNext()) {
-            sb.append(separator + "Headers : ");
-            while (iter.hasNext()) {
-                Object o = iter.next();
-                if (o instanceof SOAPHeaderBlock) {
-                    SOAPHeaderBlock header = (SOAPHeaderBlock) o;
-                    sb.append(separator + header.getLocalName() + " : " + header.getText());
-                } else if (o instanceof OMElement) {
-                    OMElement headerElem = (OMElement) o;
-                    sb.append(separator + headerElem.getLocalName() + " : " + headerElem.getText());
+
+        SOAPHeader headers = getEnvelope().getHeader();
+        if (headers != null) {
+            Iterator iter = headers.examineAllHeaderBlocks();
+            if (iter.hasNext()) {
+                sb.append(separator + "Headers : ");
+                while (iter.hasNext()) {
+                    Object o = iter.next();
+                    if (o instanceof SOAPHeaderBlock) {
+                        SOAPHeaderBlock header = (SOAPHeaderBlock) o;
+                        sb.append(separator + header.getLocalName() + " : " + header.getText());
+                    } else if (o instanceof OMElement) {
+                        OMElement headerElem = (OMElement) o;
+                        sb.append(separator + headerElem.getLocalName() + " : " + headerElem.getText());
+                    }
                 }
             }
         }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java?view=diff&rev=556136&r1=556135&r2=556136
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
Fri Jul 13 13:24:20 2007
@@ -129,15 +129,18 @@
         setFaultDetail(factory, fault);
 
         // set the all headers of griginal SOAP Envelope to the Fault Envelope
-        Iterator iter = synCtx.getEnvelope().getHeader().examineAllHeaderBlocks();
-        if (iter.hasNext()) {
-            while (iter.hasNext()) {
-                Object o = iter.next();
-                if (o instanceof SOAPHeaderBlock) {
-                    SOAPHeaderBlock header = (SOAPHeaderBlock) o;
-                    faultEnvelope.getHeader().addChild(header);
-                } else if (o instanceof OMElement) {
-                    faultEnvelope.getHeader().addChild((OMElement) o);
+        SOAPHeader headers = synCtx.getEnvelope().getHeader();
+        if (headers != null) {
+            Iterator iter = headers.examineAllHeaderBlocks();
+            if (iter.hasNext()) {
+                while (iter.hasNext()) {
+                    Object o = iter.next();
+                    if (o instanceof SOAPHeaderBlock) {
+                        SOAPHeaderBlock header = (SOAPHeaderBlock) o;
+                        faultEnvelope.getHeader().addChild(header);
+                    } else if (o instanceof OMElement) {
+                        faultEnvelope.getHeader().addChild((OMElement) o);
+                    }
                 }
             }
         }

Modified: webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java?view=diff&rev=556136&r1=556135&r2=556136
==============================================================================
--- webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
(original)
+++ webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
Fri Jul 13 13:24:20 2007
@@ -239,14 +239,23 @@
      */
     private void removeUnwantedHeaders(MessageContext msgContext) {
         Map headers = (Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
-        if (headers != null && !headers.isEmpty()) {
-            headers.remove(HTTP.CONN_DIRECTIVE);
-            headers.remove(HTTP.TRANSFER_ENCODING);
-            headers.remove(HTTP.DATE_DIRECTIVE);
-            headers.remove(HTTP.SERVER_DIRECTIVE);
-            headers.remove(HTTP.CONTENT_TYPE);
-            headers.remove(HTTP.CONTENT_LEN);
-            headers.remove(HTTP.USER_AGENT);
+
+        if (headers == null || headers.isEmpty()) {
+            return;
+        }
+
+        Iterator iter = headers.keySet().iterator();
+        while (iter.hasNext()) {
+            String headerName = (String) iter.next();
+            if (HTTP.CONN_DIRECTIVE.equalsIgnoreCase(headerName) ||
+                HTTP.TRANSFER_ENCODING.equalsIgnoreCase(headerName) ||
+                HTTP.DATE_DIRECTIVE.equalsIgnoreCase(headerName) ||
+                HTTP.SERVER_DIRECTIVE.equalsIgnoreCase(headerName) ||
+                HTTP.CONTENT_TYPE.equalsIgnoreCase(headerName) ||
+                HTTP.CONTENT_LEN.equalsIgnoreCase(headerName) ||
+                HTTP.USER_AGENT.equalsIgnoreCase(headerName)) {
+                iter.remove();
+            }
         }
     }
 



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


Mime
View raw message