Merge pull request #2 from farseerfc/patch-1

fix typo langugae -> language
diff --git a/java/modules/commons/pom.xml b/java/modules/commons/pom.xml
index fc0619d..765c040 100644
--- a/java/modules/commons/pom.xml
+++ b/java/modules/commons/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/java/modules/commons/src/main/java/org/apache/synapse/commons/builders/XFormURLEncodedBuilder.java b/java/modules/commons/src/main/java/org/apache/synapse/commons/builders/XFormURLEncodedBuilder.java
index 570c453..49f6ab1 100644
--- a/java/modules/commons/src/main/java/org/apache/synapse/commons/builders/XFormURLEncodedBuilder.java
+++ b/java/modules/commons/src/main/java/org/apache/synapse/commons/builders/XFormURLEncodedBuilder.java
@@ -1,5 +1,23 @@
-package org.apache.synapse.commons.builders;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 
+package org.apache.synapse.commons.builders;
 
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
diff --git a/java/modules/commons/src/main/java/org/apache/synapse/commons/evaluators/config/MatchSerializer.java b/java/modules/commons/src/main/java/org/apache/synapse/commons/evaluators/config/MatchSerializer.java
index d24a217..359dd5c 100644
--- a/java/modules/commons/src/main/java/org/apache/synapse/commons/evaluators/config/MatchSerializer.java
+++ b/java/modules/commons/src/main/java/org/apache/synapse/commons/evaluators/config/MatchSerializer.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.commons.evaluators.config;
 
 import org.apache.axiom.om.OMElement;
diff --git a/java/modules/commons/src/main/java/org/apache/synapse/commons/snmp/SNMPAgent.java b/java/modules/commons/src/main/java/org/apache/synapse/commons/snmp/SNMPAgent.java
index 1c6548f..fd26b25 100644
--- a/java/modules/commons/src/main/java/org/apache/synapse/commons/snmp/SNMPAgent.java
+++ b/java/modules/commons/src/main/java/org/apache/synapse/commons/snmp/SNMPAgent.java
@@ -27,8 +27,8 @@
 import org.snmp4j.agent.DuplicateRegistrationException;
 import org.snmp4j.agent.ManagedObject;
 import org.snmp4j.agent.io.ImportModes;
-import org.snmp4j.agent.mo.MOTableRow;
 import org.snmp4j.agent.mo.snmp.*;
+import org.snmp4j.agent.mo.snmp.SnmpCommunityMIB.SnmpCommunityEntryRow;
 import org.snmp4j.agent.security.MutableVACM;
 import org.snmp4j.mp.MPv3;
 import org.snmp4j.mp.SnmpConstants;
@@ -252,7 +252,7 @@
                 new Integer32(StorageType.nonVolatile),  // storage type
                 new Integer32(RowStatus.active)          // row status
         };
-        MOTableRow row =
+        SnmpCommunityEntryRow row =
                 communityMIB.getSnmpCommunityEntry().createRow(
                         new OctetString(COMMUNITY_RECORD).toSubIndex(true), com2sec);
         communityMIB.getSnmpCommunityEntry().addRow(row);
diff --git a/java/modules/commons/src/main/java/org/apache/synapse/commons/util/TemporaryData.java b/java/modules/commons/src/main/java/org/apache/synapse/commons/util/TemporaryData.java
index 222cadd..920769c 100644
--- a/java/modules/commons/src/main/java/org/apache/synapse/commons/util/TemporaryData.java
+++ b/java/modules/commons/src/main/java/org/apache/synapse/commons/util/TemporaryData.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.commons.util;
 
 import org.apache.commons.io.IOUtils;
diff --git a/java/modules/core/pom.xml b/java/modules/core/pom.xml
index ab6c699..2eab891 100644
--- a/java/modules/core/pom.xml
+++ b/java/modules/core/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -84,12 +81,7 @@
                             <goal>attached</goal>
                         </goals>
                         <configuration>
-                            <finalName>synapse-test-lib</finalName>	
-                            <filters>
-                                <filter>
-                                    ${basedir}/src/test/resources/synapse-libraries/assembly/filter.properties
-                                </filter>
-                            </filters>
+                            <finalName>synapse</finalName>	
                             <descriptors>
                                 <descriptor>src/test/resources/synapse-libraries/assembly/assemble-lib.xml
                                 </descriptor>
@@ -103,12 +95,7 @@
                             <goal>attached</goal>
                         </goals>
                         <configuration>
-                            <finalName>synapse-eiptest-lib</finalName>
-                            <filters>
-                                <filter>
-                                    ${basedir}/src/test/resources/synapse-libraries/assembly/filter.properties
-                                </filter>
-                            </filters>
+                            <finalName>synapse</finalName>
                             <descriptors>
                                 <descriptor>src/test/resources/synapse-libraries/assembly/assemble-eiptest-lib.xml
                                 </descriptor>
@@ -122,12 +109,7 @@
                             <goal>attached</goal>
                         </goals>
                         <configuration>
-                            <finalName>synapse-eipcore-lib</finalName>
-                            <filters>
-                                <filter>
-                                    ${basedir}/src/test/resources/synapse-libraries/assembly/filter.properties
-                                </filter>
-                            </filters>
+                            <finalName>synapse</finalName>
                             <descriptors>
                                 <descriptor>src/test/resources/synapse-libraries/assembly/assemble-eipcore-lib.xml
                                 </descriptor>
@@ -146,37 +128,23 @@
                         <phase>generate-test-resources</phase>
                         <configuration>
                             <tasks>
-                                <echo message="*** Creating a testing repository ***"/>
-                                <mkdir dir="target/test_repos"/>
-                                <mkdir dir="target/test_repos/synapse/modules"/>
-                                <mkdir dir="target/test_repos/synapse/services"/>
-                                <mkdir dir="target/test_repos/client/modules"/>
-                                <mkdir dir="target/test_repos/synapse/synapse-libraries"/>
-                                <mkdir dir="target/library_repos"/>
-                                <copy file="target/synapse-test-lib.zip" todir="target/test_repos/synapse/synapse-libraries"/>
-                                <copy file="target/synapse-eiptest-lib.zip" todir="target/test_repos/synapse/synapse-libraries"/>
-                                <copy file="target/synapse-eipcore-lib.zip" todir="target/library_repos"/>
+                                <echo message="*** Creating a testing repository ***" />
+                                <mkdir dir="target/test_repos" />
+                                <mkdir dir="target/test_repos/synapse/modules" />
+                                <mkdir dir="target/test_repos/synapse/services" />
+                                <mkdir dir="target/test_repos/client/modules" />
+                                <mkdir dir="target/test_repos/synapse/synapse-libraries" />
+                                <mkdir dir="target/library_repos" />
+                                <copy file="target/synapse-test-lib.zip" todir="target/test_repos/synapse/synapse-libraries" />
+                                <copy file="target/synapse-eiptest-lib.zip" todir="target/test_repos/synapse/synapse-libraries" />
+                                <copy file="target/synapse-eipcore-lib.zip" todir="target/library_repos" />
                             </tasks>
                         </configuration>
                         <goals>
                             <goal>run</goal>
                         </goals>
                     </execution>
-                    <execution>
-                        <id>remove_test_lib</id>
-                        <phase>install</phase>
-                        <configuration>
-                            <tasks>
-                                <delete file="target/synapse-test-lib.zip"/>
-                                <delete file="target/synapse-eiptest-lib.zip"/>
-                                <delete file="target/synapse-eipcore-lib.zip"/>
-                            </tasks>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
+	    </executions>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -257,6 +225,10 @@
     
     <dependencies>
         <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-clustering</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.synapse</groupId>
             <artifactId>synapse-securevault</artifactId>
         </dependency>
@@ -319,6 +291,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-json</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.synapse</groupId>
             <artifactId>synapse-vfs-transport</artifactId>
             <scope>test</scope>
diff --git a/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java b/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java
index c8694b4..81d7971 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java
@@ -156,6 +156,14 @@
     public Object getEntry(String key);
 
     /**
+     * Get the value of a property set on the message instance or from the local registry
+     *
+     * @param key key to look up property
+     * @return value for the given key
+     */
+    public Object getLocalEntry(String key);
+
+    /**
      * Set a custom (local) property with the given name on the message instance
      * @param key key to be used
      * @param value value to be saved
diff --git a/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java b/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
index 700dc0c..3424f0a 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
@@ -234,7 +234,7 @@
          * this is the timeout for otherwise non-expiring callbacks
          * to ensure system stability over time
          */
-        public static final long DEFAULT_GLOBAL_TIMEOUT = 24 * 60 * 60 * 1000;
+        public static final long DEFAULT_GLOBAL_TIMEOUT = 3 * 60 * 1000;
 
         /**
          * don't do anything for response timeouts. this means infinite timeout. this is the default
diff --git a/java/modules/core/src/main/java/org/apache/synapse/aspects/statistics/StatisticsLog.java b/java/modules/core/src/main/java/org/apache/synapse/aspects/statistics/StatisticsLog.java
index e495f63..32acf24 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/aspects/statistics/StatisticsLog.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/aspects/statistics/StatisticsLog.java
@@ -61,6 +61,10 @@
         return time;

     }

 

+    public void setTime(long time) {

+        this.time = time;

+    }

+

     public boolean isResponse() {

         return isResponse;

     }

diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java b/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
index 4e770c1..0c7dee6 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
@@ -676,6 +676,23 @@
     }
 
     /**
+     * Get the resource from local registry
+     *
+     * @param key the key of the resource required
+     * @return value for the key
+     */
+    public Object getLocalRegistryEntry(String key) {
+        Object o = localRegistry.get(key);
+        if (o != null && o instanceof Entry) {
+            Entry entry = (Entry) o;
+            if (!entry.isDynamic()) {  // Skip dynamic entries
+                return entry.getValue();
+            }
+        }
+        return null;
+    }
+
+    /**
      * Get the resource with the given key
      *
      * @param key
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/ConfigurationFactoryAndSerializerFinder.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/ConfigurationFactoryAndSerializerFinder.java
index 6e50957..a76282c 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/ConfigurationFactoryAndSerializerFinder.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/ConfigurationFactoryAndSerializerFinder.java
@@ -26,16 +26,15 @@
 import org.apache.synapse.SynapseException;

 import org.apache.synapse.config.SynapseConfiguration;

 import org.apache.synapse.config.XMLToObjectMapper;

-import sun.misc.Service;

 

 import javax.xml.namespace.QName;

 import javax.xml.stream.XMLStreamException;

 

-import java.io.OutputStream;

 import java.util.HashMap;

 import java.util.Iterator;

 import java.util.Map;

 import java.util.Properties;

+import java.util.ServiceLoader;

 

 /**

  * This class is based on J2SE Service Provider model

@@ -106,22 +105,22 @@
         initialized = true;

     }

     /**

-     * Register plugable mediator factories from the classpath

+     * Register pluggable mediator factories from the classpath

      * <p/>

      * This looks for JAR files containing a META-INF/services that adheres to the following

-     * http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider

+     * https://docs.oracle.com/javase/tutorial/ext/basics/spi.html

      */

     private static void registerExtensions() {

 

+        Iterator<ConfigurationFactory> factories = ServiceLoader.load(ConfigurationFactory.class).iterator();

         // register MediatorFactory extensions

-        Iterator it = Service.providers(ConfigurationFactory.class);

-        while (it.hasNext()) {

-            ConfigurationFactory cf = (ConfigurationFactory) it.next();

-            QName tag = cf.getTagQName();

-            factoryMap.put(tag, cf.getClass());

-            serializerMap.put(tag, cf.getSerializerClass());

+        while (factories.hasNext()) {

+            ConfigurationFactory factory = factories.next();

+            QName tag = factory.getTagQName();

+            factoryMap.put(tag, factory.getClass());

+            serializerMap.put(tag, factory.getSerializerClass());

             if (log.isDebugEnabled()) {

-                log.debug("Added MediatorFactory " + cf.getClass() + " to handle " + tag);

+                log.debug("Added MediatorFactory " + factory.getClass() + " to handle " + tag);

             }

         }

     }

diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java
index 4c726fd..e9d5ae0 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java
@@ -106,19 +106,14 @@
 
             if (value != null) {
                 String strValue = value.getAttributeValue();
-                String prefix = null;
-                String name = null;
-                if (strValue.indexOf(":") != -1) {
-                    prefix = strValue.substring(0, strValue.indexOf(":"));
-                    name = strValue.substring(strValue.indexOf(":")+1);
-                } else {
+                QName qname = code.resolveQName(strValue);
+                if (qname == null) {
+                    handleException("Invalid QName '" + strValue + "' in code attribute");
+                } else if (qname.getNamespaceURI().isEmpty()) {
                     handleException("A QName is expected for fault code as prefix:name");
+                } else {
+                    faultMediator.setFaultCodeValue(qname);
                 }
-                String namespaceURI = OMElementUtils.getNameSpaceWithPrefix(prefix, code);
-                if (namespaceURI == null) {
-                    handleException("Invalid namespace prefix '" + prefix + "' in code attribute");
-                }
-                faultMediator.setFaultCodeValue(new QName(namespaceURI, name, prefix));
             } else if (expression != null) {
                 try {
                     faultMediator.setFaultCodeExpr(
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java
index 80bbff4..2d70eab 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java
@@ -48,6 +48,7 @@
 
     private static final QName HEADER_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "header");
     private static final QName ATT_ACTION = new QName("action");
+    private static final QName ATT_SCOPE = new QName("scope");
 
     public Mediator createSpecificMediator(OMElement elem, Properties properties) {
 
@@ -56,40 +57,44 @@
         OMAttribute value  = elem.getAttribute(ATT_VALUE);
         OMAttribute exprn  = elem.getAttribute(ATT_EXPRN);
         OMAttribute action = elem.getAttribute(ATT_ACTION);
+        OMAttribute scope = elem.getAttribute(ATT_SCOPE);
 
+        // Setting Header Name
         if (name == null || name.getAttributeValue() == null) {
-            if (elem.getChildElements() == null || !elem.getChildElements().hasNext()) {
-                String msg = "A valid name attribute is required for the header mediator";
-                log.error(msg);
-                throw new SynapseException(msg);
+            // Name is required unless otherwise we are setting an embedded XML
+            if (!isEmbeddedXML(elem)) {
+                handleException("A valid name attribute is required for the header mediator");
             }
         } else {
-            String nameAtt = name.getAttributeValue();
-            int colonPos = nameAtt.indexOf(":");
-            if (colonPos != -1) {
-                // has a NS prefix.. find it and the NS it maps into
-                String prefix = nameAtt.substring(0, colonPos);
-                String namespaceURI = OMElementUtils.getNameSpaceWithPrefix(prefix, elem);
-                if (namespaceURI == null) {
-                    handleException("Invalid namespace prefix '" + prefix + "' in name attribute");
-                } else {
-                	headerMediator.setQName(new QName(namespaceURI, nameAtt.substring(colonPos+1),
-                            prefix));
-                }
-            } else {
-                // no prefix
+
+            if (scope == null) {
+                String nameAtt = name.getAttributeValue();
+
+                // Known Headers
                 if (SynapseConstants.HEADER_TO.equals(nameAtt) ||
-                        SynapseConstants.HEADER_FROM.equals(nameAtt) ||
-                        SynapseConstants.HEADER_ACTION.equals(nameAtt) ||
-                        SynapseConstants.HEADER_FAULT.equals(nameAtt) ||
-                        SynapseConstants.HEADER_REPLY_TO.equals(nameAtt) ||
-                        SynapseConstants.HEADER_RELATES_TO.equals(nameAtt)) {
+                    SynapseConstants.HEADER_FROM.equals(nameAtt) ||
+                    SynapseConstants.HEADER_ACTION.equals(nameAtt) ||
+                    SynapseConstants.HEADER_FAULT.equals(nameAtt) ||
+                    SynapseConstants.HEADER_REPLY_TO.equals(nameAtt) ||
+                    SynapseConstants.HEADER_RELATES_TO.equals(nameAtt)) {
 
                     headerMediator.setQName(new QName(nameAtt));
                 } else {
-                    handleException("Invalid SOAP header: " + nameAtt + " specified at the " +
-                            "header mediator. All SOAP headers must be namespace qualified.");
+                    // SOAP Headers
+                    setSOAPHeader(headerMediator, elem, name);
                 }
+            } else {
+                String scopeAttValue = scope.getAttributeValue();
+
+                if (XMLConfigConstants.HEADER_SCOPE_SOAP.equalsIgnoreCase(scopeAttValue)) {
+                    setSOAPHeader(headerMediator, elem, name);
+                } else if (XMLConfigConstants.HEADER_SCOPE_TRANSPORT.equalsIgnoreCase(scopeAttValue)) {
+                    headerMediator.setQName(new QName(name.getAttributeValue()));
+                } else {
+                    handleException("Unsupported Scope : " + scopeAttValue + " . Only " + XMLConfigConstants.HEADER_SCOPE_SOAP
+                                    + " and " + XMLConfigConstants.HEADER_SCOPE_TRANSPORT + " allowed");
+                }
+                headerMediator.setScope(scopeAttValue);
             }
         }
 
@@ -132,6 +137,23 @@
         return headerMediator;
     }
 
+    private void setSOAPHeader(HeaderMediator headerMediator, OMElement elem, OMAttribute name) {
+        String nameAtt = name.getAttributeValue();
+        QName qname = elem.resolveQName(nameAtt);
+        if (qname == null) {
+            handleException("Invalid QName '" + nameAtt + "' in name attribute");
+        } else if (qname.getNamespaceURI().isEmpty()) {
+            handleException("Invalid SOAP header: " + nameAtt + " specified at the " +
+                    "header mediator. All SOAP headers must be namespace qualified.");
+        } else {
+            headerMediator.setQName(qname);
+        }
+    }
+
+    private boolean isEmbeddedXML(OMElement elem) {
+        return (elem.getChildElements() != null && elem.getChildElements().hasNext());
+    }
+
     public QName getTagQName() {
         return HEADER_Q;
     }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java
index 22b5ca1..3d60548 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java
@@ -76,6 +76,10 @@
             }
         }
 
+        if (mediator.getScope() != null) {
+            header.addAttribute(fac.createOMAttribute("scope", nullNS, mediator.getScope()));
+        }
+
         if (mediator.hasEmbeddedXml()) {
             for (OMElement e : mediator.getEmbeddedXml()) {
                 header.addChild(e);
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/LoopbackMediatorFactory.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/LoopbackMediatorFactory.java
new file mode 100644
index 0000000..d112b4c
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/LoopbackMediatorFactory.java
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.synapse.config.xml;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.synapse.Mediator;
+import org.apache.synapse.mediators.builtin.LoopbackMediator;
+
+import javax.xml.namespace.QName;
+import java.util.Properties;
+
+public class LoopbackMediatorFactory extends AbstractMediatorFactory {
+
+    private static final QName LoopBack_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "loopback");
+
+    @Override
+    protected Mediator createSpecificMediator(OMElement elem, Properties properties) {
+        Mediator loopBackMediator = new LoopbackMediator();
+        processAuditStatus(loopBackMediator, elem);
+        return loopBackMediator;
+    }
+
+    public QName getTagQName() {
+        return LoopBack_Q;
+    }
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/LoopbackMediatorSerializer.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/LoopbackMediatorSerializer.java
new file mode 100644
index 0000000..81dae16
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/LoopbackMediatorSerializer.java
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.synapse.config.xml;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.synapse.Mediator;
+import org.apache.synapse.mediators.builtin.LoopbackMediator;
+
+
+public class LoopbackMediatorSerializer extends AbstractMediatorSerializer {
+
+    @Override
+    protected OMElement serializeSpecificMediator(Mediator m) {
+        if (!(m instanceof LoopbackMediator)) {
+            handleException("Unsupported mediator passed in for serialization : " + m.getType());
+        }
+
+        LoopbackMediator mediator = (LoopbackMediator) m;
+        OMElement loopBack = fac.createOMElement("loopback", synNS);
+        saveTracingState(loopBack, mediator);
+        return loopBack;
+    }
+
+    public String getMediatorClassName() {
+        return LoopbackMediator.class.getName();
+    }
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java
index 18498f2..5b629df 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java
@@ -28,13 +28,13 @@
 import org.apache.synapse.Mediator;
 import org.apache.synapse.config.XMLToObjectMapper;
 import org.apache.synapse.config.xml.eventing.EventPublisherMediatorFactory;
-import sun.misc.Service;
 
 import javax.xml.namespace.QName;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
+import java.util.ServiceLoader;
 
 /**
  *
@@ -84,7 +84,9 @@
         InvokeMediatorFactory.class,
         PayloadFactoryMediatorFactory.class,
         BeanMediatorFactory.class,
-        EJBMediatorFactory.class
+        EJBMediatorFactory.class,
+        RespondMediatorFactory.class,
+        LoopbackMediatorFactory.class
     };
 
     private final static MediatorFactoryFinder instance  = new MediatorFactoryFinder();
@@ -132,18 +134,18 @@
      * Register pluggable mediator factories from the classpath
      *
      * This looks for JAR files containing a META-INF/services that adheres to the following
-     * http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider
+     * https://docs.oracle.com/javase/tutorial/ext/basics/spi.html
      */
     private static void registerExtensions() {
 
         // register MediatorFactory extensions
-        Iterator it = Service.providers(MediatorFactory.class);
-        while (it.hasNext()) {
-            MediatorFactory mf = (MediatorFactory) it.next();
-            QName tag = mf.getTagQName();
-            factoryMap.put(tag, mf.getClass());
+        Iterator<MediatorFactory> factories = ServiceLoader.load(MediatorFactory.class).iterator();
+        while (factories.hasNext()) {
+            MediatorFactory factory = factories.next();
+            QName tag = factory.getTagQName();
+            factoryMap.put(tag, factory.getClass());
             if (log.isDebugEnabled()) {
-                log.debug("Added MediatorFactory " + mf.getClass() + " to handle " + tag);
+                log.debug("Added MediatorFactory " + factory.getClass() + " to handle " + tag);
             }
         }
     }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java
index 958c84a..5cec0e3 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.config.xml;
 
 import org.apache.axiom.om.OMElement;
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java
index 75ee721..95e9a77 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java
@@ -24,11 +24,12 @@
 import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.config.xml.eventing.EventPublisherMediatorSerializer;
-import sun.misc.Service;
+import org.apache.synapse.mediators.builtin.RespondMediator;
 
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.ServiceLoader;
 
 public class MediatorSerializerFinder {
 
@@ -70,7 +71,9 @@
         URLRewriteMediatorSerializer.class,
         PayloadFactoryMediatorSerializer.class,
         BeanMediatorSerializer.class,
-        EJBMediatorSerializer.class
+        EJBMediatorSerializer.class,
+        RespondMediatorSerializer.class,
+        LoopbackMediatorSerializer.class
     };
 
     private final static MediatorSerializerFinder instance = new MediatorSerializerFinder();
@@ -106,26 +109,27 @@
      * Register pluggable mediator serializers from the classpath
      *
      * This looks for JAR files containing a META-INF/services that adheres to the following
-     * http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider
+     * https://docs.oracle.com/javase/tutorial/ext/basics/spi.html
      */
     private void registerExtensions() {
         if (log.isDebugEnabled()) {
             log.debug("Registering mediator extensions found in the classpath.. ");
         }
         // register MediatorSerializer extensions
-        Iterator it = Service.providers(MediatorSerializer.class);
-        while (it.hasNext()) {
-            MediatorSerializer ms = (MediatorSerializer) it.next();
-            String name = ms.getMediatorClassName();
+        Iterator<MediatorSerializer> serializers = ServiceLoader.load(MediatorSerializer.class).iterator();
+
+        while (serializers.hasNext()) {
+            MediatorSerializer serializer = serializers.next();
+            String name = serializer.getMediatorClassName();
             try {
-                serializerMap.put(name, ms.getClass().newInstance());
+                serializerMap.put(name, serializer.getClass().newInstance());
             } catch (InstantiationException e) {
-                handleException("Error instantiating mediator serializer : " + ms);
+                handleException("Error instantiating mediator serializer : " + serializer);
             } catch (IllegalAccessException e) {
-                handleException("Error instantiating mediator serializer : " + ms);
+                handleException("Error instantiating mediator serializer : " + serializer);
             }
             if (log.isDebugEnabled()) {
-                log.debug("Added MediatorSerializer " + ms.getClass().getName() + " to handle " + name);
+                log.debug("Added MediatorSerializer " + serializer.getClass().getName() + " to handle " + name);
             }
         }
     }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/OMElementUtils.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/OMElementUtils.java
index 9967b52..416c0a3 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/OMElementUtils.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/OMElementUtils.java
@@ -19,11 +19,9 @@
 
 package org.apache.synapse.config.xml;
 
-import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
 import org.jaxen.JaxenException;
 import org.jaxen.XPath;
@@ -34,39 +32,6 @@
  * Holds Axiom utility methods used by Synapse
  */
 public class OMElementUtils {
-
-    private static final Log log = LogFactory.getLog(OMElementUtils.class);
-
-    /**
-     * Return the namespace with the given prefix, using the given element
-     * @param prefix the prefix looked up
-     * @param elem the source element to use
-     * @return the namespace which maps to the prefix or null
-     */
-    public static String getNameSpaceWithPrefix(String prefix, OMElement elem) {
-        if (prefix == null || elem == null) {
-            log.warn("Searching for null NS prefix and/or using null OMElement");
-            return null;
-        }
-        
-        OMElement currentElem = elem;
-        while (true) {
-            Iterator iter = currentElem.getAllDeclaredNamespaces();
-            while (iter.hasNext()) {
-                OMNamespace ns = (OMNamespace) iter.next();
-                if (prefix.equals(ns.getPrefix())) {
-                    return ns.getNamespaceURI();     
-                }
-            }
-            OMContainer parent = currentElem.getParent();
-            if (parent != null && parent instanceof OMElement) {
-                currentElem = (OMElement)parent;
-            } else {
-                return null;
-            }
-        }
-    }
-
     /**
      * Add the namespace declarations of a given {@link OMElement} to the namespace
      * context of an XPath expression. Typically this method is used with an XPath
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java
index 7f0ffc8..e5df84a 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java
@@ -81,7 +81,8 @@
         if (value != null) {
             propMediator.setValue(value.getAttributeValue(), dataType);
         } else if (valueElement != null) {
-            propMediator.setValueElement(valueElement);
+            propMediator.setValueElement(valueElement.cloneOMElement()); // Need to clone,
+            // otherwise same reference getting modified at the message flow
         } else if (expression != null) {
             try {
                 propMediator.setExpression(SynapseXPathFactory.getSynapseXPath(elem, ATT_EXPRN),
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/RespondMediatorFactory.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/RespondMediatorFactory.java
new file mode 100644
index 0000000..9cd156d
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/RespondMediatorFactory.java
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.config.xml;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.synapse.Mediator;
+import org.apache.synapse.mediators.builtin.RespondMediator;
+
+import javax.xml.namespace.QName;
+import java.util.Properties;
+
+/**
+ * Factory for {@link RespondMediator} instances.
+ * <p/>
+ * Configuration syntax:
+ * <pre>
+ * &lt;respond/&gt;
+ * </pre>
+ */
+public class RespondMediatorFactory extends AbstractMediatorFactory {
+    private static final QName Respond_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "respond");
+
+    @Override
+    protected Mediator createSpecificMediator(OMElement omElement, Properties properties) {
+        Mediator responseMediator = new RespondMediator();
+        processAuditStatus(responseMediator, omElement);
+        return responseMediator;
+    }
+
+    public QName getTagQName() {
+        return Respond_Q;
+    }
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/RespondMediatorSerializer.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/RespondMediatorSerializer.java
new file mode 100644
index 0000000..4f50330
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/RespondMediatorSerializer.java
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.config.xml;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.synapse.Mediator;
+import org.apache.synapse.mediators.builtin.RespondMediator;
+
+/**
+ * Serializer for {@link RespondMediator} instances.
+ *
+ * @see RespondMediator
+ */
+public class RespondMediatorSerializer extends AbstractMediatorSerializer{
+
+    public OMElement serializeSpecificMediator(Mediator m) {
+        if (!(m instanceof RespondMediator)) {
+            handleException("Unsupported mediator passed in for serialization : " + m.getType());
+        }
+        RespondMediator mediator = (RespondMediator) m;
+        OMElement respond = fac.createOMElement("respond", synNS);
+        saveTracingState(respond, mediator);
+        return respond;
+    }
+
+    public String getMediatorClassName() {
+        return RespondMediator.class.getName();
+    }
+}
\ No newline at end of file
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java
index 962a63d..6b8199c 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java
@@ -23,6 +23,7 @@
 import java.util.Iterator;

 import java.util.Map;

 import java.util.Properties;

+import java.util.ServiceLoader;

 

 import javax.xml.namespace.QName;

 

@@ -34,8 +35,6 @@
 import org.apache.synapse.config.XMLToObjectMapper;

 import org.apache.synapse.startup.quartz.SimpleQuartzFactory;

 

-import sun.misc.Service;

-

 public class StartupFinder implements XMLToObjectMapper {

 

     private static final Log log = LogFactory

@@ -100,27 +99,22 @@
     }

 

     /**

-     * Register pluggable mediator factories from the classpath

+     * Register pluggable startup factories from the classpath

      * <p/>

-     * This looks for JAR files containing a META-INF/services that adheres to

-     * the following

-     * http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider

+     * This looks for JAR files containing a META-INF/services that adheres to the following

+     * https://docs.oracle.com/javase/tutorial/ext/basics/spi.html

      */

     private static void registerExtensions() {

 

-        // log.debug("Registering mediator extensions found in the classpath : "

-        // + System.getResource("java.class.path"));

-

         // register MediatorFactory extensions

-        Iterator<?> it = Service.providers(StartupFactory.class);

-        while (it.hasNext()) {

-            StartupFactory sf = (StartupFactory) it.next();

-            QName tag = sf.getTagQName();

-            factoryMap.put(tag, sf.getClass());

-            serializerMap.put(tag, sf.getSerializerClass());

+        Iterator<StartupFactory> factories = ServiceLoader.load(StartupFactory.class).iterator();

+        while (factories.hasNext()) {

+            StartupFactory factory = factories.next();

+            QName tag = factory.getTagQName();

+            factoryMap.put(tag, factory.getClass());

+            serializerMap.put(tag, factory.getSerializerClass());

             if (log.isDebugEnabled()) {

-                log.debug("Added StartupFactory " + sf.getClass()

-                        + " to handle " + tag);

+                log.debug("Added StartupFactory " + factory.getClass() + " to handle " + tag);

             }

         }

     }

diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/ValueFactory.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/ValueFactory.java
index 88bb81c..8a13f0c 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/ValueFactory.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/ValueFactory.java
@@ -21,11 +21,9 @@
 
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
-import org.apache.synapse.config.SynapseConfigUtils;
 import org.apache.synapse.mediators.Value;
 import org.apache.synapse.util.xpath.SynapseXPath;
 import org.jaxen.JaxenException;
diff --git a/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigConstants.java b/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigConstants.java
index aa246d6..993f292 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigConstants.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigConstants.java
@@ -47,10 +47,15 @@
     public static final String SCOPE_TRANSPORT = "transport";
     /** The scope name for registry properties */
     public static final String SCOPE_REGISTRY = "registry";
-
     /** The scope name for the system properties  */
     public static final String SCOPE_SYSTEM = "system";
 
+    //-- HeaderMediator --
+    /** The scope name for SOAP headers */
+    public static final String HEADER_SCOPE_SOAP = "soap";
+    /** The scope name for Transport headers */
+    public static final String HEADER_SCOPE_TRANSPORT = "transport";
+
     public static final String KEY = "key";
     public static final String RECEIVE = "receive";
 
diff --git a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
index 0512002..d69b248 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
@@ -199,6 +199,20 @@
         }
     }
 
+    public Object getLocalEntry(String key) {
+        Object o = localEntries.get(key);
+        if (o != null && o instanceof Entry) {
+            return ((Entry) o).getValue();
+        } else {
+            Object e = getConfiguration().getLocalRegistryEntry(key);
+            if (e != null) {
+                localEntries.put(key, e);
+                return e;
+            }
+        }
+        return null;
+    }
+
     /**
      * Get a read-only view of all the properties currently set on this
      * message context
diff --git a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java
index e3e8aa2..7c37bb6 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java
@@ -235,12 +235,14 @@
 
                     if (resenvelope != null) {
                         responseMessageContext.setEnvelope(resenvelope);
-                        AxisEngine.receive(responseMessageContext);
-                        if (responseMessageContext.getReplyTo() != null) {
-                            sc.setTargetEPR(responseMessageContext.getReplyTo());
+                        try {
+                            AxisEngine.receive(responseMessageContext);
+                            if (responseMessageContext.getReplyTo() != null) {
+                                sc.setTargetEPR(responseMessageContext.getReplyTo());
+                            }
+                        } finally {
+                            complete(msgctx);
                         }
-
-                        complete(msgctx);
                     } else {
                         throw new AxisFault(
                                 Messages.getMessage("blockingInvocationExpectsResponse"));
diff --git a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
index 5063e8c..dae8fa6 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
@@ -33,6 +33,7 @@
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.http.nio.NHttpServerConnection;
 import org.apache.synapse.FaultHandler;
 import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.SynapseException;
@@ -45,6 +46,9 @@
 import org.apache.synapse.endpoints.Endpoint;
 import org.apache.synapse.endpoints.dispatch.Dispatcher;
 import org.apache.synapse.transport.nhttp.NhttpConstants;
+import org.apache.synapse.transport.passthru.PassThroughConstants;
+import org.apache.synapse.transport.passthru.Pipe;
+import org.apache.synapse.transport.passthru.config.SourceConfiguration;
 import org.apache.synapse.util.ResponseAcceptEncodingProcessor;
 
 import java.util.*;
@@ -249,6 +253,19 @@
         Object o = response.getProperty(SynapseConstants.SENDING_FAULT);
         if (o != null && Boolean.TRUE.equals(o)) {
 
+            Pipe pipe = (Pipe) ((Axis2MessageContext) synapseOutMsgCtx).getAxis2MessageContext()
+                    .getProperty(PassThroughConstants.PASS_THROUGH_PIPE);
+            if (pipe != null && pipe.isSerializationComplete()) {
+                NHttpServerConnection conn = (NHttpServerConnection) ((Axis2MessageContext) synapseOutMsgCtx).
+                        getAxis2MessageContext().getProperty(PassThroughConstants.PASS_THROUGH_SOURCE_CONNECTION);
+                SourceConfiguration sourceConfiguration = (SourceConfiguration) ((Axis2MessageContext) synapseOutMsgCtx)
+                        .getAxis2MessageContext().getProperty(PassThroughConstants.PASS_THROUGH_SOURCE_CONFIGURATION);
+                Pipe newPipe = new Pipe(conn, sourceConfiguration.getBufferFactory().getBuffer(),
+                        PassThroughConstants.SOURCE, sourceConfiguration);
+                ((Axis2MessageContext) synapseOutMsgCtx).getAxis2MessageContext()
+                        .setProperty(PassThroughConstants.PASS_THROUGH_PIPE, newPipe);
+            }
+
             StatisticsReporter.reportFaultForAll(synapseOutMsgCtx,
                     ErrorLogFactory.createErrorLog(response));
             // there is a sending fault. propagate the fault to fault handlers.
diff --git a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreView.java b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreView.java
index 077075a..f24cc65 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreView.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreView.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.core.axis2;
 
 public class SynapseCallbackStoreView implements SynapseCallbackStoreViewMBean {
diff --git a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreViewMBean.java b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreViewMBean.java
index 5fad518..f007804 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreViewMBean.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackStoreViewMBean.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.core.axis2;
 
 /**
diff --git a/java/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java b/java/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java
index 3585f43..be4a325 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java
@@ -585,9 +585,14 @@
     }
 
     public void destroy() {
+        if (metricsMBean != null) {
+            metricsMBean.destroy();
+        }
+
         if (enableMBeanStats) {
             MBeanRegistrar.getInstance().unRegisterMBean("Endpoint", endpointName);
         }
+        metricsMBean = null;
         this.initialized = false;
     }
 
diff --git a/java/modules/core/src/main/java/org/apache/synapse/endpoints/EndpointView.java b/java/modules/core/src/main/java/org/apache/synapse/endpoints/EndpointView.java
index 4d17a66..4303699 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/endpoints/EndpointView.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/endpoints/EndpointView.java
@@ -114,6 +114,8 @@
 
     public void destroy() {
         future.cancel(true);
+        suspensionCounts.clear();
+        timeoutCounts.clear();
     }
 
     // --- endpoint control ---
diff --git a/java/modules/core/src/main/java/org/apache/synapse/endpoints/RecipientListEndpoint.java b/java/modules/core/src/main/java/org/apache/synapse/endpoints/RecipientListEndpoint.java
index 7450ee4..177493d 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/endpoints/RecipientListEndpoint.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/endpoints/RecipientListEndpoint.java
@@ -26,6 +26,7 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.clustering.Member;
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.MessageContext;
@@ -155,7 +156,8 @@
         }
         List<Endpoint> children = new ArrayList<Endpoint>();
         for (String url : dynamicUrlSet) {
-            if (url != null && !"".equals(url.trim())) {
+            url = StringUtils.deleteWhitespace(url);
+            if (StringUtils.isNotEmpty(url)) {
                 //get an Endpoint from the pool
                 Endpoint epFromPool = dynamicEndpointPool.get(url);
                 if (epFromPool == null) {
diff --git a/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/WeightedRRLCAlgorithm.java b/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/WeightedRRLCAlgorithm.java
index bdf0c9d..1d7327b 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/WeightedRRLCAlgorithm.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/WeightedRRLCAlgorithm.java
@@ -237,6 +237,7 @@
         return WeightedRRLCAlgorithm.class.getName();
     }
 
+    @Override
     public LoadbalanceAlgorithm clone() {
         return null;
     }
@@ -392,13 +393,7 @@
         public void reCalcuateWeight() {
             if (totalConnections > 0) {
                 double weightRatio = (double) fixedWeight / totalWeight;
-                double connectionRatio;
-                if (totalConnections != 0) {
-                    connectionRatio = (double) currentConnectionCount / totalConnections;
-                } else {
-                    connectionRatio = 0;
-                }
-
+                double connectionRatio = (double) currentConnectionCount / totalConnections;
                 double diff = weightRatio - connectionRatio;
                 double multiple = diff * totalConnections;
                 double floor = Math.floor(multiple);
diff --git a/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseEventSource.java b/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseEventSource.java
index 018f917..8f94bca 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseEventSource.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseEventSource.java
@@ -273,9 +273,9 @@
                 log.debug("SynapseSubscription Failed, sending fault response");
             }
             SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
-                    SubscriptionMessageBuilder.getErrorCode(),
-                    SubscriptionMessageBuilder.getErrorSubCode(),
-                    SubscriptionMessageBuilder.getErrorReason(), "");
+                                                                        subscription.getErrorCode(),
+                                                                        subscription.getErrorSubCode(),
+                                                                        subscription.getErrorReason(), "");
             dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc,
                     true);
         }
@@ -402,9 +402,9 @@
             }
         } else {
             SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
-                    SubscriptionMessageBuilder.getErrorCode(),
-                    SubscriptionMessageBuilder.getErrorSubCode(),
-                    SubscriptionMessageBuilder.getErrorReason(), "");
+                                                                        subscription.getErrorCode(),
+                                                                        subscription.getErrorSubCode(),
+                                                                        subscription.getErrorReason(), "");
             dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc, true);
         }
     }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseSubscription.java b/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseSubscription.java
index 417092f..a55cc85 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseSubscription.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/eventing/SynapseSubscription.java
@@ -32,6 +32,10 @@
 public class SynapseSubscription extends Subscription {
 
 
+    private String errorSubCode = null;
+    private String errorReason = null;
+    private String errorCode = null;
+
     public SynapseSubscription() {
         this.setId(UIDGenerator.generateURNString());
         this.setDeliveryMode(EventingConstants.WSE_DEFAULT_DELIVERY_MODE);
@@ -44,4 +48,28 @@
         this.setId(UIDGenerator.generateURNString());
         this.setDeliveryMode(deliveryMode);
     }
+
+    public String getErrorSubCode() {
+        return errorSubCode;
+    }
+
+    public void setErrorSubCode(String errorCode) {
+        errorSubCode = errorCode;
+    }
+
+    public String getErrorReason() {
+        return errorReason;
+    }
+
+    public void setErrorReason(String errorReasons) {
+        errorReason = errorReasons;
+    }
+
+    public String getErrorCode() {
+        return errorCode;
+    }
+
+    public void setErrorCode(String errorCodes) {
+        errorCode = errorCodes;
+    }
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java b/java/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java
index ff51209..5513ad5 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java
@@ -57,10 +57,6 @@
     private static final QName RENEW =
             new QName(EventingConstants.WSE_EVENTING_NS, EventingConstants.WSE_EN_RENEW);
 
-    private static String errorSubCode = null;
-    private static String errorReason = null;
-    private static String errorCode = null;
-
     /**
      * (01) <s12:Envelope
      * (02)     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
@@ -336,34 +332,10 @@
         throw new SynapseException(message);
     }
 
-    public static String getErrorSubCode() {
-        return errorSubCode;
-    }
-
-    public static void setErrorSubCode(String errorCode) {
-        errorSubCode = errorCode;
-    }
-
-    public static String getErrorReason() {
-        return errorReason;
-    }
-
-    public static void setErrorReason(String errorReasons) {
-        errorReason = errorReasons;
-    }
-
-    public static String getErrorCode() {
-        return errorCode;
-    }
-
-    public static void setErrorCode(String errorCodes) {
-        errorCode = errorCodes;
-    }
-
     private static void setExpirationFault(SynapseSubscription subscription) {
-        setErrorCode(EventingConstants.WSE_FAULT_CODE_SENDER);
-        setErrorSubCode("InvalidExpirationTime");
-        setErrorReason("The expiration time requested is invalid");
+        subscription.setErrorCode(EventingConstants.WSE_FAULT_CODE_SENDER);
+        subscription.setErrorSubCode("InvalidExpirationTime");
+        subscription.setErrorReason("The expiration time requested is invalid");
         subscription.setId(null);
     }
 
diff --git a/java/modules/core/src/main/java/org/apache/synapse/libraries/eip/EIPUtils.java b/java/modules/core/src/main/java/org/apache/synapse/libraries/eip/EIPUtils.java
index 0652377..7ee6987 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/libraries/eip/EIPUtils.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/libraries/eip/EIPUtils.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.libraries.eip;
 
 import org.apache.synapse.MessageContext;
diff --git a/java/modules/core/src/main/java/org/apache/synapse/libraries/util/LibDeployerUtils.java b/java/modules/core/src/main/java/org/apache/synapse/libraries/util/LibDeployerUtils.java
index 2e70a90..1cd779f 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/libraries/util/LibDeployerUtils.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/libraries/util/LibDeployerUtils.java
@@ -434,14 +434,14 @@
             if (entry.getName().startsWith("META-INF/")) {
                 continue;
             }
-            // if the entry is a directory, create a new dir
+            // Skip directories
             if (entry.isDirectory()) {
-                createDir(destPath + entry.getName());
                 continue;
             }
-            // if the entry is a file, write the file
+            File dest = new File(destPath, entry.getName());
+            dest.getParentFile().mkdirs();
             copyInputStream(zipFile.getInputStream(entry),
-                            new BufferedOutputStream(new FileOutputStream(destPath + entry.getName())));
+                            new BufferedOutputStream(new FileOutputStream(dest)));
         }
         zipFile.close();
     }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java
index d7486fb..e0869e6 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java
@@ -19,10 +19,7 @@
 
 package org.apache.synapse.mediators;
 
-import org.apache.synapse.ManagedLifecycle;
-import org.apache.synapse.Mediator;
-import org.apache.synapse.MessageContext;
-import org.apache.synapse.SynapseLog;
+import org.apache.synapse.*;
 import org.apache.synapse.core.SynapseEnvironment;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.transport.passthru.util.RelayUtils;
@@ -59,7 +56,7 @@
 
             if (contentAware) {
                 try {
-                    RelayUtils.buildMessage(((Axis2MessageContext) synCtx).getAxis2MessageContext(),false);
+                    RelayUtils.buildMessage(((Axis2MessageContext) synCtx).getAxis2MessageContext(), false);
                 } catch (Exception e) {
                     handleException("Error while building message", e, synCtx);
                 }
@@ -72,6 +69,10 @@
                     return false;
                 }
             }
+        } catch (SynapseException e) {
+            throw e;
+        } catch (Exception e) {
+            handleException("Runtime error occurred while mediating the message", e, synCtx);
         } finally {
             synCtx.setTracingState(parentsEffectiveTraceState);
         }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
index d4cd4a6..65fbd34 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
@@ -267,7 +267,7 @@
                 if (result != null) {
                     return result;
                 } else {
-                    return synCtx.getEntry(key);
+                    return synCtx.getLocalEntry(key);
                 }
             }
         } else if (XMLConfigConstants.SCOPE_AXIS2.equals(scope)
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LoopbackMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LoopbackMediator.java
new file mode 100644
index 0000000..bc11eb0
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LoopbackMediator.java
@@ -0,0 +1,54 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.synapse.mediators.builtin;
+
+import org.apache.synapse.MessageContext;
+import org.apache.synapse.SynapseLog;
+import org.apache.synapse.mediators.AbstractMediator;
+
+public class LoopbackMediator extends AbstractMediator {
+
+    public boolean mediate(MessageContext synCtx) {
+
+        SynapseLog synLog = getLog(synCtx);
+
+        if (synLog.isTraceOrDebugEnabled()) {
+            synLog.traceOrDebug("Start : Loopback Mediator");
+            if (synLog.isTraceTraceEnabled()) {
+                synLog.traceTrace("Message : " + synCtx.getEnvelope());
+            }
+        }
+
+        if (!synCtx.isResponse()) {
+            synCtx.setResponse(true);
+            synCtx.setTo(null);
+            synCtx.getEnvironment().injectMessage(synCtx);
+        }
+
+        if (synLog.isTraceOrDebugEnabled()) {
+            synLog.traceOrDebug("End : Loopback Mediator");
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isContentAware() {
+        return false;
+    }
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java
index 02c3f97..110af76 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java
@@ -288,7 +288,8 @@
         if (value != null) {
             return value;
         } else if (valueElement != null) {
-            return valueElement;
+            // Need to take a clone of the element, otherwise same reference is shared across all the requests
+            return valueElement.cloneOMElement();
         } else {
             return convertValue(expression.stringValueOf(synCtx), type);
         }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RespondMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RespondMediator.java
new file mode 100644
index 0000000..5605210
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RespondMediator.java
@@ -0,0 +1,70 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.mediators.builtin;
+
+import org.apache.synapse.MessageContext;
+import org.apache.synapse.SynapseLog;
+import org.apache.synapse.core.axis2.Axis2Sender;
+import org.apache.synapse.mediators.AbstractMediator;
+
+/**
+ * Halts further processing/mediation of the current message and return the current message back to client
+ * This Mediator reduce the number of configuration element need to build an echo service from ESB.
+ */
+public class RespondMediator extends AbstractMediator {
+
+    /**
+     * Halts further processing/mediation of the current message and return the current message back to client.
+     *
+     * @param synCtx the current message for mediation
+     * @return false
+     */
+    public boolean mediate(MessageContext synCtx) {
+        SynapseLog synapseLog = getLog(synCtx);
+
+        boolean isTraceOrDebugEnabled = synapseLog.isTraceOrDebugEnabled();
+        if (isTraceOrDebugEnabled) {
+            synapseLog.traceOrDebug("Start : Respond mediator");
+
+            if (synapseLog.isTraceTraceEnabled()) {
+                synapseLog.traceOrDebug("Message : " + synCtx.getEnvelope());
+            }
+        }
+
+        synCtx.setTo(null);
+        synCtx.setResponse(true);
+        Axis2Sender.sendBack(synCtx);
+
+        if (isTraceOrDebugEnabled) {
+            synapseLog.traceOrDebug("End : Respond Mediator");
+        }
+        return false;
+    }
+
+    /**
+     * Since this Mediator does not touch the content of the message Content Aware property is set into False.
+     *
+     * @return false
+     */
+    @Override
+    public boolean isContentAware() {
+        return false;
+    }
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBLookupMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBLookupMediator.java
index 66f98f2..27e69d3 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBLookupMediator.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBLookupMediator.java
@@ -85,8 +85,12 @@
             
         } catch (SQLException e) {
             handleException("Error executing statement : " + stmnt.getRawStatement() +
-                " against DataSource : " + getDSName(), e, msgCtx);
-        } finally {
+                    " against DataSource : " + getDSName(), e, msgCtx);
+        } catch (Exception e) {
+            handleException("Error executing statement : " + stmnt.getRawStatement() +
+                    " against DataSource : " + getDSName(), e, msgCtx);
+        }
+        finally {
             if (rs != null) {
                 try {
                     rs.close();
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBReportMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBReportMediator.java
index 5a46f81..d0e2d14 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBReportMediator.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBReportMediator.java
@@ -74,9 +74,13 @@
             }
 
         } catch (SQLException e) {
-            handleException("Error execuring insert statement : " + stmnt.getRawStatement() +
+            handleException("Error executing insert statement : " + stmnt.getRawStatement() +
                     " against DataSource : " + getDSName(), e, msgCtx);
-        } finally {
+        } catch (Exception e){
+            handleException("Error executing statement : " + stmnt.getRawStatement() +
+                    " against DataSource : " + getDSName(), e, msgCtx);
+        }
+        finally {
             if (con != null) {
                 try {
                     con.close();
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Source.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Source.java
index a637f52..d5a7bd6 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Source.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Source.java
@@ -110,6 +110,8 @@
             if (o instanceof OMElement) {
                 if (clone) {
                     sourceNodeList.add(((OMElement) o).cloneOMElement());
+                } else {
+                    sourceNodeList.add((OMElement) o);
                 }
             } else if (o instanceof String) {
                 String sourceStr = (String) o;
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java
index 252e83d..b1e2170 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java
@@ -24,7 +24,6 @@
 import org.apache.synapse.mediators.TemplateParameter;
 import org.apache.synapse.mediators.Value;
 import org.apache.synapse.mediators.eip.EIPUtils;
-import org.jaxen.JaxenException;
 
 import java.util.*;
 
@@ -47,7 +46,7 @@
      */
     private Map mappedValues;
 
-    TemplateContext(String name, Collection<TemplateParameter> parameters) {
+    public TemplateContext(String name, Collection<TemplateParameter> parameters) {
         this.fName = name;
         this.parameters = parameters;
         mappedValues = new HashMap();
@@ -116,6 +115,14 @@
         }
     }
 
+    public Map getMappedValues() {
+        return mappedValues;
+    }
+
+    public void setMappedValues(Map map) {
+        this.mappedValues = map;
+    }
+
     public Object getParameterValue(String paramName) {
         return mappedValues.get(paramName);
     }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
index 25dae0f..e8998c0 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
@@ -29,6 +29,7 @@
 import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.AbstractMediator;
 import org.apache.synapse.util.xpath.SynapseXPath;
+import org.apache.synapse.util.POXUtils;
 import org.jaxen.JaxenException;
 
 import javax.xml.namespace.QName;
@@ -357,7 +358,7 @@
     private void setFaultNode(SOAPFactory factory, SOAPFault fault) {
         if (faultNode != null) {
             SOAPFaultNode soapfaultNode = factory.createSOAPFaultNode();
-            soapfaultNode.setNodeValue(faultNode.toString());
+            soapfaultNode.setFaultNodeValue(faultNode.toString());
             fault.setNode(soapfaultNode);
         }
     }
@@ -392,7 +393,10 @@
                     }
                 }
             } else {
-                soapFaultDetail.setText(faultDetailExpr.stringValueOf(synCtx));
+                OMElement om = POXUtils.getOMFromXML(faultDetailExpr.stringValueOf(synCtx));
+                if (om != null) {
+                    soapFaultDetail.addChild(om);
+                }
             }
             fault.setDetail(soapFaultDetail);
         } else if (!faultDetailElements.isEmpty()) {
diff --git a/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java b/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
index c863968..ba74df8 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
@@ -29,12 +29,16 @@
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.SynapseLog;
+import org.apache.synapse.config.xml.XMLConfigConstants;
+import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.AbstractMediator;
 import org.apache.synapse.util.xpath.SynapseXPath;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * The header mediator is able to set a given value as a SOAP header, or remove a given
@@ -58,6 +62,8 @@
     private List<OMElement> embeddedXmlContent = new ArrayList<OMElement>();
     /** An expression which should be evaluated, and the result set as the header value */
     private SynapseXPath expression = null;
+    /** The scope that decides which header should be updated: SOAP or Transport. */
+    private String scope = null;
 
     /**
      * Sets/Removes a SOAP header on the current message
@@ -77,16 +83,30 @@
             }
         }
 
+        if (XMLConfigConstants.HEADER_SCOPE_TRANSPORT.equals(scope)) {
+            alterTransportHeader(synCtx);
+        } else {
+            alterSOAPOrKnownHeader(synCtx);
+        }
+
+        synLog.traceOrDebug("End : Header mediator");
+        return true;
+    }
+
+    private void alterSOAPOrKnownHeader(MessageContext synCtx) {
+
+        SynapseLog synLog = getLog(synCtx);
+
         if (action == ACTION_SET) {
 
-            String value = (getExpression() == null ? getValue() :
-                    expression.stringValueOf(synCtx));
+            String value = (getExpression() == null ? getValue() : expression.stringValueOf(synCtx));
 
             if (synLog.isTraceOrDebugEnabled()) {
-                synLog.traceOrDebug("Set SOAP header : " + qName + " to : " + value);
+                synLog.traceOrDebug("Setting header : " + qName + " to : " + value);
             }
 
-            if (!isImplicit() && (qName.getNamespaceURI() == null || "".equals(qName.getNamespaceURI()))) {
+            if (!isImplicit() &&
+                (qName.getNamespaceURI() == null || "".equals(qName.getNamespaceURI()))) {
 
                 // is this a "well known" Synapse header?
                 if (SynapseConstants.HEADER_TO.equals(qName.getLocalPart())) {
@@ -111,7 +131,7 @@
         } else {
 
             if (synLog.isTraceOrDebugEnabled()) {
-                synLog.traceOrDebug("Removing SOAP Header : " + qName);
+                synLog.traceOrDebug("Removing Header : " + qName);
             }
 
             if (qName.getNamespaceURI() == null || "".equals(qName.getNamespaceURI())) {
@@ -151,9 +171,55 @@
                 }
             }
         }
+    }
 
-        synLog.traceOrDebug("End : Header mediator");
-        return true;
+    private void alterTransportHeader(MessageContext synCtx) {
+
+        SynapseLog synLog = getLog(synCtx);
+        String headerName = qName.getLocalPart();
+
+        String value = (getExpression() == null ? getValue() : expression.stringValueOf(synCtx));
+
+        if (action == ACTION_SET) {
+
+            if (synLog.isTraceOrDebugEnabled()) {
+                synLog.traceOrDebug("Setting Transport header : " + headerName + " to : " + value);
+            }
+
+            //Setting Transport Headers
+            Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
+            org.apache.axis2.context.MessageContext axis2MessageCtx =
+                    axis2smc.getAxis2MessageContext();
+            Object headers = axis2MessageCtx.
+                    getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+
+            if (headers != null && headers instanceof Map) {
+                Map headersMap = (Map) headers;
+                headersMap.put(headerName, value);
+            } else if (headers == null) {
+                Map headersMap = new HashMap();
+                headersMap.put(headerName, value);
+                axis2MessageCtx.setProperty(
+                        org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, headersMap);
+            }
+        } else {
+            if (synLog.isTraceOrDebugEnabled()) {
+                synLog.traceOrDebug("Removing Transport Header : " + qName);
+            }
+
+            // Removing transport headers
+            Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
+            org.apache.axis2.context.MessageContext axis2MessageCtx =
+                    axis2smc.getAxis2MessageContext();
+            Object headers = axis2MessageCtx.getProperty(
+                    org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+            if (headers != null && headers instanceof Map) {
+                Map headersMap = (Map) headers;
+                headersMap.remove(headerName);
+            } else {
+                synLog.traceOrDebug("No transport headers found");
+            }
+        }
     }
 
     private void addCustomHeader(MessageContext synCtx, String value) {
@@ -244,4 +310,21 @@
     public void setExpression(SynapseXPath expression) {
         this.expression = expression;
     }
+
+    public String getScope() {
+        return scope;
+    }
+
+    public void setScope(String scope) {
+        this.scope = scope;
+    }
+
+    @Override
+    public boolean isContentAware() {
+        if (XMLConfigConstants.SCOPE_TRANSPORT.equals(scope)) {
+            return false;
+        } else {
+            return true;
+        }
+    }
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java b/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
index 4a7cb6b..8f8a566 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
@@ -62,6 +62,9 @@
                 ScheduledMessageForwardingProcessor.PROCESSOR_INSTANCE);
 
         int maxDeliverAttempts = -1;
+
+        boolean isMaxDeliverAttemptDropEnabled = false;
+
         String mdaParam = null;
         if (parameters != null) {
             mdaParam = (String) parameters.get(MessageProcessorConsents.MAX_DELIVER_ATTEMPTS);
@@ -75,6 +78,13 @@
                 processor.deactivate();
             }
         }
+        if (maxDeliverAttempts > 0 && parameters.get(ForwardingProcessorConstants.MAX_DELIVER_DROP) != null &&
+                parameters.get(ForwardingProcessorConstants.MAX_DELIVER_DROP).toString()
+                        .equalsIgnoreCase("true")) {
+	        //Configuration to continue the message processor even without stopping the message processor
+	        // after maximum number of delivery
+            isMaxDeliverAttemptDropEnabled = true;
+        }
 
         // WE do not try to process if the processor is inactive or
         // there is no message store attached.
@@ -158,7 +168,7 @@
 
                                 if (maxDeliverAttempts > 0) {
                                     if(processor.getSendAttemptCount() >= maxDeliverAttempts) {
-                                        processor.deactivate();
+                                        deactivate(processor, messageContext, parameters);
                                     }
                                 }
                                 errorStop = true;
@@ -199,7 +209,14 @@
                             if (maxDeliverAttempts > 0) {
                                 processor.incrementSendAttemptCount();
                                 if (processor.getSendAttemptCount() >= maxDeliverAttempts) {
-                                    processor.deactivate();
+                                    if (isMaxDeliverAttemptDropEnabled) {
+                                        //Since explicitly enabled the message drop after max delivery attempt
+                                        // message has been removed and reset the delivery attempt count of the processor
+                                        processor.resetSentAttemptCount();
+                                        messageStore.poll();
+                                    } else {
+                                        deactivate(processor, messageContext, parameters);
+                                    }
                                 }
                             }
                             errorStop = true;
@@ -260,4 +277,19 @@
         }
     }
 
+    private void deactivate(ScheduledMessageForwardingProcessor processor,
+                            MessageContext msgContext, Map<String, Object> parameters) {
+        processor.deactivate();
+        if (parameters != null && parameters.get(ForwardingProcessorConstants.DEACTIVATE_SEQUENCE) != null) {
+            if (msgContext != null) {
+                String seq = (String) parameters.get(ForwardingProcessorConstants.DEACTIVATE_SEQUENCE);
+                Mediator mediator = msgContext.getSequence(seq);
+                if (mediator != null) {
+                    mediator.mediate(msgContext);
+                } else {
+                    log.warn("Deactivate sequence: " + seq + " does not exist");
+                }
+            }
+        }
+    }
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingProcessorConstants.java b/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingProcessorConstants.java
index bd81430..f706f1f 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingProcessorConstants.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingProcessorConstants.java
@@ -55,5 +55,14 @@
      */
     public static final String FAULT_SEQUENCE = "message.processor.fault.sequence";
 
+    /**
+     * used for forward in case of scheduled message processor deactivation
+     */
+    public static final String DEACTIVATE_SEQUENCE = "message.processor.deactivate.sequence";
+
+    /**
+     * Used to determine the message drop after maximum delivery
+     */
+    public static final String MAX_DELIVER_DROP = "max.deliver.drop";
 
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/message/processors/sampler/SamplingJob.java b/java/modules/core/src/main/java/org/apache/synapse/message/processors/sampler/SamplingJob.java
index d901adc..8b87db6 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/message/processors/sampler/SamplingJob.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/message/processors/sampler/SamplingJob.java
@@ -23,6 +23,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.MessageContext;
+import org.apache.synapse.SynapseException;
 import org.apache.synapse.message.processors.MessageProcessorConsents;
 import org.apache.synapse.message.processors.ScheduledMessageProcessor;
 import org.apache.synapse.message.store.MessageStore;
@@ -79,7 +80,12 @@
                                 if (processingSequence != null) {
                                     processingSequence.mediate(messageContext);
                                 }
-                            } catch (Throwable t) {
+                            } catch (SynapseException synError){
+                                if (!messageContext.getFaultStack().isEmpty()) {
+                                    messageContext.getFaultStack().pop().handleFault(messageContext,synError);
+                                }
+                                log.error("Error occurred while executing the message", synError);
+                            }catch (Throwable t) {
                                 log.error("Error occurred while executing the message", t);
                             }
                         }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/startup/tasks/MessageInjector.java b/java/modules/core/src/main/java/org/apache/synapse/startup/tasks/MessageInjector.java
index 22c8d0a..f1dffaa 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/startup/tasks/MessageInjector.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/startup/tasks/MessageInjector.java
@@ -39,6 +39,7 @@
 import org.apache.synapse.mediators.base.SequenceMediator;

 import org.apache.synapse.task.Task;

 import org.apache.synapse.util.PayloadHelper;

+import org.apache.axiom.util.UIDGenerator;

 

 /**

  * Injects a Message into a named sequence or a proxy service configured in the Synapse

@@ -209,6 +210,7 @@
             axis2MsgCtx.setConfigurationContext(configurationContext);

             axis2MsgCtx.setIncomingTransportName(Constants.TRANSPORT_LOCAL);

             axis2MsgCtx.setServerSide(true);

+            axis2MsgCtx.setMessageID(UIDGenerator.generateURNString());

 

             try {

                 AxisService axisService = configurationContext.getAxisConfiguration().

@@ -266,6 +268,7 @@
 

         } else {

             MessageContext mc = synapseEnvironment.createMessageContext();

+            mc.setMessageID(UIDGenerator.generateURNString());

             mc.pushFaultHandler(new MediatorFaultHandler(mc.getFaultSequence()));

             if (to != null) {

                 mc.setTo(new EndpointReference(to));

diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java b/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
index a89b560..be5db21 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
@@ -1,7 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.util;
 
-import org.apache.axiom.attachments.Attachments;
-import org.apache.axiom.om.*;
+import org.apache.axiom.om.OMCloneOptions;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.ElementHelper;
 import org.apache.axiom.soap.*;
 import org.apache.axiom.util.UIDGenerator;
 import org.apache.axis2.AxisFault;
@@ -17,16 +38,24 @@
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.SynapseException;
+import org.apache.synapse.aspects.statistics.ErrorLog;
+import org.apache.synapse.aspects.statistics.StatisticsLog;
 import org.apache.synapse.aspects.statistics.StatisticsRecord;
-import org.apache.synapse.aspects.statistics.StatisticsRecordFactory;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.eip.EIPConstants;
+import org.apache.synapse.mediators.template.TemplateContext;
 import org.apache.synapse.transport.passthru.PassThroughConstants;
 import org.apache.synapse.transport.passthru.Pipe;
-import org.apache.synapse.transport.passthru.ServerWorker;
 import org.apache.synapse.transport.passthru.config.SourceConfiguration;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+import java.util.TreeMap;
 
-import java.util.*;
 
 /**
  *
@@ -77,10 +106,26 @@
 
         // copy all the synapse level properties to the newCtx
         for (Object o : synCtx.getPropertyKeySet()) {
-            // If there are non String keyed properties neglect them rather than trow exception
-            if (o instanceof String) {
-                newCtx.setProperty((String) o, synCtx.getProperty((String) o));
+            String key = (String) o;                    // MessageContext API enforce key to be a String
+            Object obj = synCtx.getProperty(key);
+            if (obj instanceof String || obj instanceof Integer) {  // For immutable
+                // Do nothing
+            } else if (obj instanceof ArrayList) {
+                obj = cloneArrayList((ArrayList) obj);
+            } else if (obj instanceof Stack
+                    && key.equals(SynapseConstants.SYNAPSE__FUNCTION__STACK)) {
+                obj = getClonedTemplateStack((Stack<TemplateContext>) obj);
+            } else if (obj instanceof StatisticsRecord) {
+                obj = getClonedStatisticRecord((StatisticsRecord) obj);
+            } else if (obj instanceof OMElement) {
+                obj = ((OMElement) obj).cloneOMElement();
+            } else {
+                if (log.isDebugEnabled()) {
+                    log.debug("Deep clone not happened for property : " + key + ". Class type : "
+                             + obj.getClass().getName());
+                }
             }
+            newCtx.setProperty(key, obj);
         }
         
         // Make deep copy of fault stack so that parent will not be lost it's fault stack
@@ -410,4 +455,106 @@
         throw new SynapseException(msg);
     }
 
+    /*
+     * This method will deep clone array list by creating a new ArrayList and cloning and adding each element in it
+     */
+    private static ArrayList<Object> cloneArrayList(ArrayList<Object> originalArrayList) {
+        ArrayList<Object> clonedArrayList = null;
+        if (originalArrayList != null) {
+            clonedArrayList = new ArrayList<Object>();
+            for (Object obj : originalArrayList) {
+                if (obj instanceof SOAPHeaderBlock) {
+                    SOAPFactory fac = (SOAPFactory) ((SOAPHeaderBlock) obj).getOMFactory();
+                    obj = ((SOAPHeaderBlock) obj).cloneOMElement();
+                    try {
+                        obj = ElementHelper.toSOAPHeaderBlock((OMElement) obj, fac);
+                    } catch (Exception e) {
+                        handleException(e.getLocalizedMessage());
+                    }
+                } else if (obj instanceof SOAPEnvelope) {
+                    SOAPEnvelope env = (SOAPEnvelope) obj;
+                    obj = MessageHelper.cloneSOAPEnvelope(env);
+                } else if (obj instanceof OMElement) {
+                    obj = ((OMElement) obj).cloneOMElement();
+                } else {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Array List deep clone not implemented for Class type : " + obj.getClass().getName());
+                    }
+                }
+                clonedArrayList.add(obj);
+            }
+        }
+        return clonedArrayList;
+    }
+
+    /**
+     * Get a clone of a Template Function stack
+     *
+     * @param oriTemplateStack original template function stack to be cloned
+     * @return clone of a Template Function stack
+     */
+    private static Stack<TemplateContext> getClonedTemplateStack(Stack<TemplateContext> oriTemplateStack) {
+
+        Stack<TemplateContext> clonedTemplateStack = new Stack<TemplateContext>();
+
+        for (TemplateContext oriTemplateCtx : oriTemplateStack) {
+            TemplateContext clonedTemplateCtx =
+                    new TemplateContext(oriTemplateCtx.getName(), oriTemplateCtx.getParameters());
+
+            Map oriValueMap = oriTemplateCtx.getMappedValues();
+            Map clonedValueMap = new HashMap();
+            for (Object key : oriValueMap.keySet()) {
+                Object value = oriValueMap.get(key);
+                if (value instanceof ArrayList) {
+                    value = cloneArrayList((ArrayList<Object>) value);
+                }
+                clonedValueMap.put(key, value);
+            }
+            clonedTemplateCtx.setMappedValues(clonedValueMap);
+            clonedTemplateStack.push(clonedTemplateCtx);
+        }
+        return clonedTemplateStack;
+    }
+
+
+    /**
+     * Get clone of Statistic Record
+     *
+     * @param oriRecord original statistic record
+     * @return clone of Statistic Record
+     */
+    private static StatisticsRecord getClonedStatisticRecord (StatisticsRecord oriRecord) {
+
+        StatisticsRecord clonedRecord =
+                new StatisticsRecord(oriRecord.getId(), oriRecord.getClientIP(), oriRecord.getClientHost());
+
+        clonedRecord.setOwner(oriRecord.getOwner());
+        clonedRecord.setEndReported(oriRecord.isEndReported());
+
+        // Clone stats logs
+        List<StatisticsLog> oriStatisticsLogs = oriRecord.getAllStatisticsLogs();
+        for (StatisticsLog oriLog : oriStatisticsLogs) {
+
+            StatisticsLog clonedLog = new StatisticsLog(oriLog.getId(), oriLog.getComponentType());
+            clonedLog.setTime(oriLog.getTime());
+            clonedLog.setResponse(oriLog.isResponse());
+            clonedLog.setFault(oriLog.isFault());
+            clonedLog.setEndAnyLog(oriLog.isEndAnyLog());
+
+            // Error Log
+            ErrorLog oriErrorLog = oriLog.getErrorLog();
+            if (oriErrorLog != null) {
+                ErrorLog clonedErrorLog = new ErrorLog(oriErrorLog.getErrorCode());
+                if (oriErrorLog.getException() != null) {
+                    clonedErrorLog.setException(oriErrorLog.getException());
+                }
+                clonedErrorLog.setErrorMessage(oriErrorLog.getErrorMessage());
+                clonedErrorLog.setErrorDetail(oriErrorLog.getErrorDetail());
+                clonedLog.setErrorLog(clonedErrorLog);
+            }
+            clonedRecord.collect(clonedLog);
+        }
+        return clonedRecord;
+    }
+
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/POXUtils.java b/java/modules/core/src/main/java/org/apache/synapse/util/POXUtils.java
index c9d68cc..7ae0c88 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/util/POXUtils.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/POXUtils.java
@@ -20,7 +20,9 @@
 package org.apache.synapse.util;
 
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.util.AXIOMUtil;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPFault;
 import org.apache.axis2.context.MessageContext;
@@ -28,6 +30,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 
 /**
  *
@@ -52,8 +55,10 @@
                 if (log.isDebugEnabled()) {
                     log.debug("Setting the fault detail : " + faultDetail + " as athe POX Fault");
                 }
-                faultPayload.setText(faultDetail);
-
+                OMElement om = POXUtils.getOMFromXML(faultDetail);
+                if(om != null) {
+                    faultPayload.addChild(om);
+                }
             } else if (fault.getReason() != null && !fault.getReason().getText().equals("")) {
 
                 String faultReasonValue = fault.getReason().getText();
@@ -89,4 +94,16 @@
             body.addChild(faultPayload);
         }
     }
+
+    /**
+     * If the input string is valid xml, this method will convert it into an OMElement and
+     * return back. Otherwise returns null.
+     */
+    public static OMElement getOMFromXML(String text) {
+        try {
+            return AXIOMUtil.stringToOM(text);
+        } catch (Exception ignore) {
+            return null;
+        }
+    }
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/PayloadHelper.java b/java/modules/core/src/main/java/org/apache/synapse/util/PayloadHelper.java
index fdfd889..3ff6c07 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/PayloadHelper.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/PayloadHelper.java
@@ -31,10 +31,9 @@
 import org.apache.axiom.om.OMText;

 import org.apache.axiom.om.OMXMLBuilderFactory;

 import org.apache.axiom.om.OMXMLParserWrapper;

-import org.apache.axiom.soap.SOAP11Version;

 import org.apache.axiom.soap.SOAPBody;

 import org.apache.axiom.soap.SOAPEnvelope;

-import org.apache.axiom.soap.SOAPVersion;

+import org.apache.axiom.soap.SOAPFactory;

 import org.apache.commons.logging.Log;

 import org.apache.commons.logging.LogFactory;

 import org.apache.synapse.MessageContext;

@@ -99,13 +98,7 @@
 		SOAPBody body = envelope.getBody();

 		if (body == null) {

 

-			SOAPVersion version = envelope.getVersion();

-			if (version.getEnvelopeURI().equals(

-					SOAP11Version.SOAP_ENVELOPE_NAMESPACE_URI)) {

-				body = OMAbstractFactory.getSOAP11Factory().createSOAPBody();

-			} else {

-				body = OMAbstractFactory.getSOAP12Factory().createSOAPBody();

-			}

+			body = ((SOAPFactory)envelope.getOMFactory()).createSOAPBody();

 			if (envelope.getHeader() != null) {

 				envelope.getHeader().insertSiblingAfter(body);

 			} else {

diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMap.java b/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMap.java
index a73fb9c..ad74cbd 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMap.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMap.java
@@ -1,42 +1,61 @@
-package org.apache.synapse.util;

-

-import java.util.Map;

-/*

- * This interface is a helper for dealing with a restriction on Map messages 

- * The key MUST be a String

- * and the value MUST be one of

- * boolean, char, String, int, double, float, long, short, byte, byte[] (Consider adding DataHandler in future)

- * or the equivalent Object

- * The simple type putters are equivalent to using an Object

- * so 

- * put("paul", new Integer(38));

- * getInt("paul"); returns 38

- */

-

-public interface SimpleMap extends Map {

-	

-	public Object get(String name);

-	public void put(String name, Object value);

-	public boolean getBoolean(String name);

-	public void putBoolean(String name, boolean b);

-	public String getString(String value);

-	public void putString(String name, String value);

-	public char getChar(String name);

-	public void putChar(String name, char c);

-	public int getInt(String name);

-	public void putInt(String name, int i);

-	public short getShort(String name);

-	public void putShort(String name, short s);

-	public float getFloat(String name);

-	public void putFloat(String name, float fl);

-	public double getDouble(String name);

-	public void putDouble(String name, double d);

-	public long getLong(String name);

-	public void putLong(String name, long l);

-	public byte getByte(String name);

-	public void putByte(String name, byte b);

-	public byte[] getBytes(String name);

-	public void putBytes(String name, byte[] bytes);

-	

-

-}

+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.synapse.util;
+
+import java.util.Map;
+/*
+ * This interface is a helper for dealing with a restriction on Map messages 
+ * The key MUST be a String
+ * and the value MUST be one of
+ * boolean, char, String, int, double, float, long, short, byte, byte[] (Consider adding DataHandler in future)
+ * or the equivalent Object
+ * The simple type putters are equivalent to using an Object
+ * so 
+ * put("paul", new Integer(38));
+ * getInt("paul"); returns 38
+ */
+
+public interface SimpleMap extends Map {
+	
+	public Object get(String name);
+	public void put(String name, Object value);
+	public boolean getBoolean(String name);
+	public void putBoolean(String name, boolean b);
+	public String getString(String value);
+	public void putString(String name, String value);
+	public char getChar(String name);
+	public void putChar(String name, char c);
+	public int getInt(String name);
+	public void putInt(String name, int i);
+	public short getShort(String name);
+	public void putShort(String name, short s);
+	public float getFloat(String name);
+	public void putFloat(String name, float fl);
+	public double getDouble(String name);
+	public void putDouble(String name, double d);
+	public long getLong(String name);
+	public void putLong(String name, long l);
+	public byte getByte(String name);
+	public void putByte(String name, byte b);
+	public byte[] getBytes(String name);
+	public void putBytes(String name, byte[] bytes);
+	
+
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMapImpl.java b/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMapImpl.java
index 7c04a1f..f917749 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMapImpl.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMapImpl.java
@@ -1,311 +1,330 @@
-package org.apache.synapse.util;

-

-import java.io.ByteArrayOutputStream;

-import java.io.IOException;

-

-import java.util.HashMap;

-import java.util.Iterator;

-import java.util.Map;

-

-import javax.activation.DataHandler;

-import javax.xml.namespace.QName;

-

-import org.apache.axiom.attachments.ByteArrayDataSource;

-import org.apache.axiom.om.OMAbstractFactory;

-import org.apache.axiom.om.OMElement;

-import org.apache.axiom.om.OMFactory;

-import org.apache.axiom.om.OMNamespace;

-import org.apache.axiom.om.OMNode;

-import org.apache.axiom.om.OMText;

-

-

-public class SimpleMapImpl extends HashMap implements SimpleMap {

-

-    private static final OMNamespace attrNS = OMAbstractFactory.getOMFactory().createOMNamespace("", "");

-    private static final String TYPE = "type";

-

-    private static final String NAME = "name";

-

-    private static final String ENTRY = "entry";

-

-    private static final String SHORT = "short";

-

-    private static final String LONG = "long";

-

-    private static final String DOUBLE = "double";

-    private static final String INTEGER = "int";

-    private static final String FLOAT = "float";

-

-    private static final String BYTEARRAY = "byte[]";

-

-    private static final String BYTE = "byte";

-

-    private static final String STRING = "string";

-

-    private static final String BOOLEAN = "boolean";

-

-    private static final String CHAR = "char";

-

-    private static final long serialVersionUID = 1L;

-

-    public SimpleMapImpl() {

-        super();

-    }

-

-    public Object get(String name) {

-        return this.get((Object) name);

-    }

-

-    public boolean getBoolean(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Boolean) {

-            return (Boolean) o;

-        } else {

-            throw new RuntimeException("getBoolean(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of Boolean");

-        }

-    }

-

-    public byte getByte(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Byte) {

-            return (Byte) o;

-        } else {

-            throw new RuntimeException("getByte(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of Byte");

-        }

-    }

-

-    public byte[] getBytes(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof byte[]) {

-            return (byte[]) o;

-        } else {

-            throw new RuntimeException("getByteArray(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of byte[]");

-        }

-    }

-

-    public char getChar(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Character) {

-            return (Character) o;

-        } else {

-            throw new RuntimeException("getChar(" + name + "): "

-                    + o.getClass().getName()

-                    + " is not an instance of Character");

-        }

-    }

-

-    public double getDouble(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Double) {

-            return (Double) o;

-        } else {

-            throw new RuntimeException("getDouble(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of Double");

-        }

-    }

-

-    public float getFloat(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Float) {

-            return (Float) o;

-        } else {

-            throw new RuntimeException("getFloat(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of Float");

-        }

-    }

-

-    public int getInt(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Integer) {

-            return (Integer) o;

-        } else {

-            throw new RuntimeException("getInt(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of Integer");

-        }

-    }

-

-    public long getLong(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Long) {

-            return (Long) o;

-        } else {

-            throw new RuntimeException("getLong(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of Long");

-        }

-    }

-

-    public short getShort(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof Short) {

-            return (Short) o;

-        } else {

-            throw new RuntimeException("getShort(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of Short");

-        }

-    }

-

-    public String getString(String name) {

-        Object o = this.get((Object) name);

-        if (o instanceof String) {

-            return ((String) o);

-        } else {

-            throw new RuntimeException("getString(" + name + "): "

-                    + o.getClass().getName() + " is not an instance of String");

-        }

-    }

-

-    public void put(String name, Object value) {

-        this.put((Object) name, value);

-    }

-

-    public void putBoolean(String name, boolean b) {

-        this.put((Object) name, b);

-    }

-

-    public void putByte(String name, byte b) {

-        this.put((Object) name, b);

-    }

-

-    public void putBytes(String name, byte[] bytes) {

-        this.put((Object) name, bytes);

-    }

-

-    public void putChar(String name, char c) {

-        this.put((Object) name, c);

-    }

-

-    public void putDouble(String name, double d) {

-        this.put((Object) name, d);

-    }

-

-    public void putFloat(String name, float fl) {

-        this.put((Object) name, fl);

-    }

-

-    public void putInt(String name, int i) {

-        this.put((Object) name, i);

-    }

-

-    public void putLong(String name, long l) {

-        this.put((Object) name, l);

-    }

-

-    public void putShort(String name, short s) {

-        this.put((Object) name, s);

-    }

-

-    public void putString(String name, String value) {

-        this.put((Object) name, value);

-    }

-

-    public OMElement getOMElement() {

-        return getOMElement(OMAbstractFactory.getOMFactory());

-    }

-

-    public OMElement getOMElement(OMFactory fac) {

-        OMElement mapElement = fac.createOMElement(PayloadHelper.MAPELT);

-

-        for (Object entryObj : this.entrySet()) {

-            Object key = ((Map.Entry) entryObj).getKey();

-            Object o = ((Map.Entry) entryObj).getValue();

-

-            if (key instanceof String) {

-                OMElement entry = fac.createOMElement(new QName(

-                        PayloadHelper.AXIOMPAYLOADNS, ENTRY), mapElement);

-                entry.addAttribute(NAME, (String) key, attrNS);

-

-                if (o instanceof Character) {

-                    entry.addAttribute(TYPE, CHAR, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof Boolean) {

-                    entry.addAttribute(TYPE, BOOLEAN, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof String) {

-                    entry.addAttribute(TYPE, STRING, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof Byte) {

-                    entry.addAttribute(TYPE, BYTE, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof byte[]) {

-                    entry.addAttribute(TYPE, BYTEARRAY, attrNS);

-                    OMText text = fac.createOMText(new DataHandler(

-                            new ByteArrayDataSource((byte[]) o)), true);

-                    entry.addChild(text);

-                } else if (o instanceof Float) {

-                    entry.addAttribute(TYPE, FLOAT, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof Double) {

-                    entry.addAttribute(TYPE, DOUBLE, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof Long) {

-                    entry.addAttribute(TYPE, LONG, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof Short) {

-                    entry.addAttribute(TYPE, SHORT, attrNS);

-                    entry.setText(o.toString());

-                } else if (o instanceof Integer) {

-                    entry.addAttribute(TYPE, INTEGER, attrNS);

-                    entry.setText(o.toString());

-                }

-

-            } else {

-                // shouldn't be any non-string keys. Ignore!

-            }

-        }

-

-        return mapElement;

-    }

-

-    // create an instance from an OMElement (if its the right shape!!!)

-    public SimpleMapImpl(OMElement el) {

-        super();

-        if (el.getQName().equals(PayloadHelper.MAPELT)) {

-            for (Iterator it = el.getChildElements(); it.hasNext(); ) {

-                OMElement child = (OMElement)it.next();

-                if (child.getLocalName().equals(ENTRY)) {

-                    String name = child.getAttributeValue(new QName("",NAME));

-                    String type = child.getAttributeValue(new QName("", TYPE));

-                    if (type == null || name == null) {

-                        //bad!

-                        continue;

-                    }

-                    OMNode data = child.getFirstOMChild();

-                    if (data.getType() != OMNode.TEXT_NODE) {

-                        continue; // BAD!

-                    }

-                    OMText text = (OMText)data;

-                    if (type.equals(INTEGER)) {

-                        this.put(name, new Integer(text.getText()));

-                    } else if (type.equals(CHAR)) {

-                        this.put(name, (text.getText().charAt(0)));

-                    } else if (type.equals(DOUBLE)) {

-                        this.put(name, new Double(text.getText()));

-                    } else if (type.equals(FLOAT)) {

-                        this.put(name, new Float(text.getText()));

-                    } else if (type.equals(BYTE)) {

-                        this.put(name, text.getText().getBytes()[0]);

-                    } else if (type.equals(SHORT)) {

-                        this.put(name, new Short(text.getText()));

-                    } else if (type.equals(LONG)) {

-                        this.put(name, new Long(text.getText()));

-                    } else if (type.equals(STRING)) {

-                        this.put(name, text.getText());

-                    } else if (type.equals(BYTEARRAY)) {

-                        DataHandler dh = (DataHandler) text.getDataHandler();

-                        ByteArrayOutputStream baos = new ByteArrayOutputStream();

-                        try {

-                            dh.writeTo(baos);

-                            this.put(name, baos.toByteArray());

-                        } catch (IOException e) {

-                            e.printStackTrace();

-                        }

-                    }

-                }

-            }

-        }

-    }

-

-}

+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.synapse.util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMText;
+
+
+public class SimpleMapImpl extends HashMap implements SimpleMap {
+
+    private static final OMNamespace attrNS = OMAbstractFactory.getOMFactory().createOMNamespace("", "");
+    private static final String TYPE = "type";
+
+    private static final String NAME = "name";
+
+    private static final String ENTRY = "entry";
+
+    private static final String SHORT = "short";
+
+    private static final String LONG = "long";
+
+    private static final String DOUBLE = "double";
+    private static final String INTEGER = "int";
+    private static final String FLOAT = "float";
+
+    private static final String BYTEARRAY = "byte[]";
+
+    private static final String BYTE = "byte";
+
+    private static final String STRING = "string";
+
+    private static final String BOOLEAN = "boolean";
+
+    private static final String CHAR = "char";
+
+    private static final long serialVersionUID = 1L;
+
+    public SimpleMapImpl() {
+        super();
+    }
+
+    public Object get(String name) {
+        return this.get((Object) name);
+    }
+
+    public boolean getBoolean(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Boolean) {
+            return (Boolean) o;
+        } else {
+            throw new RuntimeException("getBoolean(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of Boolean");
+        }
+    }
+
+    public byte getByte(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Byte) {
+            return (Byte) o;
+        } else {
+            throw new RuntimeException("getByte(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of Byte");
+        }
+    }
+
+    public byte[] getBytes(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof byte[]) {
+            return (byte[]) o;
+        } else {
+            throw new RuntimeException("getByteArray(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of byte[]");
+        }
+    }
+
+    public char getChar(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Character) {
+            return (Character) o;
+        } else {
+            throw new RuntimeException("getChar(" + name + "): "
+                    + o.getClass().getName()
+                    + " is not an instance of Character");
+        }
+    }
+
+    public double getDouble(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Double) {
+            return (Double) o;
+        } else {
+            throw new RuntimeException("getDouble(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of Double");
+        }
+    }
+
+    public float getFloat(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Float) {
+            return (Float) o;
+        } else {
+            throw new RuntimeException("getFloat(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of Float");
+        }
+    }
+
+    public int getInt(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Integer) {
+            return (Integer) o;
+        } else {
+            throw new RuntimeException("getInt(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of Integer");
+        }
+    }
+
+    public long getLong(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Long) {
+            return (Long) o;
+        } else {
+            throw new RuntimeException("getLong(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of Long");
+        }
+    }
+
+    public short getShort(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof Short) {
+            return (Short) o;
+        } else {
+            throw new RuntimeException("getShort(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of Short");
+        }
+    }
+
+    public String getString(String name) {
+        Object o = this.get((Object) name);
+        if (o instanceof String) {
+            return ((String) o);
+        } else {
+            throw new RuntimeException("getString(" + name + "): "
+                    + o.getClass().getName() + " is not an instance of String");
+        }
+    }
+
+    public void put(String name, Object value) {
+        this.put((Object) name, value);
+    }
+
+    public void putBoolean(String name, boolean b) {
+        this.put((Object) name, b);
+    }
+
+    public void putByte(String name, byte b) {
+        this.put((Object) name, b);
+    }
+
+    public void putBytes(String name, byte[] bytes) {
+        this.put((Object) name, bytes);
+    }
+
+    public void putChar(String name, char c) {
+        this.put((Object) name, c);
+    }
+
+    public void putDouble(String name, double d) {
+        this.put((Object) name, d);
+    }
+
+    public void putFloat(String name, float fl) {
+        this.put((Object) name, fl);
+    }
+
+    public void putInt(String name, int i) {
+        this.put((Object) name, i);
+    }
+
+    public void putLong(String name, long l) {
+        this.put((Object) name, l);
+    }
+
+    public void putShort(String name, short s) {
+        this.put((Object) name, s);
+    }
+
+    public void putString(String name, String value) {
+        this.put((Object) name, value);
+    }
+
+    public OMElement getOMElement() {
+        return getOMElement(OMAbstractFactory.getOMFactory());
+    }
+
+    public OMElement getOMElement(OMFactory fac) {
+        OMElement mapElement = fac.createOMElement(PayloadHelper.MAPELT);
+
+        for (Object entryObj : this.entrySet()) {
+            Object key = ((Map.Entry) entryObj).getKey();
+            Object o = ((Map.Entry) entryObj).getValue();
+
+            if (key instanceof String) {
+                OMElement entry = fac.createOMElement(new QName(
+                        PayloadHelper.AXIOMPAYLOADNS, ENTRY), mapElement);
+                entry.addAttribute(NAME, (String) key, attrNS);
+
+                if (o instanceof Character) {
+                    entry.addAttribute(TYPE, CHAR, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof Boolean) {
+                    entry.addAttribute(TYPE, BOOLEAN, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof String) {
+                    entry.addAttribute(TYPE, STRING, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof Byte) {
+                    entry.addAttribute(TYPE, BYTE, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof byte[]) {
+                    entry.addAttribute(TYPE, BYTEARRAY, attrNS);
+                    OMText text = fac.createOMText(new DataHandler(
+                            new ByteArrayDataSource((byte[]) o)), true);
+                    entry.addChild(text);
+                } else if (o instanceof Float) {
+                    entry.addAttribute(TYPE, FLOAT, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof Double) {
+                    entry.addAttribute(TYPE, DOUBLE, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof Long) {
+                    entry.addAttribute(TYPE, LONG, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof Short) {
+                    entry.addAttribute(TYPE, SHORT, attrNS);
+                    entry.setText(o.toString());
+                } else if (o instanceof Integer) {
+                    entry.addAttribute(TYPE, INTEGER, attrNS);
+                    entry.setText(o.toString());
+                }
+
+            } else {
+                // shouldn't be any non-string keys. Ignore!
+            }
+        }
+
+        return mapElement;
+    }
+
+    // create an instance from an OMElement (if its the right shape!!!)
+    public SimpleMapImpl(OMElement el) {
+        super();
+        if (el.getQName().equals(PayloadHelper.MAPELT)) {
+            for (Iterator it = el.getChildElements(); it.hasNext(); ) {
+                OMElement child = (OMElement)it.next();
+                if (child.getLocalName().equals(ENTRY)) {
+                    String name = child.getAttributeValue(new QName("",NAME));
+                    String type = child.getAttributeValue(new QName("", TYPE));
+                    if (type == null || name == null) {
+                        //bad!
+                        continue;
+                    }
+                    OMNode data = child.getFirstOMChild();
+                    if (data.getType() != OMNode.TEXT_NODE) {
+                        continue; // BAD!
+                    }
+                    OMText text = (OMText)data;
+                    if (type.equals(INTEGER)) {
+                        this.put(name, new Integer(text.getText()));
+                    } else if (type.equals(CHAR)) {
+                        this.put(name, (text.getText().charAt(0)));
+                    } else if (type.equals(DOUBLE)) {
+                        this.put(name, new Double(text.getText()));
+                    } else if (type.equals(FLOAT)) {
+                        this.put(name, new Float(text.getText()));
+                    } else if (type.equals(BYTE)) {
+                        this.put(name, text.getText().getBytes()[0]);
+                    } else if (type.equals(SHORT)) {
+                        this.put(name, new Short(text.getText()));
+                    } else if (type.equals(LONG)) {
+                        this.put(name, new Long(text.getText()));
+                    } else if (type.equals(STRING)) {
+                        this.put(name, text.getText());
+                    } else if (type.equals(BYTEARRAY)) {
+                        DataHandler dh = (DataHandler) text.getDataHandler();
+                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                        try {
+                            dh.writeTo(baos);
+                            this.put(name, baos.toByteArray());
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/TextFileDataSource.java b/java/modules/core/src/main/java/org/apache/synapse/util/TextFileDataSource.java
index d53b0d8..ffc12d6 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/TextFileDataSource.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/TextFileDataSource.java
@@ -22,29 +22,21 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMDataSourceExt;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMSourcedElement;
-import org.apache.axiom.om.ds.OMDataSourceExtBase;
-import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
-import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
-import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.om.ds.AbstractPullOMDataSource;
 import org.apache.axiom.util.blob.OverflowBlob;
 import org.apache.axiom.util.stax.WrappedTextNodeStreamReader;
 import org.apache.axis2.transport.base.BaseConstants;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
 import java.nio.charset.Charset;
 
-public class TextFileDataSource extends OMDataSourceExtBase {
+public class TextFileDataSource extends AbstractPullOMDataSource {
     private final OverflowBlob overflowBlob;
     private final Charset charset;
 
@@ -59,28 +51,6 @@
         return fac.createOMElement(txtFileDS, BaseConstants.DEFAULT_TEXT_WRAPPER);
     }
 
-    @Override
-    public void serialize(OutputStream out, OMOutputFormat format) throws XMLStreamException {
-        XMLStreamWriter writer = new MTOMXMLStreamWriter(out, format);
-        serialize(writer);
-        writer.flush();
-    }
-
-    @Override
-    public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException {
-        MTOMXMLStreamWriter xmlWriter =
-            new MTOMXMLStreamWriter(StAXUtils.createXMLStreamWriter(writer));
-        xmlWriter.setOutputFormat(format);
-        serialize(xmlWriter);
-        xmlWriter.flush();
-    }
-
-    @Override
-    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
-        StreamingOMSerializer serializer = new StreamingOMSerializer();
-        serializer.serialize(getReader(), xmlWriter);
-    }
-
     public XMLStreamReader getReader() throws XMLStreamException {
         InputStream is;
         try {
@@ -101,17 +71,6 @@
         return false;
     }
 
-    public boolean isDestructiveWrite() {
-        return false;
-    }
-    
-    public byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException {
-        throw new UnsupportedOperationException();
-    }
-
-    public void close() {
-    }
-
     public OMDataSourceExt copy() {
         return new TextFileDataSource(overflowBlob, charset);
     }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/DOOMResultBuilder.java b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/DOOMResultBuilder.java
index d2c3850..ba9bc5d 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/DOOMResultBuilder.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/DOOMResultBuilder.java
@@ -27,7 +27,7 @@
 
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.dom.jaxp.DOOMDocumentBuilderFactory;
+import org.apache.axiom.om.dom.DOMMetaFactory;
 import org.apache.axiom.om.util.ElementHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -45,8 +45,10 @@
     private Document document;
 
     public Result getResult() {
+        DOMMetaFactory domMetaFactory
+                = ((DOMMetaFactory)OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM));
         try {
-            document = new DOOMDocumentBuilderFactory().newDocumentBuilder().newDocument();
+            document = domMetaFactory.newDocumentBuilderFactory().newDocumentBuilder().newDocument();
         } catch (ParserConfigurationException e) {
             handleException("Unable to create empty DOOM document", e);
         }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceLSInput.java b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceLSInput.java
index 1e34398..ff69cf5 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceLSInput.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceLSInput.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.util.jaxp;
 
 import org.w3c.dom.ls.LSInput;
@@ -17,6 +36,9 @@
 public class SchemaResourceLSInput implements LSInput {
 
     InputStream byteStream = null;
+    String systemId = null;
+    String publicId = null;
+    String baseURI = null;
 
     public Reader getCharacterStream() {
         return null;
@@ -43,27 +65,27 @@
     }
 
     public String getSystemId() {
-        return null;
+        return systemId;
     }
 
     public void setSystemId(String systemId) {
-
+        this.systemId = systemId;
     }
 
     public String getPublicId() {
-        return null;
+        return publicId;
     }
 
     public void setPublicId(String publicId) {
-
+        this.publicId = publicId;
     }
 
     public String getBaseURI() {
-        return null;
+        return baseURI;
     }
 
     public void setBaseURI(String baseURI) {
-
+        this.baseURI = baseURI;
     }
 
     public String getEncoding() {
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceResolver.java b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceResolver.java
index 382d18e..a3950c4 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceResolver.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SchemaResourceResolver.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.util.jaxp;
 
 import org.apache.commons.logging.Log;
@@ -51,6 +70,9 @@
         }
         SchemaResourceLSInput schemaResourceLSInput = new SchemaResourceLSInput();
         schemaResourceLSInput.setByteStream(inputSource.getByteStream());
+        schemaResourceLSInput.setSystemId(systemId);
+        schemaResourceLSInput.setPublicId(publicId);
+        schemaResourceLSInput.setBaseURI(baseURI);
         return schemaResourceLSInput;
     }
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SourceBuilderFactory.java b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SourceBuilderFactory.java
index 9cd33ca..6cdf6ce 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SourceBuilderFactory.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/jaxp/SourceBuilderFactory.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.util.jaxp;
 
 import org.apache.synapse.core.SynapseEnvironment;
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/Base64DecodeFunction.java b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/Base64DecodeFunction.java
new file mode 100644
index 0000000..1eba43e
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/Base64DecodeFunction.java
@@ -0,0 +1,102 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.util.xpath;
+
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jaxen.Context;
+import org.jaxen.Function;
+import org.jaxen.FunctionCallException;
+import org.jaxen.function.StringFunction;
+
+import java.io.UnsupportedEncodingException;
+import java.util.List;
+
+/**
+ * Implements the XPath extension function synapse:base64Decode(string)
+ */
+public class Base64DecodeFunction implements Function {
+
+    private static final Log log = LogFactory.getLog(Base64DecodeFunction.class);
+
+    /**
+     * Returns the base64 decoded string value of the first argument.
+     *
+     * @param context the context at the point in the expression when the function is called
+     * @param args  arguments of the functions
+     * @return The string value of a property
+     * @throws FunctionCallException
+     */
+    public Object call(Context context, List args) throws FunctionCallException {
+        if (args == null || args.size() == 0) {
+            if (log.isDebugEnabled()) {
+                log.debug("Property key value for lookup is not specified");
+            }
+            return SynapseXPathConstants.NULL_STRING;
+        }
+
+        int size = args.size();
+        if (size == 1) {
+            // get the first argument, it can be a function returning a string as well
+            String encodedValue = StringFunction.evaluate(args.get(0), context.getNavigator());
+            // use the default UTF-8 decoding.
+            return decode(log.isDebugEnabled(), SynapseXPathConstants.DEFAULT_CHARSET, encodedValue);
+        } else if (size == 2) {
+            // get the first argument, it can be a function returning a string as well
+            String encodedValue = StringFunction.evaluate(args.get(0), context.getNavigator());
+            // charset is in the second argument
+            String charset = StringFunction.evaluate(args.get(1), context.getNavigator());
+            return decode(log.isDebugEnabled(), charset, encodedValue);
+        } else if (log.isDebugEnabled()) {
+            log.debug("base64Decode function expects only two arguments maximum, returning empty string");
+        }
+        // return empty string if the arguments are wrong
+        return SynapseXPathConstants.NULL_STRING;
+    }
+
+
+    private Object decode(boolean debugOn, String charset, String value) throws FunctionCallException {
+        if (value == null || value.isEmpty()) {
+            if (debugOn) {
+                log.debug("Non empty string value should be provided for decode");
+            }
+            return SynapseXPathConstants.NULL_STRING;
+        }
+
+        byte[] decodedValue = new Base64().decode(value);
+        String decodedString;
+        try {
+            decodedString = new String(decodedValue, charset).trim();
+        } catch (UnsupportedEncodingException e) {
+            String msg = "Unsupported Charset";
+            log.error(msg, e);
+            throw new FunctionCallException(msg, e);
+        }
+
+        if (debugOn) {
+            log.debug("Decoded base64 encoded value: " + value + " with charset: " + charset +
+                      " to String: " + decodedString);
+        }
+
+        return decodedString;
+    }
+}
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/Base64EncodeFunction.java b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/Base64EncodeFunction.java
index 6ee0bf9..3aee2be 100644
--- a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/Base64EncodeFunction.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/Base64EncodeFunction.java
@@ -34,12 +34,9 @@
  * Implements the XPath extension function synapse:base64Encode(string)
  */
 public class Base64EncodeFunction implements Function {
+
     private static final Log log = LogFactory.getLog(Base64EncodeFunction.class);
 
-    public static final String NULL_STRING = "";
-
-    private static final String DEFAULT_CHARSET = "UTF-8";
-
     /**
      * Returns the base64 encoded string value of the first argument.
      *
@@ -55,7 +52,7 @@
             if (debugOn) {
                 log.debug("Property key value for lookup is not specified");
             }
-            return NULL_STRING;
+            return SynapseXPathConstants.NULL_STRING;
         }
 
         int size = args.size();
@@ -64,7 +61,7 @@
             String value = StringFunction.evaluate(args.get(0), context.getNavigator());
 
             // use the default UTF-8 encoding
-            return encode(debugOn, DEFAULT_CHARSET, value);
+            return encode(debugOn, SynapseXPathConstants.DEFAULT_CHARSET, value);
         } else if (size == 2) {
             // get the first argument, it can be a function returning a string as well
             String value = StringFunction.evaluate(args.get(0), context.getNavigator());
@@ -79,7 +76,7 @@
             }
         }
         // return empty string if the arguments are wrong
-        return NULL_STRING;
+        return SynapseXPathConstants.NULL_STRING;
     }
 
     private Object encode(boolean debugOn, String encoding, String value)
@@ -89,7 +86,7 @@
                 log.debug("Non emprty string value should be provided for encoding");
             }
 
-            return NULL_STRING;
+            return SynapseXPathConstants.NULL_STRING;
         }
 
         byte[] encodedValue;
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathConstants.java b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathConstants.java
index 1b85336..e0b4923 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathConstants.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathConstants.java
@@ -30,6 +30,12 @@
     /** base64Encode XPath extension function name */
     public static final String BASE64_ENCODE_FUNCTION = "base64Encode";
 
+    /** base64Decode XPath extension function name */
+    public static final String BASE64_DECODE_FUNCTION = "base64Decode";
+
+    /** URL-Encode XPath extension function name */
+    public static final String URL_ENCODE_FUNCTION = "url-encode";
+
     /** Body relative XPath variale name for the SOAPBody */
     public static final String SOAP_BODY_VARIABLE = "body";
 
@@ -50,4 +56,8 @@
 
     /** Variable prefix for accessing URL parameters of the message through XPath variables */
     public static final String URL_VARIABLE_PREFIX = "url";
+
+    public static final String DEFAULT_CHARSET = "UTF-8";
+
+    public static final String NULL_STRING = "";
 }
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathFunctionContext.java b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathFunctionContext.java
index cc5ce8e..d61cdca 100755
--- a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathFunctionContext.java
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPathFunctionContext.java
@@ -82,6 +82,14 @@
                 SynapseXPathConstants.BASE64_ENCODE_FUNCTION.equals(localName)) {
             // create a base64Encode function and set it to the XPath
             return new Base64EncodeFunction();
+        } else if (localName != null &&
+                   SynapseXPathConstants.BASE64_DECODE_FUNCTION.equals(localName)) {
+            // create a base64Decode function and set it to the XPath
+            return new Base64DecodeFunction();
+        } else if (localName != null &&
+                   SynapseXPathConstants.URL_ENCODE_FUNCTION.equals(localName)) {
+            // create a url-encode function and set it to the XPath
+            return new URLEncodeFunction();
         }
         //We check if custom Xpath extensions are available
         Function extensionFunction = XpathExtensionUtil.getFunctionContext(
diff --git a/java/modules/core/src/main/java/org/apache/synapse/util/xpath/URLEncodeFunction.java b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/URLEncodeFunction.java
new file mode 100644
index 0000000..3c41f6a
--- /dev/null
+++ b/java/modules/core/src/main/java/org/apache/synapse/util/xpath/URLEncodeFunction.java
@@ -0,0 +1,105 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.util.xpath;
+
+import org.apache.commons.httpclient.URIException;
+import org.apache.commons.httpclient.util.URIUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jaxen.Context;
+import org.jaxen.Function;
+import org.jaxen.FunctionCallException;
+import org.jaxen.function.StringFunction;
+
+import java.util.List;
+
+/**
+ * Implements the XPath extension function synapse:url-encode(string)
+ */
+public class URLEncodeFunction implements Function {
+
+    private static final Log log = LogFactory.getLog(URLEncodeFunction.class);
+
+    /**
+     * Returns the url-encoded string value of the first argument.
+     *
+     * @param context the context at the point in the expression when the function is called
+     * @param args  arguments of the functions
+     * @return The string value of a property
+     * @throws FunctionCallException
+     */
+    public Object call(Context context, List args) throws FunctionCallException {
+        boolean debugOn = log.isDebugEnabled();
+
+        if (args == null || args.size() == 0) {
+            if (debugOn) {
+                log.debug("Property key value for lookup is not specified");
+            }
+            return SynapseXPathConstants.NULL_STRING;
+        }
+
+        int size = args.size();
+        if (size == 1) {
+            // get the first argument, it can be a function returning a string as well
+            String value = StringFunction.evaluate(args.get(0), context.getNavigator());
+
+            // use the default UTF-8 encoding
+            return encode(debugOn, SynapseXPathConstants.DEFAULT_CHARSET, value);
+        } else if (size == 2) {
+            // get the first argument, it can be a function returning a string as well
+            String value = StringFunction.evaluate(args.get(0), context.getNavigator());
+
+            // encoding is in the second argument
+            String encoding = StringFunction.evaluate(args.get(1), context.getNavigator());
+            
+            return encode(debugOn, encoding, value);
+        } else if (debugOn) {
+            log.debug("url-encode function expects only one argument, returning empty string");
+        }
+        // return empty string if the arguments are wrong
+        return SynapseXPathConstants.NULL_STRING;
+    }
+
+    private Object encode(boolean debugOn, String encoding, String value) throws FunctionCallException {
+        if (value == null || "".equals(value)) {
+            if (debugOn) {
+                log.debug("Non empty string value should be provided for encoding");
+            }
+
+            return SynapseXPathConstants.NULL_STRING;
+        }
+
+        String encodedString;
+        try {
+            encodedString = URIUtil.encodePathQuery(value, encoding);
+        } catch (URIException e) {
+            String msg = "Unsupported charset encoding";
+            log.error(msg, e);
+            throw new FunctionCallException(msg, e);
+        }
+
+        if (debugOn) {
+            log.debug("Converted string: " + value + " with encoding: " + encoding +
+                    " to url encoded value: " + encodedString);
+        }
+
+        return encodedString;
+    }
+}
diff --git a/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java b/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
index 86de6ee..2e2edcb 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
@@ -95,6 +95,17 @@
         }
     }
 
+    public Object getLocalEntry(String key) {
+        Object ret = properties.get(key);
+        if (ret != null) {
+            return ret;
+        } else if (getConfiguration() != null) {
+            return getConfiguration().getLocalRegistryEntry(key);
+        } else {
+            return null;
+        }
+    }
+
     public void setProperty(String key, Object value) {
         properties.put(key, value);
     }
diff --git a/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorConfigurationTest.java b/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorConfigurationTest.java
index 2f9906f..49fc46b 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorConfigurationTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorConfigurationTest.java
@@ -31,7 +31,7 @@
 
     public void testNamespaceUnqualifiedScenarioOne() {
         try {
-            String inputXml = "<header xmlns=\"http://ws.apache.org/ns/synapse\" name=\"MyHeader\" value=\"MyValue\"/>";
+            String inputXml = "<s:header xmlns:s=\"http://ws.apache.org/ns/synapse\" name=\"MyHeader\" value=\"MyValue\"/>";
             HeaderMediatorFactory fac = new HeaderMediatorFactory();
             fac.createMediator(AXIOMUtil.stringToOM(inputXml), new Properties());
             fail("HeaderMediator created with namespace unqualified SOAP header");
@@ -42,7 +42,7 @@
         }
 
         try {
-            String inputXml = "<header xmlns=\"http://ws.apache.org/ns/synapse\" name=\"MyHeader\" action=\"remove\"/>";
+            String inputXml = "<s:header xmlns:s=\"http://ws.apache.org/ns/synapse\" name=\"MyHeader\" action=\"remove\"/>";
             HeaderMediatorFactory fac = new HeaderMediatorFactory();
             fac.createMediator(AXIOMUtil.stringToOM(inputXml), new Properties());
             fail("HeaderMediator created with namespace unqualified SOAP header");
@@ -122,4 +122,40 @@
         }
     }
 
+    public void testTransportScope() {
+        try {
+            String inputXml = "<header xmlns=\"http://ws.apache.org/ns/synapse\" name=\"User-Agent\" value=\"SynapseUser\" scope=\"transport\"/>";
+            HeaderMediatorFactory fac = new HeaderMediatorFactory();
+            fac.createMediator(AXIOMUtil.stringToOM(inputXml), new Properties());
+        } catch (XMLStreamException e) {
+            fail("Error while parsing header mediator configuration");
+        }
+
+        try {
+            String inputXml = "<header xmlns=\"http://ws.apache.org/ns/synapse\" name=\"User-Agent\" action=\"remove\" scope=\"transport\"/>";
+            HeaderMediatorFactory fac = new HeaderMediatorFactory();
+            fac.createMediator(AXIOMUtil.stringToOM(inputXml), new Properties());
+        } catch (XMLStreamException e) {
+            fail("Error while parsing header mediator configuration");
+        }
+    }
+
+    public void testSOAPScopeScenario() {
+        try {
+            String inputXml = "<header xmlns=\"http://ws.apache.org/ns/synapse\" xmlns:m=\"http://synapse.apache.org\" name=\"m:MyHeader\" value=\"MyValue\" scope=\"soap\"/>";
+            HeaderMediatorFactory fac = new HeaderMediatorFactory();
+            fac.createMediator(AXIOMUtil.stringToOM(inputXml), new Properties());
+        } catch (XMLStreamException e) {
+            fail("Error while parsing header mediator configuration");
+        }
+
+        try {
+            String inputXml = "<header xmlns=\"http://ws.apache.org/ns/synapse\" xmlns:m=\"http://synapse.apache.org\" name=\"m:MyHeader\" action=\"remove\" scope=\"soap\"/>";
+            HeaderMediatorFactory fac = new HeaderMediatorFactory();
+            fac.createMediator(AXIOMUtil.stringToOM(inputXml), new Properties());
+        } catch (XMLStreamException e) {
+            fail("Error while parsing header mediator configuration");
+        }
+    }
+
 }
diff --git a/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorSerializationTest.java b/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorSerializationTest.java
index 053f801..4b6d580 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorSerializationTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/config/xml/HeaderMediatorSerializationTest.java
@@ -45,4 +45,10 @@
         assertTrue(serialization(inputXml, headerMediatorFactory, headerMediatorSerializer));
         assertTrue(serialization(inputXml, headerMediatorSerializer));
     }
+
+    public void testHeaderMediatorSerializationSenarioThree() throws Exception {
+        String inputXml = "<header xmlns=\"http://ws.apache.org/ns/synapse\" name=\"User-Agent\" value=\"SynapseUser\" scope=\"transport\"/>";
+        assertTrue(serialization(inputXml, headerMediatorFactory, headerMediatorSerializer));
+        assertTrue(serialization(inputXml, headerMediatorSerializer));
+    }
 }
diff --git a/java/modules/core/src/test/java/org/apache/synapse/config/xml/RespondMediatorSerializationTest.java b/java/modules/core/src/test/java/org/apache/synapse/config/xml/RespondMediatorSerializationTest.java
new file mode 100644
index 0000000..3f39c57
--- /dev/null
+++ b/java/modules/core/src/test/java/org/apache/synapse/config/xml/RespondMediatorSerializationTest.java
@@ -0,0 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.config.xml;
+
+public class RespondMediatorSerializationTest extends AbstractTestCase {
+
+    RespondMediatorFactory respondMediatorFactory;
+    RespondMediatorSerializer respondMediatorSerializer;
+
+    public RespondMediatorSerializationTest() {
+        super(RespondMediatorSerializationTest.class.getName());
+        respondMediatorFactory = new RespondMediatorFactory();
+        respondMediatorSerializer = new RespondMediatorSerializer();
+    }
+
+    public void testRespondMediatorSerializationSenarioOne() throws Exception {
+        String inputXml = "<respond xmlns=\"http://ws.apache.org/ns/synapse\" />";
+        assertTrue(serialization(inputXml, respondMediatorFactory, respondMediatorSerializer));
+        assertTrue(serialization(inputXml, respondMediatorSerializer));
+    }
+}
diff --git a/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java b/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
index c3c64d6..c9ddc8a 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/eventing/builders/MessageBuilderTest.java
@@ -21,6 +21,8 @@
 
 import junit.framework.TestCase;
 import org.apache.synapse.mediators.TestUtils;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
 import org.apache.synapse.eventing.SynapseSubscription;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.addressing.EndpointReference;
@@ -32,9 +34,10 @@
 import java.util.Calendar;
 import java.util.Date;
 
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class MessageBuilderTest extends TestCase {
 
-    public void testSubscriptionMessageBuilderScenarioOne() {
+    public void testSubscriptionMessageBuilderScenario1() {
         String subManUrl = "http://synapse.test.com/eventing/subscriptions";
         String addressUrl = "http://www.other.example.com/OnStormWarning";
         String filterDialect = "http://www.example.org/topicFilter";
@@ -78,15 +81,15 @@
             assertEquals(filterDialect, sub.getFilterDialect());
             assertEquals(filter, sub.getFilterValue());
             assertEquals(date, sub.getExpires().getTime());
-            assertNull(SubscriptionMessageBuilder.getErrorCode());
-            assertNull(SubscriptionMessageBuilder.getErrorReason());
-            assertNull(SubscriptionMessageBuilder.getErrorSubCode());
+            assertNull(sub.getErrorCode());
+            assertNull(sub.getErrorReason());
+            assertNull(sub.getErrorSubCode());
         } catch (Exception e) {
             fail("Error while constructing the sample subscription request: " + e.getMessage());
         }
     }
 
-    public void testSubscriptionMessageBuilderScenarioTwo() {
+    public void testSubscriptionMessageBuilderScenario2() {
         String addressUrl = "http://synapse.test.com/eventing/subscriptions";
 
         String message = "<wse:Unsubscribe xmlns:wse=\"http://schemas.xmlsoap.org/ws/2004/08/eventing\"/>";
@@ -99,9 +102,9 @@
             SynapseSubscription sub = SubscriptionMessageBuilder.createUnSubscribeMessage(msgCtx);
             assertEquals(id, sub.getId());
             assertEquals(addressUrl, sub.getAddressUrl());
-            assertNull(SubscriptionMessageBuilder.getErrorCode());
-            assertNull(SubscriptionMessageBuilder.getErrorReason());
-            assertNull(SubscriptionMessageBuilder.getErrorSubCode());
+            assertNull(sub.getErrorCode());
+            assertNull(sub.getErrorReason());
+            assertNull(sub.getErrorSubCode());
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -109,7 +112,7 @@
         }
     }
 
-    public void testSubscriptionMessageBuilderScenarioThree() {
+    public void testSubscriptionMessageBuilderScenario3() {
         String addressUrl = "http://synapse.test.com/eventing/subscriptions";
         Date date = new Date(System.currentTimeMillis() + 3600000);
         Calendar cal = Calendar.getInstance();
@@ -130,9 +133,9 @@
             assertEquals(id, sub.getId());
             assertEquals(addressUrl, sub.getAddressUrl());
             assertEquals(date, sub.getExpires().getTime());
-            assertNull(SubscriptionMessageBuilder.getErrorCode());
-            assertNull(SubscriptionMessageBuilder.getErrorReason());
-            assertNull(SubscriptionMessageBuilder.getErrorSubCode());
+            assertNull(sub.getErrorCode());
+            assertNull(sub.getErrorReason());
+            assertNull(sub.getErrorSubCode());
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -140,7 +143,7 @@
         }
     }
 
-    public void testSubscriptionMessageBuilderScenarioFour() {
+    public void testSubscriptionMessageBuilderScenario4() {
         String addressUrl = "http://synapse.test.com/eventing/subscriptions";
 
         String message =
@@ -154,9 +157,9 @@
             SynapseSubscription sub = SubscriptionMessageBuilder.createGetStatusMessage(msgCtx);
             assertEquals(id, sub.getId());
             assertEquals(addressUrl, sub.getAddressUrl());
-            assertNull(SubscriptionMessageBuilder.getErrorCode());
-            assertNull(SubscriptionMessageBuilder.getErrorReason());
-            assertNull(SubscriptionMessageBuilder.getErrorSubCode());
+            assertNull(sub.getErrorCode());
+            assertNull(sub.getErrorReason());
+            assertNull(sub.getErrorSubCode());
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -164,7 +167,7 @@
         }
     }
 
-    public void testSubscriptionMessageBuilderScenarioFive() {
+    public void testSubscriptionMessageBuilderScenario5() {
         String addressUrl = "http://synapse.test.com/eventing/subscriptions";
 
         String message =
@@ -181,9 +184,9 @@
                     createRenewSubscribeMessage(msgCtx);
             assertNull(id, sub.getId());
             assertEquals(addressUrl, sub.getAddressUrl());
-            assertNotNull(SubscriptionMessageBuilder.getErrorCode());
-            assertNotNull(SubscriptionMessageBuilder.getErrorReason());
-            assertNotNull(SubscriptionMessageBuilder.getErrorSubCode());
+            assertNotNull(sub.getErrorCode());
+            assertNotNull(sub.getErrorReason());
+            assertNotNull(sub.getErrorSubCode());
 
         } catch (Exception e) {
             e.printStackTrace();
diff --git a/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/AbstractEipLibTestCase.java b/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/AbstractEipLibTestCase.java
index e8db426..bc857d1 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/AbstractEipLibTestCase.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/AbstractEipLibTestCase.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.libraries.eip;
 
 import junit.framework.TestCase;
diff --git a/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/EipLibTest.java b/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/EipLibTest.java
index 423b833..e4306e1 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/EipLibTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/libraries/eip/EipLibTest.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.libraries.eip;
 
 import org.apache.axiom.om.OMAbstractFactory;
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractMediatorTestCase.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractMediatorTestCase.java
index 3edbea3..55f19d4 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractMediatorTestCase.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractMediatorTestCase.java
@@ -21,14 +21,8 @@
 
 import junit.framework.TestCase;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.synapse.config.SynapseConfigUtils;
 
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.io.StringReader;
-
 public abstract class AbstractMediatorTestCase extends TestCase {
 
     protected static OMElement createOMElement(String xml) {
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java
index 52cfcc0..897cf11 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java
@@ -19,15 +19,9 @@
 package org.apache.synapse.mediators;
 
 import java.io.IOException;
-import java.io.StringReader;
 import java.util.Properties;
 
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.Mediator;
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/builtin/PropertyMediatorTest.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/builtin/PropertyMediatorTest.java
index 6cb7f2a..227db57 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/builtin/PropertyMediatorTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/builtin/PropertyMediatorTest.java
@@ -140,7 +140,7 @@
         MessageContext synCtx = TestUtils.getTestContext("<getQuote><symbol>IBM</symbol></getQuote>");
         propMediatorOne.mediate(synCtx);
         Object prop = synCtx.getProperty("nameOne");
-        assertEquals(valueOne, prop);
+        assertEquals(valueOne.toString(), prop.toString()); // Objects are not equal, so need to compare the content
 
         // Test XML property retrieval
         String exprValue = new SynapseXPath("synapse:get-property('nameOne')").stringValueOf(synCtx);
@@ -209,6 +209,24 @@
             "value".equals(medProp.getEvaluatedExpression(synCtx)));
     }
 
+    public void testPropertyURLEncoding() throws Exception {
+        // Evaluate url-encode function
+        PropertyMediator propMediator = new PropertyMediator();
+        propMediator.setName("name");
+        propMediator.setValue("this/is+a/synapse test?for=url+encoding");
+
+        MessageContext synCtx = TestUtils.getTestContext("<empty/>");
+        propMediator.mediate(synCtx);
+
+        // read property through a mediator property
+        MediatorProperty mediatorProperty = new MediatorProperty();
+        mediatorProperty.setExpression(new SynapseXPath("url-encode($ctx:name)"));
+
+        assertEquals("this/is%2Ba/synapse%20test?for=url+encoding",
+                mediatorProperty.getEvaluatedExpression(synCtx));
+
+    }
+
     public void testPropertyRegexTest() throws Exception {
         String outputProperty = "regexProperty";
 
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/AbstractSplitMediatorTestCase.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/AbstractSplitMediatorTestCase.java
index a817b93..0d77a02 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/AbstractSplitMediatorTestCase.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/AbstractSplitMediatorTestCase.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.mediators.eip;
 
 import org.apache.axiom.om.OMAbstractFactory;
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/SplitTestHelperMediator.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/SplitTestHelperMediator.java
index 9526f70..721d3e1 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/SplitTestHelperMediator.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/eip/SplitTestHelperMediator.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.mediators.eip;
 
 import org.apache.synapse.mediators.AbstractMediator;
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/elementary/EnrichMediatorTest.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/elementary/EnrichMediatorTest.java
index 7b6daca..583f3a5 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/elementary/EnrichMediatorTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/elementary/EnrichMediatorTest.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.mediators.elementary;
 
 import junit.framework.TestCase;
@@ -85,4 +104,34 @@
         String result = element.getAttributeValue(new QName("gender"));
         assertEquals("male", result);
     }
+
+    /**
+     * Test for SYNAPSE-1007. Check whether message enrichment works when source is set to PROPERTY and
+     * source is not cloned.
+     *
+     * @throws Exception
+     */
+    public void testEnrich4() throws Exception {
+
+        String xml = "<student gender=\"female\"><name>John</name><age>15</age></student>";
+        OMElement omElement = TestUtils.createOMElement(xml);
+
+        EnrichMediator mediator = new EnrichMediator();
+        Source source = new Source();
+        source.setSourceType(EnrichMediator.PROPERTY);
+        source.setProperty("msg_body");
+        source.setClone(false);
+
+        Target target = new Target();
+        target.setTargetType(EnrichMediator.BODY);
+        mediator.setSource(source);
+        mediator.setTarget(target);
+
+        MessageContext msgContext = TestUtils.getTestContext("<empty/>");
+        msgContext.setProperty("msg_body", omElement);
+
+        mediator.mediate(msgContext);
+        OMElement element = msgContext.getEnvelope().getBody().getFirstElement();
+        assertEquals("student", element.getLocalName());
+    }
 }
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/FaultMediatorTest.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/FaultMediatorTest.java
index b7e9447..cc8de39 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/FaultMediatorTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/FaultMediatorTest.java
@@ -24,9 +24,11 @@
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultDetail;
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.config.Entry;
 import org.apache.synapse.mediators.TestUtils;
+import org.apache.synapse.util.xpath.SynapseXPath;
 
 import javax.xml.namespace.QName;
 import java.net.URI;
@@ -40,7 +42,6 @@
     private static final String F_DETAIL = "Some detail text";
 
     public void testSOAP11Fault() throws Exception {
-
         FaultMediator faultMediator = new FaultMediator();
         faultMediator.setSoapVersion(FaultMediator.SOAP11);
         faultMediator.setFaultCodeValue(F_CODE);
@@ -48,7 +49,7 @@
         faultMediator.setFaultRole(new URI(F_ACTOR_URI));
         faultMediator.setFaultDetail(F_DETAIL);
 
-        // invoke transformation, with static enveope
+        // invoke transformation, with static envelope
         MessageContext synCtx = TestUtils.getAxis2MessageContext(
                 "<empty/>", new HashMap<String, Entry>());
         faultMediator.mediate(synCtx);
@@ -61,4 +62,52 @@
         assertTrue(F_DETAIL.equals(fault.getDetail().getText()));
         assertEquals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, envelope.getNamespace().getNamespaceURI());
     }
+
+    public void testSOAP11FaultWithExpression() throws Exception {
+        FaultMediator faultMediator = new FaultMediator();
+        faultMediator.setSoapVersion(FaultMediator.SOAP11);
+        faultMediator.setFaultCodeValue(F_CODE);
+        faultMediator.setFaultReasonValue(F_STRING);
+        faultMediator.setFaultRole(new URI(F_ACTOR_URI));
+        faultMediator.setFaultDetailExpr(new SynapseXPath("get-property('foo')"));
+
+        // invoke transformation, with static envelope
+        MessageContext synCtx = TestUtils.getAxis2MessageContext(
+                "<empty/>", new HashMap<String, Entry>());
+        synCtx.setProperty("foo", "<test>some text</test>");
+        faultMediator.mediate(synCtx);
+
+        SOAPEnvelope envelope = synCtx.getEnvelope();
+        SOAPFault fault = envelope.getBody().getFault();
+        assertTrue(F_CODE.equals(fault.getCode().getTextAsQName()));
+        assertTrue(F_STRING.equals(fault.getReason().getText()));
+        assertTrue(F_ACTOR_URI.equals(fault.getRole().getRoleValue()));
+        SOAPFaultDetail detail = fault.getDetail();
+        assertNotNull(detail.getFirstElement());
+        assertEquals("test", detail.getFirstElement().getLocalName());
+        assertEquals("some text", detail.getFirstElement().getText());
+    }
+
+    public void testSOAP11FaultWithInvalidOutputExpression() throws Exception {
+        FaultMediator faultMediator = new FaultMediator();
+        faultMediator.setSoapVersion(FaultMediator.SOAP11);
+        faultMediator.setFaultCodeValue(F_CODE);
+        faultMediator.setFaultReasonValue(F_STRING);
+        faultMediator.setFaultRole(new URI(F_ACTOR_URI));
+        faultMediator.setFaultDetailExpr(new SynapseXPath("get-property('foo')"));
+
+        // invoke transformation, with static envelope
+        MessageContext synCtx = TestUtils.getAxis2MessageContext(
+                "<empty/>", new HashMap<String, Entry>());
+        synCtx.setProperty("foo", F_DETAIL);
+        faultMediator.mediate(synCtx);
+
+        SOAPEnvelope envelope = synCtx.getEnvelope();
+        SOAPFault fault = envelope.getBody().getFault();
+        assertTrue(F_CODE.equals(fault.getCode().getTextAsQName()));
+        assertTrue(F_STRING.equals(fault.getReason().getText()));
+        assertTrue(F_ACTOR_URI.equals(fault.getRole().getRoleValue()));
+        SOAPFaultDetail detail = fault.getDetail();
+        assertNull(detail.getFirstElement());
+    }
 }
diff --git a/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/HeaderMediatorTest.java b/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/HeaderMediatorTest.java
index e9aedd3..467f2e1 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/HeaderMediatorTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/HeaderMediatorTest.java
@@ -22,13 +22,17 @@
 import junit.framework.TestCase;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.http.protocol.HTTP;
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.config.xml.HeaderMediatorFactory;
+import org.apache.synapse.config.xml.XMLConfigConstants;
+import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.TestUtils;
 import org.apache.synapse.util.xpath.SynapseXPath;
 
 import javax.xml.namespace.QName;
+import java.util.Map;
 import java.util.Properties;
 
 public class HeaderMediatorTest extends TestCase {
@@ -145,4 +149,45 @@
         assertEquals("complexHeader", result.getLocalName());
         assertEquals("TEST", result.getText());
     }
+
+    public void testTransportHeaderSetAndRemove() throws Exception {
+
+        String SYNAPSE_USER = "SynapseUser";
+
+        HeaderMediator headerMediator = new HeaderMediator();
+        headerMediator.setQName(new QName(HTTP.USER_AGENT));
+        headerMediator.setValue(SYNAPSE_USER);
+        headerMediator.setScope(XMLConfigConstants.HEADER_SCOPE_TRANSPORT);
+
+        // invoke transformation, with static envelope
+        MessageContext synCtx = TestUtils.createLightweightSynapseMessageContext("<empty/>");
+        headerMediator.mediate(synCtx);
+
+        // get transport header and assert
+        org.apache.axis2.context.MessageContext axisCtx =
+                ((Axis2MessageContext) synCtx).getAxis2MessageContext();
+        Object transportHeaders = axisCtx.getProperty(
+                org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+        if (transportHeaders == null || !(transportHeaders instanceof Map)) {
+            fail("HeaderMediator Transport headers not found");
+        } else {
+            assertTrue(SYNAPSE_USER.equals(((Map) transportHeaders).get(HTTP.USER_AGENT)));
+        }
+
+        // Removing headers
+        headerMediator.setAction(HeaderMediator.ACTION_REMOVE);
+        headerMediator.mediate(synCtx);
+
+        // get transport header and assert
+        org.apache.axis2.context.MessageContext axisCtx2 =
+                ((Axis2MessageContext) synCtx).getAxis2MessageContext();
+        transportHeaders = axisCtx2.getProperty(
+                org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+        if (transportHeaders == null || !(transportHeaders instanceof Map)) {
+            fail("HeaderMediator Transport headers not found");
+        } else {
+            assertTrue(((Map)transportHeaders).get(HTTP.USER_AGENT) == null);
+        }
+
+    }
 }
diff --git a/java/modules/core/src/test/java/org/apache/synapse/registry/url/SimpleURLRegistryTest.java b/java/modules/core/src/test/java/org/apache/synapse/registry/url/SimpleURLRegistryTest.java
index c1f298d..ab8944e 100644
--- a/java/modules/core/src/test/java/org/apache/synapse/registry/url/SimpleURLRegistryTest.java
+++ b/java/modules/core/src/test/java/org/apache/synapse/registry/url/SimpleURLRegistryTest.java
@@ -110,7 +110,7 @@
         props.put("cachableDuration", "1500");
         reg.init(props);
         
-        OMNode node = reg.lookup(FILE2);
+        OMContainer node = (OMContainer)reg.lookup(FILE2);
         node.serialize(new NullOutputStream());
     }
 
diff --git a/java/modules/core/src/test/java/org/apache/synapse/util/xpath/Base64DecodeFunctionTest.java b/java/modules/core/src/test/java/org/apache/synapse/util/xpath/Base64DecodeFunctionTest.java
new file mode 100644
index 0000000..0f4caf2
--- /dev/null
+++ b/java/modules/core/src/test/java/org/apache/synapse/util/xpath/Base64DecodeFunctionTest.java
@@ -0,0 +1,63 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.util.xpath;
+
+import junit.framework.TestCase;
+import org.jaxen.Context;
+import org.jaxen.ContextSupport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Base64DecodeFunctionTest extends TestCase {
+
+    public void testBase64DecodeFunctionWithCharset() throws Exception {
+        String encodedString = "U3luYXBzZQ==";
+        Base64DecodeFunction base64DecodeFunction = new Base64DecodeFunction();
+        List<String> params = new ArrayList<String>();
+        params.add(encodedString);
+        params.add("UTF-8");
+        Context context = new Context(null);
+        context.setContextSupport(new ContextSupport());
+        String decodedString = (String) base64DecodeFunction.call(context, params);
+        assertEquals("Wrong decoded value found", "Synapse", decodedString);
+
+    }
+
+    public void testBase64DecodeFunctionWithoutCharset() throws Exception {
+        String encodedString = "U3luYXBzZQ==";
+        Base64DecodeFunction base64DecodeFunction = new Base64DecodeFunction();
+        List<String> params = new ArrayList<String>();
+        params.add(encodedString);
+        Context context = new Context(null);
+        context.setContextSupport(new ContextSupport());
+        String decodedString = (String) base64DecodeFunction.call(context, params);
+        assertEquals("Wrong decoded value found", "Synapse", decodedString);
+    }
+
+    public void testBase64DecodeFunctionWithoutParameters() throws Exception {
+        Base64DecodeFunction base64DecodeFunction = new Base64DecodeFunction();
+        List<String> params = new ArrayList<String>();
+        Context context = new Context(null);
+        context.setContextSupport(new ContextSupport());
+        String decodedString = (String) base64DecodeFunction.call(context, params);
+        assertEquals("Wrong decoded value found", "", decodedString);
+    }
+}
diff --git a/java/modules/core/src/test/resources/identity.jks b/java/modules/core/src/test/resources/identity.jks
index 025f25e..e7e6514 100644
--- a/java/modules/core/src/test/resources/identity.jks
+++ b/java/modules/core/src/test/resources/identity.jks
Binary files differ
diff --git a/java/modules/core/src/test/resources/keystore.jks b/java/modules/core/src/test/resources/keystore.jks
index 3a6dd49..e7e6514 100644
--- a/java/modules/core/src/test/resources/keystore.jks
+++ b/java/modules/core/src/test/resources/keystore.jks
Binary files differ
diff --git a/java/modules/core/src/test/resources/org/apache/synapse/core/registry/resource.xml b/java/modules/core/src/test/resources/org/apache/synapse/core/registry/resource.xml
index 65aebd1..ae05af1 100644
--- a/java/modules/core/src/test/resources/org/apache/synapse/core/registry/resource.xml
+++ b/java/modules/core/src/test/resources/org/apache/synapse/core/registry/resource.xml
@@ -1,10 +1,30 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>

-<!--Test resource in registry-->

-<table>

-    <entry id="one">

-        <value>ValueOne</value>

-    </entry>

-    <entry id="two">

-        <value>ValueTwo</value>

-    </entry>

-</table>
\ No newline at end of file
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<!--Test resource in registry-->
+<table>
+    <entry id="one">
+        <value>ValueOne</value>
+    </entry>
+    <entry id="two">
+        <value>ValueTwo</value>
+    </entry>
+</table>
diff --git a/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-conf.xml b/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-conf.xml
index 378dce8..42a6e9e 100644
--- a/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-conf.xml
+++ b/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-conf.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <validate xmlns="http://ws.apache.org/ns/synapse" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" source="s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1]">
     <schema key="validate_schema"/>
     <on-fail>
diff --git a/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-soap.xml b/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-soap.xml
index b305ce4..d0c60d0 100644
--- a/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-soap.xml
+++ b/java/modules/core/src/test/resources/org/apache/synapse/mediators/builtin/synapse-501-soap.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
diff --git a/java/modules/core/src/test/resources/synapse-config/endpoints/epr1.xml b/java/modules/core/src/test/resources/synapse-config/endpoints/epr1.xml
index b704154..cbd3a7b 100644
--- a/java/modules/core/src/test/resources/synapse-config/endpoints/epr1.xml
+++ b/java/modules/core/src/test/resources/synapse-config/endpoints/epr1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <endpoint name="epr1" xmlns="http://ws.apache.org/ns/synapse">
     <address uri="http://localhost:9000/services/LBService1"/>
-</endpoint>
\ No newline at end of file
+</endpoint>
diff --git a/java/modules/core/src/test/resources/synapse-config/proxy-services/proxy1.xml b/java/modules/core/src/test/resources/synapse-config/proxy-services/proxy1.xml
index 24b6643..b7c90d3 100644
--- a/java/modules/core/src/test/resources/synapse-config/proxy-services/proxy1.xml
+++ b/java/modules/core/src/test/resources/synapse-config/proxy-services/proxy1.xml
@@ -1,7 +1,27 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <proxy name="proxy1" xmlns="http://ws.apache.org/ns/synapse">
     <target endpoint="epr1" inSequence="foo">
         <outSequence>
             <send/>
         </outSequence>
     </target>
-</proxy>
\ No newline at end of file
+</proxy>
diff --git a/java/modules/core/src/test/resources/synapse-config/registry.xml b/java/modules/core/src/test/resources/synapse-config/registry.xml
index 072cada..ba0e852 100644
--- a/java/modules/core/src/test/resources/synapse-config/registry.xml
+++ b/java/modules/core/src/test/resources/synapse-config/registry.xml
@@ -1,5 +1,25 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <registry xmlns="http://ws.apache.org/ns/synapse"
           provider="org.apache.synapse.registry.url.SimpleURLRegistry">
     <parameter name="root">file:repository/conf/sample/resources/</parameter>
     <parameter name="cachableDuration">15000</parameter>
-</registry>
\ No newline at end of file
+</registry>
diff --git a/java/modules/core/src/test/resources/synapse-config/sequences/fault.xml b/java/modules/core/src/test/resources/synapse-config/sequences/fault.xml
index 04558d0..0434a0c 100644
--- a/java/modules/core/src/test/resources/synapse-config/sequences/fault.xml
+++ b/java/modules/core/src/test/resources/synapse-config/sequences/fault.xml
@@ -1,4 +1,24 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <sequence name="fault" xmlns="http://ws.apache.org/ns/synapse">
     <log level="full"/>
     <send/>
-</sequence>
\ No newline at end of file
+</sequence>
diff --git a/java/modules/core/src/test/resources/synapse-config/sequences/foo.xml b/java/modules/core/src/test/resources/synapse-config/sequences/foo.xml
index 7d8d8b2..3056edc 100644
--- a/java/modules/core/src/test/resources/synapse-config/sequences/foo.xml
+++ b/java/modules/core/src/test/resources/synapse-config/sequences/foo.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <sequence name="foo" xmlns="http://ws.apache.org/ns/synapse">
     <filter source="get-property('To')" regex=".*/StockQuote.*">
         <then>
@@ -8,4 +28,4 @@
         </else>
     </filter>
     <send/>
-</sequence>
\ No newline at end of file
+</sequence>
diff --git a/java/modules/core/src/test/resources/synapse-config/sequences/main.xml b/java/modules/core/src/test/resources/synapse-config/sequences/main.xml
index 9ae1344..fce8516 100644
--- a/java/modules/core/src/test/resources/synapse-config/sequences/main.xml
+++ b/java/modules/core/src/test/resources/synapse-config/sequences/main.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <sequence name="main" xmlns="http://ws.apache.org/ns/synapse">
     <in>
         <log/>
@@ -7,4 +27,4 @@
             </endpoint>
         </send>
     </in>
-</sequence>
\ No newline at end of file
+</sequence>
diff --git a/java/modules/core/src/test/resources/synapse-config/synapse.xml b/java/modules/core/src/test/resources/synapse-config/synapse.xml
index 28e5d92..7c08971 100644
--- a/java/modules/core/src/test/resources/synapse-config/synapse.xml
+++ b/java/modules/core/src/test/resources/synapse-config/synapse.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <definitions xmlns="http://ws.apache.org/ns/synapse">
 
     <endpoint name="synapse_xml_epr1">
@@ -9,4 +29,4 @@
         <drop/>
     </sequence>
     
-</definitions>
\ No newline at end of file
+</definitions>
diff --git a/java/modules/core/src/test/resources/synapse-config/tasks/task1.xml b/java/modules/core/src/test/resources/synapse-config/tasks/task1.xml
index 3289b15..68dd79b 100644
--- a/java/modules/core/src/test/resources/synapse-config/tasks/task1.xml
+++ b/java/modules/core/src/test/resources/synapse-config/tasks/task1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <task class="org.apache.synapse.startup.tasks.MessageInjector"
       name="task1" xmlns="http://ws.apache.org/ns/synapse">
     
@@ -11,4 +31,4 @@
         </m0:getQuote>
     </property>
     <trigger interval="5"/>
-</task>
\ No newline at end of file
+</task>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eipcore-lib.xml b/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eipcore-lib.xml
index 0d094a1..fc90f5e 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eipcore-lib.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eipcore-lib.xml
@@ -1,5 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <assembly>
+    <id>eipcore-lib</id>
     <formats>
         <format>zip</format>
     </formats>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eiptest-lib.xml b/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eiptest-lib.xml
index 2642ca7..c7d633f 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eiptest-lib.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-eiptest-lib.xml
@@ -1,5 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <assembly>
+    <id>eiptest-lib</id>
     <formats>
         <format>zip</format>
     </formats>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-lib.xml b/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-lib.xml
index 6a0a54a..4392e57 100755
--- a/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-lib.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/assembly/assemble-lib.xml
@@ -1,5 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <assembly>
+    <id>test-lib</id>
     <formats>
         <format>zip</format>
     </formats>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/assembly/filter.properties b/java/modules/core/src/test/resources/synapse-libraries/assembly/filter.properties
deleted file mode 100644
index 33735ae..0000000
--- a/java/modules/core/src/test/resources/synapse-libraries/assembly/filter.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-product.name=Apache Synapse
-product.version=2.2.0-SNAPSHOT
-
diff --git a/java/modules/core/src/test/resources/synapse-libraries/skeleton/artifacts.xml b/java/modules/core/src/test/resources/synapse-libraries/skeleton/artifacts.xml
index dc00c7f..420403f 100755
--- a/java/modules/core/src/test/resources/synapse-libraries/skeleton/artifacts.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/skeleton/artifacts.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <artifacts>
     <artifact name="SynapseLinkedinLib" package="org.apache.synapse.linkedin" >
         <dependency artifact="linkedin_core" />
diff --git a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/artifact.xml b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/artifact.xml
index f164127..0c6b0f6 100755
--- a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/artifact.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/artifact.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <artifact name="linkedin_core" type="synapse/template" >
 
     <subArtifacts> 
diff --git a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/post_status.xml b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/post_status.xml
index 83aa2d5..2d98fa9 100755
--- a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/post_status.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/post_status.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <template xmlns="http://ws.apache.org/ns/synapse" name="post_status">
         <parameter name="status"/>
         <sequence>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/register_user.xml b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/register_user.xml
index 9030dcf..f7118f1 100755
--- a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/register_user.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/register_user.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <template xmlns="http://ws.apache.org/ns/synapse" name="register_user">
         <parameter name="oauth.consumerKey"/>
         <parameter name="oauth.consumerSecret"/>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/send_message.xml b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/send_message.xml
index 12ec103..765bf5a 100755
--- a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/send_message.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/send_message.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <template xmlns="http://ws.apache.org/ns/synapse" name="send_message">
         <parameter name="idList"/>
         <parameter name="subject"/>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/show_headline.xml b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/show_headline.xml
index d3a1e55..04db4cd 100755
--- a/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/show_headline.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/skeleton/linkedin_core/show_headline.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <template xmlns="http://ws.apache.org/ns/synapse" name="show_headline">
         <parameter name="id"/>
         <sequence>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/artifacts.xml b/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/artifacts.xml
index e69de29..0e29d96 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/artifacts.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/artifacts.xml
@@ -0,0 +1,20 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
diff --git a/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/artifact.xml b/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/artifact.xml
index e69de29..0e29d96 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/artifact.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/artifact.xml
@@ -0,0 +1,20 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
diff --git a/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/template_splitter.xml b/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/template_splitter.xml
index e69de29..0e29d96 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/template_splitter.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/synapse-eip-lib/eip_systemManagement/template_splitter.xml
@@ -0,0 +1,20 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
diff --git a/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/artifacts.xml b/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/artifacts.xml
index c936621..1ebd629 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/artifacts.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/artifacts.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <artifacts>
     <artifact name="EipLibrary" package="synapse.lang.eip" >
         <dependency artifact="systemManagement" />
diff --git a/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/artifact.xml b/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/artifact.xml
index d349d09..13be6c6 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/artifact.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/artifact.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <artifact name="systemManagement" type="synapse/template">
 
     <subArtifacts>
@@ -8,4 +28,4 @@
         </artifact>
     </subArtifacts>
 
-</artifact>
\ No newline at end of file
+</artifact>
diff --git a/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/template_splitter.xml b/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/template_splitter.xml
index 667842d..1b68777 100644
--- a/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/template_splitter.xml
+++ b/java/modules/core/src/test/resources/synapse-libraries/synapse-eiptest-lib/eip_systemManagement/template_splitter.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <template xmlns="http://ws.apache.org/ns/synapse" name="splitter">
     <parameter name="iterate_exp"/>
     <parameter name="endpoint_uri"/>
diff --git a/java/modules/core/src/test/resources/trust.jks b/java/modules/core/src/test/resources/trust.jks
index 98c9a91..e7e6514 100644
--- a/java/modules/core/src/test/resources/trust.jks
+++ b/java/modules/core/src/test/resources/trust.jks
Binary files differ
diff --git a/java/modules/distribution/pom.xml b/java/modules/distribution/pom.xml
index 9257532..693567c 100644
--- a/java/modules/distribution/pom.xml
+++ b/java/modules/distribution/pom.xml
@@ -17,15 +17,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -102,7 +99,7 @@
             <artifactId>addressing</artifactId>
             <type>mar</type>
         </dependency>
-        
+
         <!-- Because of a design flaw in Axis2 (see AXIS2-4265), axis2-codegen is required
              to deploy some modules => include this explicitly. -->
         <dependency>
@@ -110,6 +107,12 @@
             <artifactId>axis2-codegen</artifactId>
         </dependency>
 
+        <!-- JSON Support -->
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-json</artifactId>
+        </dependency>
+
         <!-- Additional transports -->
         <dependency>
             <groupId>org.apache.axis2</groupId>
@@ -133,7 +136,7 @@
             <artifactId>xmltask</artifactId>
             <version>1.14</version>
         </dependency>
-        
+
         <!-- Patches -->
         <dependency>
             <groupId>org.apache.synapse</groupId>
@@ -141,15 +144,11 @@
             <classifier>jars</classifier>
             <type>zip</type>
         </dependency>
-        <dependency>
-            <groupId>org.apache.woden</groupId>
-            <artifactId>woden-core</artifactId>
-        </dependency>
         <!--dependency>
             <groupId>xerces</groupId>
             <artifactId>xercesImpl</artifactId>
         </dependency-->
-        
+
         <!-- Libraries packaged with the sample Axis2 server (but that are not useful for Synapse itself) -->
         <dependency>
             <groupId>org.apache.axis2</groupId>
@@ -159,7 +158,7 @@
 
     <repositories>
         <!-- This is for xmltask -->
-        <repository>
+        <!--repository>
             <id>atlassian-developer-site</id>
             <name>Atlassian Maven 2 Contributor Repository</name>
             <url>http://maven.atlassian.com/repository/public</url>
@@ -169,7 +168,7 @@
             <snapshots>
                 <enabled>false</enabled>
             </snapshots>
-        </repository>
+        </repository-->
     </repositories>
 
     <build>
@@ -184,9 +183,10 @@
                             <goal>single</goal>
                         </goals>
                         <configuration>
+                            <tarLongFileMode>posix</tarLongFileMode>
                             <descriptors>
                                 <descriptor>src/main/assembly/bin.xml</descriptor>
-                                <!--<descriptor>src/main/assembly/src.xml</descriptor>-->
+                                <descriptor>src/main/assembly/src.xml</descriptor>
                             </descriptors>
                             <finalName>synapse-${synapse.version}</finalName>
                         </configuration>
diff --git a/java/modules/distribution/src/main/assembly/bin.xml b/java/modules/distribution/src/main/assembly/bin.xml
index f2709ea..c3ed7de 100644
--- a/java/modules/distribution/src/main/assembly/bin.xml
+++ b/java/modules/distribution/src/main/assembly/bin.xml
@@ -21,7 +21,7 @@
     <id>bin</id>

     <includeBaseDirectory>false</includeBaseDirectory>

     <formats>

-        <!--<format>tar.gz</format>-->

+        <format>tar.gz</format>

         <format>zip</format>

     </formats>

 

@@ -86,10 +86,10 @@
             <directory>../../modules/distribution/src/main/conf</directory>

             <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>

             <includes>

-                <include>log4j.properties</include>

                 <include>providers.xml</include>

                 <include>identity.jks</include>

                 <include>trust.jks</include>

+                <include>log4j.properties</include>

             </includes>

         </fileSet>

         <fileSet>

@@ -185,9 +185,7 @@
                 <exclude>javax.servlet:servlet-api:jar</exclude>

                 <exclude>xml-apis:xml-apis:jar</exclude>

                 <exclude>xerces:xercesImpl:jar</exclude>

-                <exclude>org.apache.xerces:xercesImpl</exclude> <!-- Find the source of this -->

-                <exclude>org.apache.xerces:xml-apis</exclude>

-                <exclude>quickfixj:quickfixj-all:jar</exclude>

+                <exclude>org.quickfixj:quickfixj-*:jar</exclude>

                 <exclude>org.snmp4j:snmp4j</exclude>

                 <exclude>org.snmp4j:snmp4j-agent</exclude>

                 <exclude>com.rabbitmq:amqp-client:jar</exclude>

diff --git a/java/modules/distribution/src/main/bin/install-synapse-service.bat b/java/modules/distribution/src/main/bin/install-synapse-service.bat
index 7a9cbfb..616556c 100755
--- a/java/modules/distribution/src/main/bin/install-synapse-service.bat
+++ b/java/modules/distribution/src/main/bin/install-synapse-service.bat
@@ -1,4 +1,20 @@
 @echo off

+rem Licensed to the Apache Software Foundation (ASF) under one

+rem or more contributor license agreements.  See the NOTICE file

+rem distributed with this work for additional information

+rem regarding copyright ownership.  The ASF licenses this file

+rem to you under the Apache License, Version 2.0 (the

+rem "License"); you may not use this file except in compliance

+rem with the License.  You may obtain a copy of the License at

+rem 

+rem   http://www.apache.org/licenses/LICENSE-2.0

+rem 

+rem Unless required by applicable law or agreed to in writing,

+rem software distributed under the License is distributed on an

+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+rem KIND, either express or implied.  See the License for the

+rem specific language governing permissions and limitations

+rem under the License.

 setlocal

 

 rem Copyright (c) 1999, 2006 Tanuki Software Inc.

diff --git a/java/modules/distribution/src/main/bin/synapse.sh b/java/modules/distribution/src/main/bin/synapse.sh
index 6d526a9..ec1ff04 100644
--- a/java/modules/distribution/src/main/bin/synapse.sh
+++ b/java/modules/distribution/src/main/bin/synapse.sh
@@ -97,16 +97,19 @@
 SYNAPSE_CLASSPATH=$SYNAPSE_HOME/repository/conf:$JAVA_HOME/lib/tools.jar:$SYNAPSE_CLASSPATH:$CLASSPATH
 
 # use proper bouncy castle version for the JDK
-jdk_15=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.5`
+#jdk_15=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.5`
+jdk_16=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.6`
+jdk_17=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.7`
+jdk_18=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.8`
 
-if [ "$jdk_15" ]; then
-    echo " Using Bouncy castle JAR for Java 1.5"
+if [ "$jdk_16" -o "$jdk_17" -o "$jdk_18" ]; then
+#    echo " Using Bouncy castle JAR for Java 1.5"
     for f in $SYNAPSE_HOME/lib/bcprov-jdk15*.jar
     do
       SYNAPSE_CLASSPATH=$f:$SYNAPSE_CLASSPATH
     done
 else
-    echo " [Warn] Synapse is tested only with Java 5"
+    echo " [Warn] Synapse is tested only with Java 1.8 and prior versions (till 1.6)"
 fi
 
 # For Cygwin, switch paths to Windows format before running java
@@ -169,7 +172,7 @@
 echo "Using JAVA_HOME:       $JAVA_HOME"
 echo "Using SYNAPSE_XML:     $SYNAPSE_XML"
 
-$JAVA_HOME/bin/java -server -Xms128M -Xmx128M \
+$JAVA_HOME/bin/java -server -Xms512M -Xmx512M \
     $XDEBUG \
     $TEMP_PROPS \
     -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration \
diff --git a/java/modules/distribution/src/main/bin/uninstall-synapse-service.bat b/java/modules/distribution/src/main/bin/uninstall-synapse-service.bat
index 3507b19..5e7fc9a 100755
--- a/java/modules/distribution/src/main/bin/uninstall-synapse-service.bat
+++ b/java/modules/distribution/src/main/bin/uninstall-synapse-service.bat
@@ -1,4 +1,20 @@
 @echo off

+rem Licensed to the Apache Software Foundation (ASF) under one

+rem or more contributor license agreements.  See the NOTICE file

+rem distributed with this work for additional information

+rem regarding copyright ownership.  The ASF licenses this file

+rem to you under the Apache License, Version 2.0 (the

+rem "License"); you may not use this file except in compliance

+rem with the License.  You may obtain a copy of the License at

+rem 

+rem   http://www.apache.org/licenses/LICENSE-2.0

+rem 

+rem Unless required by applicable law or agreed to in writing,

+rem software distributed under the License is distributed on an

+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+rem KIND, either express or implied.  See the License for the

+rem specific language governing permissions and limitations

+rem under the License.

 setlocal

 

 rem Copyright (c) 1999, 2006 Tanuki Software Inc.

diff --git a/java/modules/distribution/src/main/conf/identity.jks b/java/modules/distribution/src/main/conf/identity.jks
index 025f25e..e7e6514 100644
--- a/java/modules/distribution/src/main/conf/identity.jks
+++ b/java/modules/distribution/src/main/conf/identity.jks
Binary files differ
diff --git a/java/modules/distribution/src/main/conf/trust.jks b/java/modules/distribution/src/main/conf/trust.jks
index 98c9a91..e7e6514 100644
--- a/java/modules/distribution/src/main/conf/trust.jks
+++ b/java/modules/distribution/src/main/conf/trust.jks
Binary files differ
diff --git a/java/modules/distribution/src/main/release/BUILDING.txt b/java/modules/distribution/src/main/release/BUILDING.txt
index 78e809c..bee8b24 100644
--- a/java/modules/distribution/src/main/release/BUILDING.txt
+++ b/java/modules/distribution/src/main/release/BUILDING.txt
@@ -1,10 +1,10 @@
 Building Synapse from Source
 
-The Synapse source code is available at http://svn.apache.org/repos/asf/webservices/synapse/trunk/java
+The Synapse source code is available at http://svn.apache.org/repos/asf/synapse/trunk/
 
-To build Synapse, you will need JDK 1.5.x., Maven 2.0.6
+To build Synapse, you will need JDK 1.6.0_23 or later version, Maven 3.2.x
 
-The Synapse JARs could be built with Maven 2 as follows:
+The Synapse JARs could be built with Maven 3 as follows:
 
   mvn clean install
 
diff --git a/java/modules/distribution/src/main/release/LICENSE b/java/modules/distribution/src/main/release/LICENSE
index 7356b84..e8067ea 100755
--- a/java/modules/distribution/src/main/release/LICENSE
+++ b/java/modules/distribution/src/main/release/LICENSE
@@ -215,7 +215,9 @@
 
 ===========================
 activation-1.1.jar
-mail-1.4.jar
+mail-1.4.1.jar
+jaxws-tools-2.2.6.jar
+jsr311-api-1.1.1.jar
 ===========================
 
 COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
@@ -499,7 +501,7 @@
 
 
 ====================
-jaxen-1.1.1.jar
+jaxen-1.1.6.jar
 ====================
 
 Copyright 2003-2006 The Werken Company. All Rights Reserved.
@@ -532,51 +534,6 @@
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 =====================
-groovy-all-1.0.jar
-=====================
-
- Copyright 2003 (C) James Strachan and Bob Mcwhirter. All Rights Reserved.
-
- Redistribution and use of this software and associated documentation
- ("Software"), with or without modification, are permitted provided
- that the following conditions are met:
-
- 1. Redistributions of source code must retain copyright
-    statements and notices.  Redistributions must also contain a
-    copy of this document.
-
- 2. Redistributions in binary form must reproduce the
-    above copyright notice, this list of conditions and the
-    following disclaimer in the documentation and/or other
-    materials provided with the distribution.
-
- 3. The name "groovy" must not be used to endorse or promote
-    products derived from this Software without prior written
-    permission of The Codehaus.  For written permission,
-    please contact info@codehaus.org.
-
- 4. Products derived from this Software may not be called "groovy"
-    nor may "groovy" appear in their names without prior written
-    permission of The Codehaus. "groovy" is a registered
-    trademark of The Codehaus.
-
- 5. Due credit should be given to The Codehaus -
-    http://groovy.codehaus.org/
-
- THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
- NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
- THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=====================
 jsch-0.1.31.jar
 =====================
 
@@ -608,24 +565,25 @@
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 =====================
-bcprov-jdk15-132.jar
+bcprov-jdk15-1.45.jar
+bcprov-jdk15on-1.49.jar
 =====================
-Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+Copyright (c) 2000 - 2016 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org)
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 associated documentation files (the "Software"), to deal in the Software without restriction,
 including without limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
 
-The above copyright notice and this permission notice shall be included in all copies or
-substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
-BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 =====================
 wsdl4j-1.6.2.jar
@@ -862,484 +820,9 @@
 
 END Silver Egg Techology License -------------------------------------
 
-=====================
-js-1.6R5.jar
-=====================
-
-                          MOZILLA PUBLIC LICENSE
-                                Version 1.1
-
-                              ---------------
-
-1. Definitions.
-
-     1.0.1. "Commercial Use" means distribution or otherwise making the
-     Covered Code available to a third party.
-
-     1.1. "Contributor" means each entity that creates or contributes to
-     the creation of Modifications.
-
-     1.2. "Contributor Version" means the combination of the Original
-     Code, prior Modifications used by a Contributor, and the Modifications
-     made by that particular Contributor.
-
-     1.3. "Covered Code" means the Original Code or Modifications or the
-     combination of the Original Code and Modifications, in each case
-     including portions thereof.
-
-     1.4. "Electronic Distribution Mechanism" means a mechanism generally
-     accepted in the software development community for the electronic
-     transfer of data.
-
-     1.5. "Executable" means Covered Code in any form other than Source
-     Code.
-
-     1.6. "Initial Developer" means the individual or entity identified
-     as the Initial Developer in the Source Code notice required by Exhibit
-     A.
-
-     1.7. "Larger Work" means a work which combines Covered Code or
-     portions thereof with code not governed by the terms of this License.
-
-     1.8. "License" means this document.
-
-     1.8.1. "Licensable" means having the right to grant, to the maximum
-     extent possible, whether at the time of the initial grant or
-     subsequently acquired, any and all of the rights conveyed herein.
-
-     1.9. "Modifications" means any addition to or deletion from the
-     substance or structure of either the Original Code or any previous
-     Modifications. When Covered Code is released as a series of files, a
-     Modification is:
-          A. Any addition to or deletion from the contents of a file
-          containing Original Code or previous Modifications.
-
-          B. Any new file that contains any part of the Original Code or
-          previous Modifications.
-
-     1.10. "Original Code" means Source Code of computer software code
-     which is described in the Source Code notice required by Exhibit A as
-     Original Code, and which, at the time of its release under this
-     License is not already Covered Code governed by this License.
-
-     1.10.1. "Patent Claims" means any patent claim(s), now owned or
-     hereafter acquired, including without limitation,  method, process,
-     and apparatus claims, in any patent Licensable by grantor.
-
-     1.11. "Source Code" means the preferred form of the Covered Code for
-     making modifications to it, including all modules it contains, plus
-     any associated interface definition files, scripts used to control
-     compilation and installation of an Executable, or source code
-     differential comparisons against either the Original Code or another
-     well known, available Covered Code of the Contributor's choice. The
-     Source Code can be in a compressed or archival form, provided the
-     appropriate decompression or de-archiving software is widely available
-     for no charge.
-
-     1.12. "You" (or "Your")  means an individual or a legal entity
-     exercising rights under, and complying with all of the terms of, this
-     License or a future version of this License issued under Section 6.1.
-     For legal entities, "You" includes any entity which controls, is
-     controlled by, or is under common control with You. For purposes of
-     this definition, "control" means (a) the power, direct or indirect,
-     to cause the direction or management of such entity, whether by
-     contract or otherwise, or (b) ownership of more than fifty percent
-     (50%) of the outstanding shares or beneficial ownership of such
-     entity.
-
-2. Source Code License.
-
-     2.1. The Initial Developer Grant.
-     The Initial Developer hereby grants You a world-wide, royalty-free,
-     non-exclusive license, subject to third party intellectual property
-     claims:
-          (a)  under intellectual property rights (other than patent or
-          trademark) Licensable by Initial Developer to use, reproduce,
-          modify, display, perform, sublicense and distribute the Original
-          Code (or portions thereof) with or without Modifications, and/or
-          as part of a Larger Work; and
-
-          (b) under Patents Claims infringed by the making, using or
-          selling of Original Code, to make, have made, use, practice,
-          sell, and offer for sale, and/or otherwise dispose of the
-          Original Code (or portions thereof).
-
-          (c) the licenses granted in this Section 2.1(a) and (b) are
-          effective on the date Initial Developer first distributes
-          Original Code under the terms of this License.
-
-          (d) Notwithstanding Section 2.1(b) above, no patent license is
-          granted: 1) for code that You delete from the Original Code; 2)
-          separate from the Original Code;  or 3) for infringements caused
-          by: i) the modification of the Original Code or ii) the
-          combination of the Original Code with other software or devices.
-
-     2.2. Contributor Grant.
-     Subject to third party intellectual property claims, each Contributor
-     hereby grants You a world-wide, royalty-free, non-exclusive license
-
-          (a)  under intellectual property rights (other than patent or
-          trademark) Licensable by Contributor, to use, reproduce, modify,
-          display, perform, sublicense and distribute the Modifications
-          created by such Contributor (or portions thereof) either on an
-          unmodified basis, with other Modifications, as Covered Code
-          and/or as part of a Larger Work; and
-
-          (b) under Patent Claims infringed by the making, using, or
-          selling of  Modifications made by that Contributor either alone
-          and/or in combination with its Contributor Version (or portions
-          of such combination), to make, use, sell, offer for sale, have
-          made, and/or otherwise dispose of: 1) Modifications made by that
-          Contributor (or portions thereof); and 2) the combination of
-          Modifications made by that Contributor with its Contributor
-          Version (or portions of such combination).
-
-          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
-          effective on the date Contributor first makes Commercial Use of
-          the Covered Code.
-
-          (d)    Notwithstanding Section 2.2(b) above, no patent license is
-          granted: 1) for any code that Contributor has deleted from the
-          Contributor Version; 2)  separate from the Contributor Version;
-          3)  for infringements caused by: i) third party modifications of
-          Contributor Version or ii)  the combination of Modifications made
-          by that Contributor with other software  (except as part of the
-          Contributor Version) or other devices; or 4) under Patent Claims
-          infringed by Covered Code in the absence of Modifications made by
-          that Contributor.
-
-3. Distribution Obligations.
-
-     3.1. Application of License.
-     The Modifications which You create or to which You contribute are
-     governed by the terms of this License, including without limitation
-     Section 2.2. The Source Code version of Covered Code may be
-     distributed only under the terms of this License or a future version
-     of this License released under Section 6.1, and You must include a
-     copy of this License with every copy of the Source Code You
-     distribute. You may not offer or impose any terms on any Source Code
-     version that alters or restricts the applicable version of this
-     License or the recipients' rights hereunder. However, You may include
-     an additional document offering the additional rights described in
-     Section 3.5.
-
-     3.2. Availability of Source Code.
-     Any Modification which You create or to which You contribute must be
-     made available in Source Code form under the terms of this License
-     either on the same media as an Executable version or via an accepted
-     Electronic Distribution Mechanism to anyone to whom you made an
-     Executable version available; and if made available via Electronic
-     Distribution Mechanism, must remain available for at least twelve (12)
-     months after the date it initially became available, or at least six
-     (6) months after a subsequent version of that particular Modification
-     has been made available to such recipients. You are responsible for
-     ensuring that the Source Code version remains available even if the
-     Electronic Distribution Mechanism is maintained by a third party.
-
-     3.3. Description of Modifications.
-     You must cause all Covered Code to which You contribute to contain a
-     file documenting the changes You made to create that Covered Code and
-     the date of any change. You must include a prominent statement that
-     the Modification is derived, directly or indirectly, from Original
-     Code provided by the Initial Developer and including the name of the
-     Initial Developer in (a) the Source Code, and (b) in any notice in an
-     Executable version or related documentation in which You describe the
-     origin or ownership of the Covered Code.
-
-     3.4. Intellectual Property Matters
-          (a) Third Party Claims.
-          If Contributor has knowledge that a license under a third party's
-          intellectual property rights is required to exercise the rights
-          granted by such Contributor under Sections 2.1 or 2.2,
-          Contributor must include a text file with the Source Code
-          distribution titled "LEGAL" which describes the claim and the
-          party making the claim in sufficient detail that a recipient will
-          know whom to contact. If Contributor obtains such knowledge after
-          the Modification is made available as described in Section 3.2,
-          Contributor shall promptly modify the LEGAL file in all copies
-          Contributor makes available thereafter and shall take other steps
-          (such as notifying appropriate mailing lists or newsgroups)
-          reasonably calculated to inform those who received the Covered
-          Code that new knowledge has been obtained.
-
-          (b) Contributor APIs.
-          If Contributor's Modifications include an application programming
-          interface and Contributor has knowledge of patent licenses which
-          are reasonably necessary to implement that API, Contributor must
-          also include this information in the LEGAL file.
-
-               (c)    Representations.
-          Contributor represents that, except as disclosed pursuant to
-          Section 3.4(a) above, Contributor believes that Contributor's
-          Modifications are Contributor's original creation(s) and/or
-          Contributor has sufficient rights to grant the rights conveyed by
-          this License.
-
-     3.5. Required Notices.
-     You must duplicate the notice in Exhibit A in each file of the Source
-     Code.  If it is not possible to put such notice in a particular Source
-     Code file due to its structure, then You must include such notice in a
-     location (such as a relevant directory) where a user would be likely
-     to look for such a notice.  If You created one or more Modification(s)
-     You may add your name as a Contributor to the notice described in
-     Exhibit A.  You must also duplicate this License in any documentation
-     for the Source Code where You describe recipients' rights or ownership
-     rights relating to Covered Code.  You may choose to offer, and to
-     charge a fee for, warranty, support, indemnity or liability
-     obligations to one or more recipients of Covered Code. However, You
-     may do so only on Your own behalf, and not on behalf of the Initial
-     Developer or any Contributor. You must make it absolutely clear than
-     any such warranty, support, indemnity or liability obligation is
-     offered by You alone, and You hereby agree to indemnify the Initial
-     Developer and every Contributor for any liability incurred by the
-     Initial Developer or such Contributor as a result of warranty,
-     support, indemnity or liability terms You offer.
-
-     3.6. Distribution of Executable Versions.
-     You may distribute Covered Code in Executable form only if the
-     requirements of Section 3.1-3.5 have been met for that Covered Code,
-     and if You include a notice stating that the Source Code version of
-     the Covered Code is available under the terms of this License,
-     including a description of how and where You have fulfilled the
-     obligations of Section 3.2. The notice must be conspicuously included
-     in any notice in an Executable version, related documentation or
-     collateral in which You describe recipients' rights relating to the
-     Covered Code. You may distribute the Executable version of Covered
-     Code or ownership rights under a license of Your choice, which may
-     contain terms different from this License, provided that You are in
-     compliance with the terms of this License and that the license for the
-     Executable version does not attempt to limit or alter the recipient's
-     rights in the Source Code version from the rights set forth in this
-     License. If You distribute the Executable version under a different
-     license You must make it absolutely clear that any terms which differ
-     from this License are offered by You alone, not by the Initial
-     Developer or any Contributor. You hereby agree to indemnify the
-     Initial Developer and every Contributor for any liability incurred by
-     the Initial Developer or such Contributor as a result of any such
-     terms You offer.
-
-     3.7. Larger Works.
-     You may create a Larger Work by combining Covered Code with other code
-     not governed by the terms of this License and distribute the Larger
-     Work as a single product. In such a case, You must make sure the
-     requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
-     If it is impossible for You to comply with any of the terms of this
-     License with respect to some or all of the Covered Code due to
-     statute, judicial order, or regulation then You must: (a) comply with
-     the terms of this License to the maximum extent possible; and (b)
-     describe the limitations and the code they affect. Such description
-     must be included in the LEGAL file described in Section 3.4 and must
-     be included with all distributions of the Source Code. Except to the
-     extent prohibited by statute or regulation, such description must be
-     sufficiently detailed for a recipient of ordinary skill to be able to
-     understand it.
-
-5. Application of this License.
-
-     This License applies to code to which the Initial Developer has
-     attached the notice in Exhibit A and to related Covered Code.
-
-6. Versions of the License.
-
-     6.1. New Versions.
-     Netscape Communications Corporation ("Netscape") may publish revised
-     and/or new versions of the License from time to time. Each version
-     will be given a distinguishing version number.
-
-     6.2. Effect of New Versions.
-     Once Covered Code has been published under a particular version of the
-     License, You may always continue to use it under the terms of that
-     version. You may also choose to use such Covered Code under the terms
-     of any subsequent version of the License published by Netscape. No one
-     other than Netscape has the right to modify the terms applicable to
-     Covered Code created under this License.
-
-     6.3. Derivative Works.
-     If You create or use a modified version of this License (which you may
-     only do in order to apply it to code which is not already Covered Code
-     governed by this License), You must (a) rename Your license so that
-     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
-     "MPL", "NPL" or any confusingly similar phrase do not appear in your
-     license (except to note that your license differs from this License)
-     and (b) otherwise make it clear that Your version of the license
-     contains terms which differ from the Mozilla Public License and
-     Netscape Public License. (Filling in the name of the Initial
-     Developer, Original Code or Contributor in the notice described in
-     Exhibit A shall not of themselves be deemed to be modifications of
-     this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
-     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
-     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
-     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
-     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
-     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
-     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
-     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
-     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
-     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
-     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
-     8.1.  This License and the rights granted hereunder will terminate
-     automatically if You fail to comply with terms herein and fail to cure
-     such breach within 30 days of becoming aware of the breach. All
-     sublicenses to the Covered Code which are properly granted shall
-     survive any termination of this License. Provisions which, by their
-     nature, must remain in effect beyond the termination of this License
-     shall survive.
-
-     8.2.  If You initiate litigation by asserting a patent infringement
-     claim (excluding declatory judgment actions) against Initial Developer
-     or a Contributor (the Initial Developer or Contributor against whom
-     You file such action is referred to as "Participant")  alleging that:
-
-     (a)  such Participant's Contributor Version directly or indirectly
-     infringes any patent, then any and all rights granted by such
-     Participant to You under Sections 2.1 and/or 2.2 of this License
-     shall, upon 60 days notice from Participant terminate prospectively,
-     unless if within 60 days after receipt of notice You either: (i)
-     agree in writing to pay Participant a mutually agreeable reasonable
-     royalty for Your past and future use of Modifications made by such
-     Participant, or (ii) withdraw Your litigation claim with respect to
-     the Contributor Version against such Participant.  If within 60 days
-     of notice, a reasonable royalty and payment arrangement are not
-     mutually agreed upon in writing by the parties or the litigation claim
-     is not withdrawn, the rights granted by Participant to You under
-     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
-     the 60 day notice period specified above.
-
-     (b)  any software, hardware, or device, other than such Participant's
-     Contributor Version, directly or indirectly infringes any patent, then
-     any rights granted to You by such Participant under Sections 2.1(b)
-     and 2.2(b) are revoked effective as of the date You first made, used,
-     sold, distributed, or had made, Modifications made by that
-     Participant.
-
-     8.3.  If You assert a patent infringement claim against Participant
-     alleging that such Participant's Contributor Version directly or
-     indirectly infringes any patent where such claim is resolved (such as
-     by license or settlement) prior to the initiation of patent
-     infringement litigation, then the reasonable value of the licenses
-     granted by such Participant under Sections 2.1 or 2.2 shall be taken
-     into account in determining the amount or value of any payment or
-     license.
-
-     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
-     all end user license agreements (excluding distributors and resellers)
-     which have been validly granted by You or any distributor hereunder
-     prior to termination shall survive termination.
-
-9. LIMITATION OF LIABILITY.
-
-     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
-     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
-     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
-     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
-     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
-     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
-     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
-     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
-     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
-     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
-     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
-     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
-     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
-     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
-     The Covered Code is a "commercial item," as that term is defined in
-     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
-     software" and "commercial computer software documentation," as such
-     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
-     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
-     all U.S. Government End Users acquire Covered Code with only those
-     rights set forth herein.
-
-11. MISCELLANEOUS.
-
-     This License represents the complete agreement concerning subject
-     matter hereof. If any provision of this License is held to be
-     unenforceable, such provision shall be reformed only to the extent
-     necessary to make it enforceable. This License shall be governed by
-     California law provisions (except to the extent applicable law, if
-     any, provides otherwise), excluding its conflict-of-law provisions.
-     With respect to disputes in which at least one party is a citizen of,
-     or an entity chartered or registered to do business in the United
-     States of America, any litigation relating to this License shall be
-     subject to the jurisdiction of the Federal Courts of the Northern
-     District of California, with venue lying in Santa Clara County,
-     California, with the losing party responsible for costs, including
-     without limitation, court costs and reasonable attorneys' fees and
-     expenses. The application of the United Nations Convention on
-     Contracts for the International Sale of Goods is expressly excluded.
-     Any law or regulation which provides that the language of a contract
-     shall be construed against the drafter shall not apply to this
-     License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
-     As between Initial Developer and the Contributors, each party is
-     responsible for claims and damages arising, directly or indirectly,
-     out of its utilization of rights under this License and You agree to
-     work with Initial Developer and Contributors to distribute such
-     responsibility on an equitable basis. Nothing herein is intended or
-     shall be deemed to constitute any admission of liability.
-
-13. MULTIPLE-LICENSED CODE.
-
-     Initial Developer may designate portions of the Covered Code as
-     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
-     Developer permits you to utilize portions of the Covered Code under
-     Your choice of the NPL or the alternative licenses, if any, specified
-     by the Initial Developer in the file described in Exhibit A.
-
-EXHIBIT A -Mozilla Public License.
-
-     ``The contents of this file are subject to the Mozilla Public License
-     Version 1.1 (the "License"); you may not use this file except in
-     compliance with the License. You may obtain a copy of the License at
-     http://www.mozilla.org/MPL/
-
-     Software distributed under the License is distributed on an "AS IS"
-     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-     License for the specific language governing rights and limitations
-     under the License.
-
-     The Original Code is ______________________________________.
-
-     The Initial Developer of the Original Code is ________________________.
-     Portions created by ______________________ are Copyright (C) ______
-     _______________________. All Rights Reserved.
-
-     Contributor(s): ______________________________________.
-
-     Alternatively, the contents of this file may be used under the terms
-     of the _____ license (the  "[___] License"), in which case the
-     provisions of [______] License are applicable instead of those
-     above.  If you wish to allow use of your version of this file only
-     under the terms of the [____] License and not to allow others to use
-     your version of this file under the MPL, indicate your decision by
-     deleting  the provisions above and replace  them with the notice and
-     other provisions required by the [___] License.  If you do not delete
-     the provisions above, a recipient may use your version of this file
-     under either the MPL or the [___] License."
-
-     [NOTE: The text of this Exhibit A may differ slightly from the text of
-     the notices in the Source Code files of the Original Code. You should
-     use the text of this Exhibit A rather than the text found in the
-     Original Code Source Code for Your Modifications.]
 
 
 =====================
-saxon-8.9.jar
-saxon-dom-8.9.jar
 saxon-xqj-8.9.jar
 =====================
 
@@ -1361,151 +844,10 @@
 
 Contributor(s) are listed in the documentation: see notices/contributors.
 
-=====================
-oro-2.0.8.jar
-=====================
-
-   The Apache Software License, Version 1.1
-
-   Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
-   reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-
-   2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in
-      the documentation and/or other materials provided with the
-      distribution.
-
-   3. The end-user documentation included with the redistribution,
-      if any, must include the following acknowledgment:
-         "This product includes software developed by the
-          Apache Software Foundation (http://www.apache.org/)."
-      Alternately, this acknowledgment may appear in the software itself,
-      if and wherever such third-party acknowledgments normally appear.
-
-   4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro"
-      must not be used to endorse or promote products derived from this
-      software without prior written permission. For written
-      permission, please contact apache@apache.org.
-
-   5. Products derived from this software may not be called "Apache"
-      or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their
-      name, without prior written permission of the Apache Software Foundation.
-
-   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-   DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
-   ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-   SUCH DAMAGE.
-   
-=====================
-JLex-0.0.jar
-=====================
-Copyright 1996-2003 by Elliot Joel Berk and C. Scott Ananian
-
-Permission to use, copy, modify, and distribute this software and its documentation for any purpose
-and without fee is hereby granted, provided that the above copyright notice appear in all copies and
-that both the copyright notice and this permission notice and warranty disclaimer appear in
-supporting documentation, and that the name of the authors or their employers not be used in
-advertising or publicity pertaining to distribution of the software without specific, written prior
-permission.
-
-The authors and their employers disclaim all warranties with regard to this software, including all
-implied warranties of merchantability and fitness. In no event shall the authors or their employers
-be liable for any special, indirect or consequential damages or any damages whatsoever resulting from
-loss of use, data or profits, whether in an action of contract, negligence or other tortious action,
-arising out of or in connection with the use or performance of this software.
- 
-=====================
-java-cup-0.0.jar
-=====================
-
-Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian
-
-Permission to use, copy, modify, and distribute this software and its documentation for any purpose
-and without fee is hereby granted, provided that the above copyright notice appear in all copies and
-that both the copyright notice and this permission notice and warranty disclaimer appear in
-supporting documentation, and that the names of the authors or their employers not be used in
-advertising or publicity pertaining to distribution of the software without specific, written prior
-permission.
-
-The authors and their employers disclaim all warranties with regard to this software, including all
-implied warranties of merchantability and fitness. In no event shall the authors or their employers
-be liable for any special, indirect or consequential damages or any damages whatsoever resulting from
-loss of use, data or profits, whether in an action of contract, negligence or other tortious action,
-arising out of or in connection with the use or performance of this software.
-
-=============================
-quickfixj-core-1.3.1.jar
-quickfixj-msg-fix40-1.3.1.jar
-quickfixj-msg-fix41-1.3.1.jar
-quickfixj-msg-fix42-1.3.1.jar
-quickfixj-msg-fix43-1.3.1.jar
-quickfixj-msg-fix44-1.3.1.jar
-=============================
-
-The QuickFIX Software License, Version 1.0
- 
-Copyright (c) 2001-2005 quickfixengine.org  All rights
-reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
- 
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in
-   the documentation and/or other materials provided with the
-   distribution.
-
-3. The end-user documentation included with the redistribution,
-   if any, must include the following acknowledgment:
-      "This product includes software developed by
-       quickfixengine.org (http://www.quickfixengine.org/)."
-   Alternately, this acknowledgment may appear in the software itself,
-   if and wherever such third-party acknowledgments normally appear.
- 
-4. The names "QuickFIX" and "quickfixengine.org" must
-   not be used to endorse or promote products derived from this
-   software without prior written permission. For written
-   permission, please contact ask@quickfixengine.org
- 
-5. Products derived from this software may not be called "QuickFIX",
-   nor may "QuickFIX" appear in their name, without prior written
-   permission of quickfixengine.org
- 
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.  IN NO EVENT SHALL QUICKFIXENGINE.ORG OR
-ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
 
 ======================
-slf4j-api-1.3.0.jar
-slf4j-jdk14-1.3.0.jar
+slf4j-api-1.7.19.jar
+jul-to-slf4j-1.6.1.jar
 ======================
 
 Copyright (c) 2004-2007 QOS.ch All rights reserved.
@@ -1523,3 +865,233 @@
 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 DEALINGS IN THE SOFTWARE.
+
+======================
+slf4j-api-1.7.19.jar
+jul-to-slf4j-1.6.1.jar
+======================
+    Copyright (c) 2004-2013 QOS.ch
+    All rights reserved.
+
+    Permission is hereby granted, free  of charge, to any person obtaining
+    a  copy  of this  software  and  associated  documentation files  (the
+    "Software"), to  deal in  the Software without  restriction, including
+    without limitation  the rights to  use, copy, modify,  merge, publish,
+    distribute,  sublicense, and/or sell  copies of  the Software,  and to
+    permit persons to whom the Software  is furnished to do so, subject to
+    the following conditions:
+
+    The  above  copyright  notice  and  this permission  notice  shall  be
+    included in all copies or substantial portions of the Software.
+
+    THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+    EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+    MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+    OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+======================
+esapi-2.0GA.jar
+======================
+Copyright (c) 2007, The OWASP Foundation (https://www.owasp.org/index.php/Category:
+OWASP_Enterprise_Security_API)
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+======================
+c3p0-0.9.1.1.jar
+======================
+
+Copyright (c) 2015 Machinery For Change, Inc. (http://www.mchange.com/projects/c3p0/)
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT").
+ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation
+   distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by
+that particular Contributor. A Contribution 'originates' from a Contributor if it was added
+to the Program by such Contributor itself or anyone acting on such Contributor's behalf.
+Contributions do not include additions to the Program which: (i) are separate modules of software
+distributed in conjunction with the Program under their own license agreement,
+and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily
+infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive,
+   worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display,
+   publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and
+   such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive,
+   worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell,
+   import and otherwise transfer the Contribution of such Contributor, if any, in source code and object
+   code form. This patent license shall apply to the combination of the Contribution and the Program if,
+   at the time the Contribution is added by the Contributor, such addition of the Contribution causes
+   such combination to be covered by the Licensed Patents. The patent license shall not apply to any
+   other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set
+   forth herein, no assurances are provided by any Contributor that the Program does not infringe the
+   patent or other intellectual property rights of any other entity. Each Contributor disclaims any
+   liability to Recipient for claims brought by any other entity based on infringement of intellectual
+   property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder,
+   each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed,
+   if any. For example, if a third party patent license is required to allow Recipient to distribute the Program,
+   it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution,
+   if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+======================
+stax2-api-3.1.1.jar
+======================
+    Copyright (c) 2009 FasterXML, LLC (http://wiki.fasterxml.com/WoodstoxHome)
+
+Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+======================
+classworlds-1.1-alpha-2.jar
+======================
+
+ Copyright 2002 (C) The Codehaus. All Rights Reserved.
+
+ Redistribution and use of this software and associated documentation
+ ("Software"), with or without modification, are permitted provided
+ that the following conditions are met:
+
+ 1. Redistributions of source code must retain copyright
+    statements and notices.  Redistributions must also contain a
+    copy of this document.
+
+ 2. Redistributions in binary form must reproduce the
+    above copyright notice, this list of conditions and the
+    following disclaimer in the documentation and/or other
+    materials provided with the distribution.
+
+ 3. The name "classworlds" must not be used to endorse or promote
+    products derived from this Software without prior written
+    permission of The Codehaus.  For written permission, please
+    contact bob@codehaus.org.
+
+ 4. Products derived from this Software may not be called "classworlds"
+    nor may "classworlds" appear in their names without prior written
+    permission of The Codehaus. "classworlds" is a registered
+    trademark of The Codehaus.
+
+ 5. Due credit should be given to The Codehaus.
+    (http://classworlds.codehaus.org/).
+
+ THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+ THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/java/modules/distribution/src/main/release/NOTICE b/java/modules/distribution/src/main/release/NOTICE
index 8e70298..06ec0f8 100644
--- a/java/modules/distribution/src/main/release/NOTICE
+++ b/java/modules/distribution/src/main/release/NOTICE
@@ -1,5 +1,5 @@
 Apache Synapse
-Copyright (c) 2005 - 2008 The Apache Software Foundation
+Copyright (c) 2005 - 2016 The Apache Software Foundation
 
    =========================================================================
    ==  NOTICE file corresponding to the section 4 d of                    ==
@@ -10,34 +10,65 @@
 	This product includes software developed at
 	The Apache Software Foundation (http://www.apache.org/).
 
-The Apache Synapse binary distribution includes software distributed under the
-Apache License (AL) Version 1.1, COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
-(CDDL) Version 1.0, and the Creative Commons Public Domain license. See the
-LICENSE file for details.
+	The Apache Synapse binary distribution includes software distributed under several
+	licenses. See the LICENSE file for details unless the license is specified below.
 
 COPYRIGHT NOTICES
 
-Copyright (c) 2005-2008 The Apache Software Foundation.  All rights reserved.
+ Copyright (c) 2005-2016 The Apache Software Foundation.  All rights reserved.
 
-* Synapse binary is bundled with:
- wso2caching-core-3.4.0.jar
- wso2eventing-api-2.1.jar
- wso2throttle-core-3.2.jar
-     Copyright (c) 2005-2008, WSO2 Inc. (http://wso2.com). All Rights Reserved.
- jaxen-1.1.1.jar
-     Copyright 2003-2006 The Werken Company. All Rights Reserved.
- groovy-all-1.1-rc-1.jar
-	 Copyright 2003 (C) James Strachan and Bob Mcwhirter. All Rights Reserved.
+ Portions Copyright 2006 International Business Machines Corp.
+ Portions Copyright 1997-2011 Oracle Corporation.
+ Portions Copyright 2005-2016 WSO2, Inc.
+
+ quartz-2.2.0.jar
+     Copyright (c) Terracotta, Inc - Licensed under Apache Software License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
+
+ jaxen-1.1.6.jar
+      Copyright (c) 2003-2013 The Werken Company. All Rights Reserved.
+
  jsch-0.1.31.jar
-     Copyright (c) 2002,2003,2004,2005,2006,2007 Atsuhiko Yamanaka, JCraft,Inc. All rights reserved.
- bcprov-ext-jdk15-1.40.jar
- bcprov-jdk14-140.jar
-     Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+     Copyright (c) 2002-2015 Atsuhiko Yamanaka, JCraft,Inc. All rights reserved.
+
+ jettison-1.3.8.jar
+     Copyright (c) 2006 Envoi Solutions LLC  - Licensed under Apache Software License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
+
+ bcprov-jdk15-1.45.jar
+ bcprov-jdk15on-1.49.jar
+     Copyright (c) 2000 - 2016 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
  wrapper-3.2.3.jar
      Copyright (c) 1999, 2006 Tanuki Software, Inc.
- quartz-1.6.0.jar
-     Copyright 2004-2005 OpenSymphony
- JLex-0.0.jar
-     Copyright 1996-2003 by Elliot Joel Berk and C. Scott Ananian
- java-cup-0.0.jar
-     Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian
\ No newline at end of file
+
+ c3p0-0.9.1.1.jar
+    Copyright (c) 2015 Machinery For Change, Inc. (http://www.mchange.com/projects/c3p0/)
+
+ classworlds-1.1-alpha-2.jar
+   Copyright 2002 (c) The Codehaus (http://classworlds.codehaus.org/)
+
+ esapi-2.0GA.jar
+   Copyright (c) 2007, The OWASP Foundation (https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API)
+
+ jaxws-tools-2.2.6.jar
+ jsr311-api-1.1.1.jar
+    Copyright (c) 1997-2011 Oracle Corporation (http://www.oracle.com/)
+
+ slf4j-api-1.7.19.jar
+ jul-to-slf4j-1.6.1.jar
+    Copyright (c) 2004-2013 QOS.ch
+
+ plexus-classworlds-2.2.3.jar
+ plexus-component-annotations-1.5.4.jar
+ plexus-container-default-1.0-alpha-9-stable-1.jar
+ plexus-interpolation-1.11.jar
+ plexus-utils-1.5.4.jar
+    Copyright (c) 2001-2015 Codehaus Plexus. (https://codehaus-plexus.github.io/) - Licensed under Apache Software License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
+
+ stax2-api-3.1.1.jar
+    Copyright (c) 2009 FasterXML, LLC (http://wiki.fasterxml.com/WoodstoxHome)
+
+ xmltask-1.14.jar
+    Copyright (c) 1997-2006 OOPS Consultancy Ltd - Licensed under Apache Software License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
+
+ xmltooling-1.3.2-1.jar
+    Copyright (c) 2011 http://opensaml.org/ - Licensed under Apache Software License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
diff --git a/java/modules/distribution/src/main/release/README.txt b/java/modules/distribution/src/main/release/README.txt
index 0d53940..4bc2220 100644
--- a/java/modules/distribution/src/main/release/README.txt
+++ b/java/modules/distribution/src/main/release/README.txt
@@ -1,4 +1,4 @@
-Apache Synapse 2.0 build  (September 2010) - http://synapse.apache.org/
+Apache Synapse 3.0.1 build  (December 2017) - http://synapse.apache.org/
 ------------------------------------------------------------------------------------------
 
 -------------------
@@ -61,20 +61,19 @@
 Documentation can be found in the 'docs' directory included with the binary distribution 
 and in the 'src/site/resources' directory in the source distribution. 
 
-For Synapse mediation samples please see the Synapse_Quickstart.html, Synapse_Samples.html 
-and Synapse_Samples_Setup.html
+For Synapse mediation samples please see the docs/userguide/quick_start.html, docs/userguide/samples.html
+and docs/userguide/samples/setup/index.html
 
 For more information on the Synapse Configuration language syntax and usage refer to
-Synapse_Configuration_Language.html
+docs/userguide/config.html
 
 -------------------
 Getting Started
 ===================
 
-Refer to the Synapse_Quickstart.html document to get started with Synapse in just a couple of minutes.
+Refer to the docs/userguide/quick_start.html document to get started with Synapse in just a couple of minutes.
 
-More indepth samples could be found in Synapse_Samples_Setup.html and Synapse_Samples.html found in
-the docs directory.
+More indepth samples could be found in docs/userguide/samples.html and docs/userguide/samples/setup/index.html
 
 The actual sample Synapse configurations could be found at <SYNAPSE>/respository/conf/sample.
 The resources sub-directory contains the sample XSLT transformations, XSD schemas, WS policies
diff --git a/java/modules/distribution/src/main/release/docs/release_notes.txt b/java/modules/distribution/src/main/release/docs/release_notes.txt
index 3bc1a19..2805310 100644
--- a/java/modules/distribution/src/main/release/docs/release_notes.txt
+++ b/java/modules/distribution/src/main/release/docs/release_notes.txt
@@ -1,4 +1,4 @@
-Apache Synapse Enterprise Service Bus (ESB) - 1.2 Release Notes - June 2008
+Apache Synapse Enterprise Service Bus (ESB) - 3.0.1 Release Notes - Dec 2017
 
 1. Overview
     The Apache Synapse ESB is a robust, lightweight and highly scalable and distributed
@@ -12,106 +12,41 @@
 
 2. Installation Prerequisites 
 
-    Apache Synapse requires a J2SE runtime of version 1.5.x or later. Running the samples also
-    requires Apache Ant 1.7.x or later. Although Synapse would run with a JDK > 1.5.x, the Script
-    mediator may not properly function on these JDKs. Building Synapse from source requires
-    JDK 1.5.x, and Apache Maven 2.0.6 or later
+    Apache Synapse requires a J2SE runtime of version 1.6.0_23 or later. Running the samples also
+    requires Apache Ant 1.7.x or later. Building Synapse from source requires JDK 1.6.0_23, and
+    Apache Maven 3.2.x or later.
 
 3. Quick start
-    Please see the docs/Synapse_Quickstart.html guide
+    Please see the docs/userguide/quick_start.html
 
 4. Building the Samples
-    Please see the documents docs/Synapse_Samples.html and docs/Synapse_Samples_Setup.html
+    Please see the documents docs/userguide/samples.html and docs/userguide/samples/setup/index.html
 
 5. Synapse configuration language
-    Please see the document docs/Synapse_Configuration_Language.html
+    Please see the document docs/userguide/config.html
 
 6. Extending Synapse
-    Please see the document docs/Synapse_Extending.html
-    
-7. Known Issues and limitations
+    Please see the document /docs/userguide/extending.html
 
-  * SYNAPSE-180 Does not support throttling by concurrency within a cluster
-  * SYNAPSE-186 Does not support HTTP some of the REST operations (such as put/delete etc)
-  * SYNAPSE-181 Does not yet support JTA transactions
-  * SYNAPSE-330 Does not yet support load balancing with session affinity using SOAP sessions
-  * SYNAPSE-280 Does not preserve CDATA sections within payloads
-  * SYNAPSE-307 The XSLT mediator will not report errors encountered in a provided stylesheet
-
-  * The Synapse JMS implementation supports JMS 1.0.2b, however due to licensing issues we include
-    the JMS 1.1 spec JAR from Apache Geronimo (geronimo-jms_1.1_spec-1.1.jar) instead. If you have
-    any issues with JMS 1.0.x, please download the Sun JMS 1.0.2b JAR and replace supplied JAR from
-    Geronimo.
-
-8. Frequently asked questions
+7. Frequently asked questions
 
   * How can I change the default logging level of Synapse?
     Edit the lib/log4j.properties and set the line "log4j.category.org.apache.synapse=INFO" to
     "log4j.category.org.apache.synapse=DEBUG" and restart Synapse.
 
   * If you get an error related to WS-Security or when using it, check to ensure that your JDK
-    uses the "Unlimited Strength Jurisdiction Policy Files". These could be downloaded from
-    http://java.sun.com/javase/downloads/index_jdk5.jsp Refer to the associated documentation
-    for instructions on how to install it to your JDK.
+    uses the "Unlimited Strength Jurisdiction Policy Files". These could be downloaded online and
+    refer to the associated documentation for instructions on how to install it to your JDK.
 
-  * If you encounter issues with your JDK related to XML processing, try placing the Xerces jar
-    files xercesImpl-2.8.0.jar and xml-apis-1.3.03.jar in your <JDK>/jre/lib/endorsed/ directory.
-
-9. Reporting Problems
+8. Reporting Problems
 
     Please use the Apache JIRA system (http://issues.apache.org/jira/browse/SYNAPSE) to report issues
     You may also join the:
         synapse-dev mailing  list by sending email to dev-subscribe@synapse.apache.org
         synapse-user mailing list by sending email to user-subscribe@synapse.apache.org
 
-10. New features
-    The 1.2 release
-        * Support for Hessian binary messages
-        * FIX (Financial Information eXchange) protocol transport
-        * WS-Reliable Messaging support with WSO2 Mercury
-        * Support for re-usable database connection pools for DB report/lookup mediators
-        * Support for GZip encoding and HTTP 100 continue
-        * Natural support for dual channel messaging with WS-Addressing
-        * Cluster aware sticky load balancing support
-        * Non-blocking streaming of large messages at high concurreny with constant memory usage
-        * Support for an ELSE clause for the Filter mediator
-        * Ability to specify XPath expressions relative to the envelope or body
-        * Support for separate policies for incoming/outgoing messages
-        * Support for a mandatory sequence before mediation
+9. New in Version 3.0.1
 
-    The 1.1.1/1.1.2 releases                
-        * Enhanced clustering support for the Cache/Throttle Mediators
-        * New Mail transport that supports POP3/IMAP/SMTP
-        * JMX Monitoring support
-        * Callout Mediator
-        * Improved JMS/VFS transports
-        * Improved REST/POX support
-        * Annotations support for POJOCommand mediator
-        * Ability to pin a proxy or a task to server instances
+    This is a patch release which contains minor bug fixes and upgrades in libraries like axis2,
+    commons-collections, etc.
 
-    The 1.1 release
-        * Apache VFS based file transport
-        * Scheduled Task support
-        * XQuery mediator
-        * POJO Command mediator
-        * DB Report and DB Lookup mediators
-        * Cache and Throttle mediators/enhancements
-        * Split/Clone/Aggregate mediators
-        * Improved logging and tracing support
-
-    The 1.0 release
-        * Non blocking HTTP and HTTPS transport based on Apache HttpCore/NIO
-        * Proxy services with in/out/fault sequences, endpoints, inline sequences and WSDL support
-        * WSDL endpoints
-        * Load balancing and Failover endpoints
-        * Throttling mediator
-
-    The 0.91 release adds support for:
-        * WS-Reliable Messaging Sequence management
-
-    The 0.90 release adds support for:
-        * WS-Security termination and initiation
-        * WS-ReliableMessaging termination and initiation
-        * Support for dynamic reloading and remote reigstries
-        * Scripting mediators based on Apache BSF
-        * Refactored and cleaner synapse configuration xml
diff --git a/java/modules/documentation/pom.xml b/java/modules/documentation/pom.xml
index 81f5f0e..b88f355 100644
--- a/java/modules/documentation/pom.xml
+++ b/java/modules/documentation/pom.xml
@@ -18,22 +18,19 @@
   ~  under the License.
   -->
 
-<project
-        xmlns="http://maven.apache.org/POM/4.0.0"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
     <groupId>org.apache.synapse</groupId>
     <artifactId>synapse-documentation</artifactId>
     <packaging>pom</packaging>
-    <name>Apache Synapse - Documentation</name>
+    <name>Apache Synapse</name>
     <description>Apache Synapse - Documentation Pack</description>
 
     <scm>
diff --git a/java/modules/documentation/src/main/assembly/docs.xml b/java/modules/documentation/src/main/assembly/docs.xml
index 2aa9576..a95acf7 100644
--- a/java/modules/documentation/src/main/assembly/docs.xml
+++ b/java/modules/documentation/src/main/assembly/docs.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
diff --git a/java/modules/documentation/src/site/resources/css/site.css b/java/modules/documentation/src/site/resources/css/site.css
index 053010c..ffe418f 100644
--- a/java/modules/documentation/src/site/resources/css/site.css
+++ b/java/modules/documentation/src/site/resources/css/site.css
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 @import url(http://fonts.googleapis.com/css?family=Buenard);
 body, p, div, ul, li, a, tr, td,th{
     font-family: 'Buenard', serif;
@@ -16,6 +35,7 @@
     /*text-shadow:-1px -1px 2px #ADA9A9;*/
     margin:3px 0px;    
 }
+
 h3{
     background-color:transparent;
     border:none;
@@ -24,25 +44,7 @@
     /*text-shadow:-1px -1px 2px #ADA9A9;*/
     margin:3px 0px;
 }
-div#contentBox h4{
-    margin:3px 0px;
-    font-size:15px;
-    color: #666666;
-    font-weight:bold;
-    border:none;
-    padding:0;
-    background-color:transparent;
-}
-div#contentBox h5{
-    margin:3px 0px;
-    font-size:15px;
-}
-div#contentBox{
-    padding-top:10px;
-}
-p,li{
-    line-height:25px;
-}
+
 #bannerLeft{
     text-align:right;
     position:absolute;
@@ -50,6 +52,7 @@
     top:30px;
     color:#4c4c4c;
 }
+
 #banner{
     height:90px;
     background:transparent url(../images/synapse-logo.png) no-repeat left top;
@@ -64,49 +67,7 @@
     margin:0px 0px !important;
     border-top:solid 5px #000;
 }
-.xright{
-    float:none;
-}
-#breadcrumbs{
-     background-image: -webkit-gradient(linear, left top, left bottom, from(#c2c2c2), to(#d7d7d7)); /* mozilla - FF3.6+ */
-    background-image: -moz-linear-gradient(top, #c2c2c2 0%, #d7d7d7 100%); /* IE 5.5 - 7 */
-    filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#c2c2c2',EndColorStr='#d7d7d7'); /* IE8 */
-    -ms-filter: progid: DXImageTransform . Microsoft . gradient(gradientType = 0, startColor = '#c2c2c2', endColoStr = '#d7d7d7'); /*Transparent back */
 
-      /*Rounded corners */
-    -moz-border-radius: 3px;
-    border-radius: 3px;
-    border: solid 1px #888888;
-
-    /*The shadow */
-    -moz-box-shadow: 3px 3px 2px #ddd;
-    -webkit-box-shadow: 3px 3px 2px #ddd;
-    box-shadow: 3px 3px 2px #ddd;
-
-    color:#707070;
-
-    margin:0px 20px;
-    padding:5px;
-
-    /*text-shadow: -1px -1px 2px #918D8D;*/
-}
-#leftColumn{
-    margin:20px 20px;
-
-
-    background-color:#e9e9e9;
-
-       /*Rounded corners */
-    -moz-border-radius: 3px;
-    border-radius: 3px;
-
-    /*The shadow */
-    -moz-box-shadow: 3px 3px 2px #ddd;
-    -webkit-box-shadow: 3px 3px 2px #ddd;
-    box-shadow: 3px 3px 2px #ddd;
-
-    width:250px;
-}
 #navcolumn strong{
     color:#ff6800;
     font-size:13px;
@@ -122,12 +83,26 @@
 #navcolumn li a{
     font-size:13px;    
 }
-#bodyColumn{
-    margin-left:300px;
+
+dl {
+    padding: 4px 4px 4px 6px;
+    border: 1px solid #aaa;
+    background-color: #ffc;
+    border-radius: 10px;
 }
-#bodyColumn ul li{
-    margin-bottom:10px;        
+
+tt {
+    padding: 0 3px 2px;
+    font-family: Monaco,Andale Mono,Courier New,monospace;
+    font-size: .9em;
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 3px;
+    border-radius: 3px;
+    background-color: transparent;
+    color: #900;
+    padding: 1px 3px;
 }
+
 table.bodyTable {
     border-left: solid 1px #468aa6;
     border-top: solid 1px #468aa6;
@@ -157,12 +132,6 @@
 table.bodyTable tr:nth-child(even) {background: #ccdde1}
 table.bodyTable tr:nth-child(odd) {background: #FFF}
 
-/*div#contentBox > div:first-child  p:first-letter{
-    font-weight:bold;
-    font-size:40px;
-}*/
-
-
 
 /* Pre defined styles */
 
@@ -170,7 +139,7 @@
     overflow: auto;
     white-space: pre;
     border: 1px dashed #3c78b5;
-    font-size: 11px;
+    font-size: 12px;
     font-family: Courier;
     margin: 10px;
     line-height: 13px;
@@ -184,7 +153,7 @@
     overflow: auto;
     white-space: pre;
     border: 1px dashed #3c78b5;
-    font-size: 11px;
+    font-size: 12px;
     font-family: Courier;
     margin: 10px;
     line-height: 25px;
@@ -192,6 +161,7 @@
     border-bottom: 1px dashed #3c78b5;
     padding: 3px;
     border-style: solid;
+    border-radius: 5px;
 }
 
 .command {
@@ -200,13 +170,14 @@
     text-align: left;
     background-color: #f0f0f0;
     padding: 3px;
-    font-size: 11px;
+    font-size: 12px;
     font-family: Courier;
     margin: 10px;
     line-height: 13px;
+    border-radius: 5px;
 }
 .xmlConf a {
     font-size:13px;
     line-height:20px;
     font-family: Courier;
-}
\ No newline at end of file
+}
diff --git a/java/modules/documentation/src/site/site.xml b/java/modules/documentation/src/site/site.xml
index ae7ee63..a1a54b6 100644
--- a/java/modules/documentation/src/site/site.xml
+++ b/java/modules/documentation/src/site/site.xml
@@ -21,8 +21,8 @@
 <project name="Apache Synapse">
     <skin>
         <groupId>org.apache.maven.skins</groupId>
-        <artifactId>maven-default-skin</artifactId>
-        <version>1.0</version>
+        <artifactId>maven-fluido-skin</artifactId>
+        <version>1.6</version>
     </skin>
     <body>
         <menu name="Main Menu">
@@ -42,6 +42,7 @@
             <item name="Configuration Language" href="userguide/config.html"/>
             <item name="Mediators Catalog" href="userguide/mediators.html"/>
             <item name="Transports Catalog" href="userguide/transports.html"/>
+            <item name="Properties Catalog" href="userguide/properties.html"/>
             <item name="XPath functions and Variables" href="userguide/xpath.html"/>
             <item name="Extending Synapse" href="userguide/extending.html"/>
             <item name="Synapse Template Libraries" href="userguide/template_library.html"/>
diff --git a/java/modules/documentation/src/site/xdoc/dev/best-practices.xml b/java/modules/documentation/src/site/xdoc/dev/best-practices.xml
index df5fede..eb84ab1 100644
--- a/java/modules/documentation/src/site/xdoc/dev/best-practices.xml
+++ b/java/modules/documentation/src/site/xdoc/dev/best-practices.xml
@@ -57,7 +57,7 @@
                     for Synapse.
                 </li>
                 <li>
-                    The maximum number of characters in a single line should not exceed 100. Please
+                    The maximum number of characters in a single line should not exceed 120. Please
                     configure your IDE to properly enforce this restriction on all source files.
                 </li>
                 <li>
diff --git a/java/modules/documentation/src/site/xdoc/dev/developer-guide.xml b/java/modules/documentation/src/site/xdoc/dev/developer-guide.xml
index 4a66ab7..29a6b9c 100644
--- a/java/modules/documentation/src/site/xdoc/dev/developer-guide.xml
+++ b/java/modules/documentation/src/site/xdoc/dev/developer-guide.xml
@@ -36,7 +36,7 @@
             <p>
                 If you are an experienced Synapse developer or already a committer
                 for Synapse, this document might still contain useful information on setting up
-                your working copy of the source code and committing code changes. So feel free to
+                your working copy of the source code and committing code changes. So, feel free to
                 read all the way through.
             </p>
         </section>
@@ -70,7 +70,7 @@
         </section>
         <section name="Interacting with the Code Base Using Subversion" id="subversion">
             <p>
-                Synapse code base is maintained in a Subversion repository. Therefore anybody willing
+                Synapse code base is maintained in a Subversion repository. Therefore, anyone willing
                 to go through the Synapse source code in the development trunk and make contributions
                 should use a Subversion client to interact with the Synapse code base. To learn more
                 about using Subversion or to download the latest client distributions, please visit
@@ -132,13 +132,13 @@
                 <p>
                     Developers and committers making changes to the Synapse code base are highly
                     recommended to always build the source 'WITH' the tests. This will ensure that
-                    changes do not introduce any obvious regression errors. However running all the
+                    changes do not introduce any obvious regression errors. However, running all the
                     tests does not guarantee that a particular change will not introduce any
-                    regressions. Therefore care must be exercised whenever making changes to the
+                    regressions. Therefore, care must be exercised whenever making changes to the
                     existing code.
                 </p>
                 <p>
-                    Synapse source tree is organized into several modules. If required you can build
+                    Synapse source tree is organized into several modules. If required, you can build
                     only a selected module by going into the appropriate module and executing one
                     of the above build commands.
                 </p>
@@ -169,7 +169,7 @@
                     run the usual Maven build command.
                 </p>
                 <p>
-                    Synapse integration test suite uses the Maven Surefire plugin. Therefore all
+                    Synapse integration test suite uses the Maven Surefire plugin. Therefore, all
                     tests will generate a report which will be available in the
                     modules/integration/target/surefire-reports directory. If you ever encounter
                     a failure while running the integration tests, this is the first place to check.
diff --git a/java/modules/documentation/src/site/xdoc/download.xml b/java/modules/documentation/src/site/xdoc/download.xml
index 2921bf3..11d4b81 100644
--- a/java/modules/documentation/src/site/xdoc/download.xml
+++ b/java/modules/documentation/src/site/xdoc/download.xml
@@ -25,7 +25,7 @@
     <body>
         <section name="Download Latest Stable Release">
             <p>
-                The latest stable release of Apache Synapse is 2.1. It is highly recommended
+                The latest stable release of Apache Synapse is 3.0.1. It is highly recommended
                 to use the latest stable release so that you can use our newest features
                 while benefiting from all the recent bug fixes and improvements.
             </p>
@@ -35,8 +35,8 @@
                     <th>Release Date</th>
                 </tr>
                 <tr>
-                    <td><a href="download/2.1/download.cgi">2.1</a></td>
-                    <td>22-Dec-2011</td>
+                    <td><a href="download/3.0.1/download.cgi">3.0.1</a></td>
+                    <td>07-Dec-2017</td>
                 </tr>
             </table>
         </section>
@@ -47,6 +47,14 @@
                     <th>Release Date</th>
                 </tr>
                 <tr>
+                    <td><a href="download/3.0.0/download.cgi">2.1</a></td>
+                    <td>04-Jan-2017</td>
+                </tr>
+                <tr>
+                    <td><a href="download/2.1/download.cgi">2.1</a></td>
+                    <td>22-Dec-2011</td>
+                </tr>
+                <tr>
                     <td><a href="download/2.0.0/download.cgi">2.0.0</a></td>
                     <td>30-Nov-2010</td>
                 </tr>
@@ -69,4 +77,4 @@
             </table>
         </section>
     </body>
-</document>
\ No newline at end of file
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/index.xml b/java/modules/documentation/src/site/xdoc/index.xml
index 1f7bc63..2781963 100644
--- a/java/modules/documentation/src/site/xdoc/index.xml
+++ b/java/modules/documentation/src/site/xdoc/index.xml
@@ -37,9 +37,9 @@
             <p>
                 Apache Synapse is free and open source software distributed under the
                 <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License 2.0</a>.
-                The latest version of Synaspe is <a href="download/2.1/download.cgi">v2.1</a>.
-                This release comes with a horde of new features, bug fixes, performance and
-                stability improvements.
+                The latest version of Synapse is <a href="download/3.0.1/download.cgi">v3.0.1</a>.
+                It is a patch release which contains bug fixes and library upgrades to
+                3.0.0 major feature release.
             </p>
             <p>
                 Apache Synapse, Synapse, Apache, the Apache feather logo, and the Apache Synapse
@@ -47,35 +47,62 @@
                 Foundation</a>
             </p>
         </section>
-        <section name="New in Version 2.1">
+        <section name="New in Version 3.0.0">
             <ul>
                 <li>
-                    Support for creating and managing REST APIs with URL patterns and URI templates
+                    High-performing PassThrough HTTP transport support for all mediation scenarios
+                    <ul><li>Ultra-fast, low latency mediation of HTTP requests</li></ul>
+                    <ul><li>Supporting a very large number of inbound (client -> ESB)
+                        and outbound (ESB -> server) connections concurrently</li></ul>
+                    <ul><li>Intelligently handle message content and content awareness
+                        built into the engine with shared buffer for handling data</li></ul>
+                    <ul><li>Automatic throttling and graceful performance
+                        degradation in the presence of slow or faulty clients and
+                        servers</li></ul>
                 </li>
                 <li>
-                    Define sequences and endpoints as templates and reuse seamlessly across the
-                    whole configuration
+                    OCSP/CRL certificate validation support for HTTP transports
                 </li>
                 <li>
-                    Payload factory mediator for constructing custom XML payloads
+                    Respond Mediator - A Mediator for responding back to the client from anywhere in the mediation flow
                 </li>
                 <li>
-                    Recipient list endpoint
+                    Loopback Mediator - A Mediator for jumping from IN sequence to OUT sequence
                 </li>
                 <li>
-                    HTTPD like access logging capability in the NHTTP transport
+                    Header Mediator improvements
+                    <ul><li>Support for adding/removing transport headers</li></ul>
                 </li>
                 <li>
-                    Message stores and message processors for implementing complex integration
-                    patterns and advanced messaging scenarios
+                    New xpath functions
+                    <ul><li>url-encode xpath function</li></ul>
+                    <ul><li>Access system properties from get-property function</li></ul>
+                    <ul><li>base64 decode function</li></ul>
                 </li>
                 <li>
-                    Receiving sequence support in the send mediator to make service chaining
-                    easier
+                    Message Processor improvements
+                    <ul><li>Resequencing Message Processor</li></ul>
+                    <ul><li>New blocking client implementation</li></ul>
                 </li>
                 <li>
-                    Conditional router mediator for implementing complex routing scenarios with
-                    many conditions and rules
+                    Message Injector task improvements
+                    <ul><li>Support for injecting a message to Proxy services</li></ul>
+                    <ul><li>Support for injecting a message to named sequences</li></ul>
+                </li>
+                <li>
+                    Callout Mediator improvements
+                    <ul><li>Support for WS-Security</li></ul>
+                    <ul><li>Inline Endpoint support</li></ul>
+                    <ul><li>Ability to dynamically set the EPR using 'To' header</li></ul>
+                    <ul><li>NTLM support</li></ul>
+                </li>
+                <li>
+                    Script Mediator improvements
+                    <ul><li>Support for removing properties</li></ul>
+                </li>
+                <li>
+                    REST API improvements
+                    <ul><li>Transport level access restriction</li></ul>
                 </li>
             </ul>
         </section>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/deployment.xml b/java/modules/documentation/src/site/xdoc/userguide/deployment.xml
index d6fa126..511e6a6 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/deployment.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/deployment.xml
@@ -58,9 +58,9 @@
         <section name="Platform requirements" id="Platform_requirements">
 
             <p>
-                Synapse requires Java 1.5 or higher and has been tested on Java runtime environments
-                from Sun, IBM and Apple. Note that the recommended Java version is 1.6. Synapse is
-                used on various operation systems, including Linux, Mac OS X, Solaris, Windows and AIX,
+                Synapse requires Java 1.6 or higher and has been tested on Java runtime environments
+                from Sun, IBM and Apple.Synapse is used on various operation systems,
+                including Linux, Mac OS X, Solaris, Windows and AIX,
                 as well as mainframe environments. The recommended operation system for production use
                 is Linux since it offers a wider range of options to tune the TCP/IP stack. This is
                 important to optimize the performance of the NIO HTTP transport.
@@ -145,7 +145,7 @@
             <subsection name="Using the standard binary distribution" id="Using_the_standard_binary_distribution">
                 <p>
                     The easiest way to get started with a stand-alone deployment is using the standard
-                    binary distribution ZIP or tarball (see <a href="download.html">download.html</a>).
+                    binary distribution ZIP or tarball (see <a href="../download.html">download.html</a>).
                     It already contains everything that is needed to run Synapse stand-alone and you
                     only need to customize it according to your requirements:
                 </p>
@@ -322,7 +322,7 @@
                     for released versions.
                 </li>
                 <li>
-                    <a class="externalLink" href="http://hudson.zones.apache.org/hudson/job/Synapse%20-%20Trunk/org.apache.synapse$synapse-war/">http://hudson.zones.apache.org/hudson/job/Synapse%20-%20Trunk/org.apache.synapse$synapse-war/
+                    <a class="externalLink" href="https://builds.apache.org/view/All/job/Synapse%20-%20Trunk/lastBuild/org.apache.synapse$synapse-war/">https://builds.apache.org/view/All/job/Synapse%20-%20Trunk/lastBuild/org.apache.synapse$synapse-war/
                     </a>
                     for snapshot versions.
                 </li>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/extending.xml b/java/modules/documentation/src/site/xdoc/userguide/extending.xml
index 5e799bd..31087ea 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/extending.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/extending.xml
@@ -55,7 +55,7 @@
 
 						object gives access to the underlying SOAP implementation used -
 						Axis2. A typical mediator would need to manipulate the
-						MessageContext by referring to the SynapseConfiguration. However it
+						MessageContext by referring to the SynapseConfiguration. However, it
 						is strongly recommended that the SynapseConfiguration is not
 						updated by mediator instances as it is shared by all messages, and
 						may be updated by Synapse administration or configuration modules.
@@ -84,7 +84,7 @@
 
     /**
      * Set or replace the Synapse Configuration instance to be used. May be used to
-     * programatically change the configuration at runtime etc.
+     * programmatically change the configuration at runtime etc.
      *
      * @param cfg The new synapse configuration instance
      */
@@ -476,7 +476,7 @@
             </p>
             <p>
                 Synapse also comes with a built-in task implementation known as
-                the	MessageInjector.This task can be used to inject messages into
+                the	MessageInjector. This task can be used to inject messages into
                 the service bus	periodically. Refer	sample 300 to see how to use the
                 MessageInjector task.
             </p>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/faq.xml b/java/modules/documentation/src/site/xdoc/userguide/faq.xml
index 27a87c1..34960a1 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/faq.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/faq.xml
@@ -258,11 +258,24 @@
                 </li>
                 <p/>
                 <li>
+                    What is the Passthrough transport?
+                    <ul>
+                        <li>
+                            This is the default HTTP transport used by Apache Synapse. HTTP PassThrough Transport
+                            is a non-blocking HTTP transport implementation based on HTTP Core NIO and specially
+                            designed for streaming messages. It is similar to the old message relay transport,
+                            but it does not care about the content type and simply streams all received messages
+                            through. It also has a simpler and cleaner model for forwarding messages back and forth.
+                            It can be used as an alternative to the NHTTP transport.
+                        </li>
+                    </ul>
+                </li>
+                <p/>
+                <li>
                     What is the NHTTP transport?
                     <ul>
                         <li>
-                           This is the default HTTP transport used by Apache Synapse. NHTTP stands for
-                            non-blocking HTTP. NHTTP transport uses the Java Non-blocking I/O API.
+                            NHTTP stands for non-blocking HTTP. NHTTP transport uses the Java Non-blocking I/O API.
                             This allows the NHTTP transport to scale into handling hundreds of connections
                             without blocking the threads. The server worker threads used by the NHTTP
                             transport do not get blocked on I/O until the Synapse receives responses
@@ -273,7 +286,7 @@
                 </li>
                 <p/>
                 <li>
-                    What is the underlying HTTP library used by the NHTTP transport?
+                    What is the underlying HTTP library used by the NHTTP/Passthrough transport?
                     <ul>
                         <li>
                            NHTTP transport uses the Apache Http Core NIO library underneath. This
diff --git a/java/modules/documentation/src/site/xdoc/userguide/installation.xml b/java/modules/documentation/src/site/xdoc/userguide/installation.xml
index 3dd2922..244489c 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/installation.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/installation.xml
@@ -37,7 +37,7 @@
                     <a href="#Installing">Installing Synapse</a>
                     <ul>
                         <li>
-                            <a href="#InstallingLinux">Installing on Linux/Unix</a>
+			    <a href="#InstallingLinux">Installing on *nix (Linux/macOS/Solaris)</a>
                         </li>
                         <li>
                             <a href="#InstallingWin">Installing on MS Windows</a>
@@ -91,7 +91,7 @@
                         </td>
                         <td>
                             To build Apache Synapse from its source distribution, you will need
-                            Maven 2.2.0 or later.
+                            Maven 3.2.x or later.
                         </td>
                     </tr>
                     <tr>
@@ -119,10 +119,10 @@
                             Operating System
                         </td>
                         <td>
-                            Linux, Solaris, MS Windows - XP/2003/2008 (Not fully tested on Windows
-                            Vista or Windows 7). Since Apache Synapse is a Java application, it will
+                            Linux, Solaris, macOS, MS Windows - XP/2003/2008 (Not fully tested on Windows
+			    Vista/7/8/10). Since Apache Synapse is a Java application, it will
                             generally be possible to run it on other operating systems with a
-                            JDK 1.6.x runtime. Linux/Solaris is recommended for production
+                            JDK 1.6.x or higher runtime. Linux is recommended for production
                             deployments.
                         </td>
                     </tr>
@@ -137,13 +137,13 @@
             </p>
             <ol>
                 <li>
-                    Binary Distribution: Includes binary files for both Linux and
-                    MS Windows operating systems, compressed into a single a zip file. Recommended
+                    Binary Distribution: Includes binary files for Linux, macOS and
+                    MS Windows operating systems, compressed into a single zip file. Recommended
                     for normal users.
                 </li>
                 <p/>
                 <li>
-                    Source Distribution: Includes the source code for both Linux and MS Windows
+                    Source Distribution: Includes the source code for Linux, macOS and MS Windows
                     operating systems, compressed into a single zip file which can be used to build
                     the binaries. Recommended for advanced users.
                 </li>
@@ -155,7 +155,7 @@
                 The following guide will take you through the binary distribution installation
                 on different platforms.
             </p>
-            <subsection name="Installing on Linux/Unix" id="InstallingLinux">
+	    <subsection name="Installing on *nix (Linux/macOS/Solaris)" id="InstallingLinux">
                 <ol>
                     <li>
                         <a href="http://synapse.apache.org/download.html">Download</a> Apache
@@ -214,10 +214,10 @@
         <section name="Building Synapse Using the Source Distribution" id="Building">
             <p>
                 Apache Synapse build is based on <a href="http://maven.apache.org/"> Apache
-                Maven 2</a>. Hence, it is a prerequisite to have Maven (version 2.2.0 or later)
+                Maven 3</a>. Hence, it is a prerequisite to have Maven (version 3.2.0 or later)
                 installed in order to build Synapse from the source distribution. Instructions on
-                installing Maven 2 are available on the <a href="http://maven.apache.org/"> Maven
-                website</a>. Follow these steps to build Synapse after setting up Maven 2.
+                installing Maven 3 are available on the <a href="http://maven.apache.org/"> Maven
+                website</a>. Follow these steps to build Synapse after setting up Maven 3.
             </p>
             <ol>
                 <li>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/mediators.xml b/java/modules/documentation/src/site/xdoc/userguide/mediators.xml
index 98bcf8b..02473e2 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/mediators.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/mediators.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <document>
     <properties>
         <title>Apache Synapse - Mediators Catalog</title>
@@ -20,6 +40,8 @@
                         <li><a href="#Log">Log Mediator</a></li>
                         <li><a href="#Property">Property Mediator</a></li>
                         <li><a href="#Send">Send Mediator</a></li>
+                        <li><a href="#Respond">Respond Mediator</a></li>
+                        <li><a href="#Loopback">Loopback Mediator</a></li>
                     </ul>
                 </li>
                 <li>
@@ -132,7 +154,7 @@
                     log4j.properties file.
                 </p>
                 <p>
-                    By default the log mediator only logs a minimalistic set of details to avoid
+                    By default, the log mediator only logs a minimalistic set of details to avoid
                     the message content being parsed. But if needed it can be configured to log the
                     full message payload, headers and even custom user defined properties. The log
                     mediator configuration takes the following general form.
@@ -172,7 +194,7 @@
                     mediated and the outcome will be included in the generated log entry.
                 </p>
                 <p>
-                    By default all properties and attributes logged by the log mediator are separated
+                    By default, all properties and attributes logged by the log mediator are separated
                     by commas (,). This can be configured using the 'separator' attribute. Further
                     all logs generated by the mediator are logged at log4j log level 'INFO' by default.
                     This behavior can also be configured using the 'category' attribute.
@@ -214,7 +236,7 @@
                     on the message to determine the value that needs to be assigned to the property.
                 </p>
                 <p>
-                    Synapse properties are scoped. Therefore when using this mediator the user should
+                    Synapse properties are scoped. Therefore, when using this mediator the user should
                     specify the scope at which the property will be set or removed from. If not
                     specified, property mediator will work at the 'default' scope. Properties set in
                     this scope last as long as the transaction (request-response) exists. Properties
@@ -238,7 +260,7 @@
                     alter the behavior of the underlying Axis2 engine and transports framework.
                 </p>
                 <p>
-                    By default property mediator sets all property values as strings. It is possible
+                    By default, property mediator sets all property values as strings. It is possible
                     to set properties in other types by specifying the 'type' attribute. This attribute
                     can accept one of following values.
                 </p>
@@ -303,6 +325,20 @@
                     is making blocking service calls.
                 </p>
             </subsection>
+            <subsection name="Respond Mediator" id="Respond">
+                <p>
+                    The Respond Mediator stops the processing on the current message flow and sends
+                    the message back to the client as a response.
+                </p>
+                <div class="xmlConf">&lt;respond/&gt;</div>
+            </subsection>
+            <subsection name="Loopback Mediator" id="Loopback">
+                <p>
+                    The Loopback Mediator moves the message from the In flow to the Out flow.
+                    All the configuration in the In flow that appears after the Loopback mediator is skipped.
+                </p>
+                <div class="xmlConf">&lt;loopback/&gt;</div>
+            </subsection>
         </section>
         <section name="Filter Mediators" id="FilterMediators">
             <subsection name="Filter Mediator" id="Filter">
@@ -322,7 +358,7 @@
                     filter mediator will execute the enclosed child mediators.
                 </p>
                 <p>
-                    Alternatively one can use the following syntax to configure the filter mediator.
+                    Alternatively, one can use the following syntax to configure the filter mediator.
                 </p>
                 <div class="xmlConf">&lt;filter (source="xpath" regex="string") | xpath="xpath"&gt;
     &lt;then [sequence="string"]&gt;
@@ -333,7 +369,7 @@
     &lt;/else&gt;
 &lt;/filter&gt;</div>
                 <p>
-                    In this case too the filter condition is evaluated in the same manner as
+                    In this case also the filter condition is evaluated in the same manner as
                     described above. Messages for which the condition evaluates to true will be
                     mediated through the mediators enclosed by the 'then' element. Failed messages
                     will be mediated through the mediators enclosed by the 'else' element.
@@ -357,7 +393,7 @@
     mediator+
 &lt;/out&gt;</div>
                 <p>
-                    In mediator will process requests through the child mediators anf the Out
+                    In mediator will process requests through the child mediators and the Out
                     mediator will process responses through the child mediators.
                 </p>
             </subsection>
@@ -377,8 +413,8 @@
                 <p>
                     The source XPath is executed on the messages. The resulting value is then
                     tested against the regular expressions defined in each 'case' element. When
-                    a matching case is found the message will be mediated through its child
-                    mediators. If none of the cases match, the message will handed to the 'default'
+                    a matching case is found, the message will be mediated through its child
+                    mediators. If none of the cases match, the message will be handed to the 'default'
                     case (if available).
                 </p>
             </subsection>
@@ -407,16 +443,25 @@
         <section name="Transformation Mediators" id="TransformationMediators">
             <subsection name="Header Mediator" id="Header">
                 <p>
-                    Header mediator sets or removes a specified header from the current SOAP
-                    infoset. The optional 'action' attribute specifies whether the mediator should
+                    Header mediator sets or removes a specified header from the message.
+                    The optional 'scope' attribute specifies the scope of the header.
+                    Scope can be either 'soap' or 'transport'.
+                    If the scope is set to 'soap', header is treated as a soap header and if it is 'transport',
+                    header is treated as a transport header.
+                    If the scope is omitted, header is treated as a soap header or one of the below mentioned known headers.
+                    The optional 'action' attribute specifies whether the mediator should
                     set or remove the header. If omitted, it defaults to 'set' action.
                 </p>
-                <div class="xmlConf">&lt;header name="qname" (value="literal" | expression="xpath") [action="set"]/&gt;
-&lt;header name="qname" action="remove"/&gt;</div>
+                <div class="xmlConf">&lt;header [name="qname"] (value="literal" | expression="xpath") [action="set"] [scope="soap | transport"]&gt;
+        [&lt;embeddedxml/&gt;]
+&lt;/header&gt;</div>
+
+                <div class="xmlConf">&lt;header name="qname" action="remove" [scope="soap | transport"]/&gt;</div>
                 <p>
                     The value of the 'name' attribute must be one of the following aliases or
                     a valid QName with a namespace prefix. In the latter case the namespace prefix
                     must be mapped to a valid namespace URI using the standard 'xmlns' attribute.
+                    When setting an embedded xml element as a soap header, 'name' attribute is not required.
                 </p>
                 <ul>
                     <li>To</li>
@@ -482,7 +527,7 @@
                     mediator takes the value of the specified property as the input URL.
                 </p>
                 <p>
-                    Similarly the mediator by default sets the transformed URL as the 'To' header of
+                    Similarly, the mediator by default sets the transformed URL as the 'To' header of
                     the message and alternatively you can use the 'outProperty' attribute to
                     instruct the mediator to set the resulting URL as a property.
                 </p>
@@ -704,7 +749,7 @@
 &lt;/script&gt;</div>
                 <p>
                     The execution context environment of the script has access to the Synapse
-                    MessageContext predefined in a script variable named 'mc' . An example of
+                    MessageContext predefined in a script variable named 'mc'. An example of
                     an inline mediator using JavaScript/E4X which returns false if the SOAP
                     message body contains an element named 'symbol' which has a value of 'IBM'
                     would be:
@@ -726,7 +771,7 @@
                     benefit of some scripting languages is that they have very simple and
                     elegant XML manipulation capabilities, for example JavaScript E4X or Ruby
                     REXML, so this makes them well suited for use in the Synapse mediation
-                    environment. For both types of script mediator definition the
+                    environment. For both types of script mediator definition, the
                     MessageContext passed into the script has additional methods over the
                     standard Synapse MessageContext to enable working with the XML in a way
                     natural to the scripting language. For example when using JavaScript
@@ -1136,4 +1181,4 @@
             </subsection>
         </section>
     </body>
-</document>
\ No newline at end of file
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/properties.xml b/java/modules/documentation/src/site/xdoc/userguide/properties.xml
new file mode 100644
index 0000000..53eb641
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/properties.xml
@@ -0,0 +1,897 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Properties Catalog</title>
+    </properties>
+    <body>
+        <section name="Properties Catalog" id="Introduction">
+            <p>
+                Properties provide the means of accessing various types of information
+                regarding a message that passes through the ESB. Furthermore, it is also
+                possible to use properties to control the behavior of the ESB on a given message flow.
+            </p>
+        </section>
+        <section name="Content" id="Content">
+            <ul>
+                <li>
+                    <a href="#Introduction">Introduction</a>
+                </li>
+                <li>
+                    <a href="#Contents">Contents</a>
+                </li>
+                <li>
+                    <a href="#Generic_Properties">Generic Properties</a>
+                    <ul>
+                        <li>
+                            <a href="#PRESERVE_WS_ADDRESSING">PRESERVE_WS_ADDRESSING</a>
+                        </li>
+                        <li>
+                            <a href="#RESPONSE">RESPONSE</a>
+                        </li>
+                        <li>
+                            <a href="#OUT_ONLY">OUT_ONLY</a>
+                        </li>
+                        <li>
+                            <a href="#ERROR_CODE">ERROR_CODE</a>
+                        </li>
+                        <li>
+                            <a href="#ERROR_MESSAGE">ERROR_MESSAGE</a>
+                        </li>
+                        <li>
+                            <a href="#ERROR_DETAIL">ERROR_DETAIL</a>
+                        </li>
+                        <li>
+                            <a href="#ERROR_EXCEPTION">ERROR_EXCEPTION</a>
+                        </li>
+                        <li>
+                            <a href="#TRANSPORT_HEADERS">TRANSPORT_HEADERS</a>
+                        </li>
+                        <li>
+                            <a href="#messageType">messageType</a>
+                        </li>
+                        <li>
+                            <a href="#ContentType">ContentType</a>
+                        </li>
+                        <li>
+                            <a href="#preserveProcessedHeaders">preserveProcessedHeaders</a>
+                        </li>
+                        <li>
+                            <a href="#SERVER_IP">SERVER_IP</a>
+                        </li>
+
+                    </ul>
+                </li>
+                <li>
+                    <a href="#HTTP_Transport_Properties">HTTP Transport Properties</a>
+                    <ul>
+                        <li>
+                            <a href="#POST_TO_URI">POST_TO_URI</a>
+                        </li>
+                        <li>
+                            <a href="#FORCE_SC_ACCEPTED">FORCE_SC_ACCEPTED</a>
+                        </li>
+                        <li>
+                            <a href="#DISABLE_CHUNKING">DISABLE_CHUNKING</a>
+                        </li>
+                        <li>
+                            <a href="#NO_ENTITY_BODY">NO_ENTITY_BODY</a>
+                        </li>
+                        <li>
+                            <a href="#FORCE_HTTP_1.0">FORCE_HTTP_1.0</a>
+                        </li>
+                        <li>
+                            <a href="#HTTP_SC.0">HTTP_SC</a>
+                        </li>
+                        <li>
+                            <a href="#FAULTS_AS_HTTP_200">FAULTS_AS_HTTP_200</a>
+                        </li>
+                        <li>
+                            <a href="#NO_KEEPALIVE">NO_KEEPALIVE</a>
+                        </li>
+                        <li>
+                            <a href="#REST_URL_POSTFIX">REST_URL_POSTFIX</a>
+                        </li>
+                        <li>
+                            <a href="#REQUEST_HOST_HEADER">REQUEST_HOST_HEADER</a>
+                        </li>
+                        <li>
+                            <a href="#FORCE_POST_PUT_NOBODY">FORCE_POST_PUT_NOBODY</a>
+                        </li>
+                        <li>
+                            <a href="#FORCE_HTTP_CONTENT_LENGTH">FORCE_HTTP_CONTENT_LENGTH</a>
+                        </li>
+                        <li>
+                            <a href="#COPY_CONTENT_LENGTH_FROM_INCOMING">COPY_CONTENT_LENGTH_FROM_INCOMING</a>
+                        </li>
+                        <li>
+                            <a href="#COPY_CONTENT_LENGTH_FROM_INCOMING">COPY_CONTENT_LENGTH_FROM_INCOMING</a>
+                        </li>
+                    </ul>
+                </li>
+                <li>
+                    <a href="#Synapse_Message_Context_Properties">Synapse Message Context Properties</a>
+                    <ul>
+                        <li>
+                            <a href='#SYSTEM_DATE'>SYSTEM_DATE</a>
+                        </li>
+                        <li>
+                            <a href='#SYSTEM_TIME'>SYSTEM_TIME</a>
+                        </li>
+                        <li>
+                            <a href='#MESSAGE_FORMAT'>MESSAGE_FORMAT</a>
+                        </li>
+                        <li>
+                            <a href='#OperationName'>OperationName</a>
+                        </li>
+                    </ul>
+                </li>
+            </ul>
+        </section>
+        <section name="Generic Properties" id="Generic_Properties">
+           <p>Generic properties allow to configure or change the behavior of the message flow as they are processed by the ESB.</p>
+            <p/>
+            <subsection name="PRESERVE_WS_ADDRESSING" id="PRESERVE_WS_ADDRESSING">
+                <p>
+                    By default, the ESB adds a new set of WS-Addressing headers to the messages
+                    forwarded from the ESB. If this property is set to "true" on a message,
+                    the ESB will forward it without altering its existing WS-Addressing headers.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;PRESERVE_WS_ADDRESSING&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="RESPONSE" id="RESPONSE">
+                <p>
+                    Once this property is set to 'true' on a message, the ESB will
+                    start treating it as a response message. It is generally used to
+                    route a request message back to its source as the response.
+                    However, currently respond mediator perform the same functionality.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;RESPONSE&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="OUT_ONLY" id="OUT_ONLY">
+                <p>
+                    Set this property to "true" on a message to indicate that no response
+                    message is expected for it once it is forwarded from the ESB. In other
+                    words, the ESB will do an out-only invocation with such messages.
+
+                    It is very important to set this property on messages that are involved
+                    in out-only invocations to prevent the ESB from registering unnecessary
+                    callbacks for response handling and eventually running out of memory.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;OUT_ONLY&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="ERROR_CODE" id="ERROR_CODE">
+                <p>Use this property to set a custom error code on a message which can be later
+                    processed by a Synapse fault handler. If the Synapse encounters an error during
+                    mediation or routing, this property will be automatically populated.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>String</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;error-code&quot; expression=&quot;get-property(&#39;ERROR_CODE&#39;)&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="ERROR_MESSAGE" id="ERROR_MESSAGE">
+                <p>
+                    Use this property to set a custom error message on a message which can be
+                    later processed by a Synapse fault handler. If the Synapse encounters an error
+                    during mediation or routing, this property will be automatically populated.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>String</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;Cause&quot; expression=&quot;get-property(&#39;ERROR_MESSAGE&#39;)&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="ERROR_DETAIL" id="ERROR_DETAIL">
+                <p>
+                  Use this property to set the exception stacktrace in case of an error.
+                  If the ESB encounters an error during mediation or routing, this property
+                  will be automatically populated.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>String</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;Trace&quot; expression=&quot;get-property(&#39;ERROR_DETAIL&#39;)&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="ERROR_EXCEPTION" id="ERROR_EXCEPTION">
+                <p>
+                  Contains the actual exception thrown in case of a runtime error.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>String</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;error-exception&quot; expression=&quot;get-property(&#39;ERROR_EXCEPTION&#39;)&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="TRANSPORT_HEADERS" id="TRANSPORT_HEADERS">
+                <p>Contains the map of transport headers. Automatically populated.
+                    Individual values of this map can be accessed using the property
+                    mediator in the transport scope.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>java.util.Map</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>Populated with the transport headers of the incoming request.</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;TRANSPORT_HEADERS&quot; action=&quot;remove&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="messageType" id="messageType">
+                <p>Message formatter is selected based on this property.
+                    This property should have the content type, such as text/xml,
+                    application/xml, or application/json.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>Content type of incoming request.</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;messageType&quot; value=&quot;text/xml&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="ContentType" id="ContentType">
+                <p>This property will be in effect only if the messageType property is set.
+                    If the messageType is set, the value of Content-Type HTTP header of the
+                    outgoing request will be chosen based on this property. Note that this property
+                    is required to be set only if the message formatter seeks it in the
+                    message formatter implementation.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>Value of the Content-type header of the incoming request.</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;ContentType&quot; value=&quot;text/xml&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="preserveProcessedHeaders" id="preserveProcessedHeaders">
+                <p>By default, Synapse removes the SOAP headers of incoming requests that have been processed.
+                    If we set this property to 'true', Synapse preserves the SOAP headers.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>Preserving SOAP headers</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;preserveProcessedHeaders&quot; value=&quot;true&quot; scope=&quot;default&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="SERVER_IP" id="SERVER_IP">
+                <p>Server IP/Host name of hosted server
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>Set automatically by the mediation engine upon startup with IP address or
+                        hostname of the ESB host
+                    </dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;StringServerIp&quot; expression=&quot;get-property(&#39;SERVER_IP&#39;)&quot; scope=&quot;default&quot; type=&quot;STRING&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+
+        </section>
+        <section name="HTTP Transport Properties" id="HTTP_Transport_Properties">
+          <p>HTTP transport properties allow to control and configure how the HTTP transport processes the ongoing messages.
+          </p>
+            <subsection name="POST_TO_URI" id="POST_TO_URI">
+                <p>This property makes the outgoing URL of the ESB a complete URL.
+                    This is important when we talk through a Proxy Server.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;POST_TO_URI&quot; scope=&quot;axis2&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="FORCE_SC_ACCEPTED" id="FORCE_SC_ACCEPTED">
+                <p>
+                    When set to true, this property forces a 202 HTTP response to the client so that it stops waiting
+                    for a response.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;FORCE_SC_ACCEPTED&quot; scope=&quot;axis2&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="DISABLE_CHUNKING" id="DISABLE_CHUNKING">
+                <p>Disables the HTTP chunking for outgoing messaging.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;DISABLE_CHUNKING&quot; scope=&quot;axis2&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="NO_ENTITY_BODY" id="NO_ENTITY_BODY">
+                <p>This property should be removed if a user want to generate a
+                    response from the ESB to a request without an entity body, for example, GET request.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;NO_ENTITY_BODY&quot; scope=&quot;axis2&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="FORCE_HTTP_1.0" id="FORCE_HTTP_1.0">
+                <p>
+                  Force HTTP 1.0 for outgoing HTTP messages.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;FORCE_HTTP_1.0&quot; scope=&quot;axis2&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="HTTP_SC" id="HTTP_SC">
+                <p>
+                  Set the HTTP status code.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>HTTP status code number</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;HTTP_SC&quot; value=&quot;500&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="FAULTS_AS_HTTP_200" id="FAULTS_AS_HTTP_200">
+                <p>Set the HTTP status code.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;FAULTS_AS_HTTP_200&quot; value=&quot;true&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="NO_KEEPALIVE" id="NO_KEEPALIVE">
+                <p>Disables HTTP keep alive for corresponded connection flow. This Can be use in both inflow and outflow.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;NO_KEEPALIVE&quot; value=&quot;true&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="REST_URL_POSTFIX" id="REST_URL_POSTFIX">
+                <p>The value of this property will be appended to the target URL when sending messages
+                    out in a RESTful manner through an address endpoint. This is useful when you need to
+                    append a context to the target URL in case of RESTful invocations. If you are using an
+                    HTTP endpoint instead of an address endpoint, specify variables in the format of "uri.var.*"
+                    instead of using this property.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>A URL fragment starting with "/"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>In the case of GET requests through an address endpoint, this contains the query string.</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;REST_URL_POSTFIX&quot; value=&quot;/context&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="REQUEST_HOST_HEADER" id="REQUEST_HOST_HEADER">
+                <p>
+                    The value of this property will be set as the HTTP host header of outgoing request.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>ESB will set hostname of target endpoint and port as the HTTP host header</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;REQUEST_HOST_HEADER&quot; value=&quot;www.wso2.org&quot; scope=&quot;axis2&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="FORCE_HTTP_CONTENT_LENGTH" id="FORCE_HTTP_CONTENT_LENGTH">
+                <p>
+                    This property allows the content length to be sent when the ESB sends a
+                    request to a back end server. When HTTP 1.1 is used, this property disables
+                    chunking and sends the content length. When HTTP 1.0 is used, the property
+                    only sends the content length. This property should be set in scenarios where
+                    the backend server is not able to accept chunked content.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;FORCE_HTTP_CONTENT_LENGTH&quot; scope=&quot;axis2&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="COPY_CONTENT_LENGTH_FROM_INCOMING" id="COPY_CONTENT_LENGTH_FROM_INCOMING">
+                <p>
+                    This property allows the HTTP content length to be copied from an incoming message.
+                    It is only valid when the FORCE_HTTP_CONTENT_LENGTH property is used.
+                    The COPY_CONTENT_LENGTH_FROM_INCOMING avoids buffering the message in memory for calculating
+                    the content length, thus reducing the risk of performance degradation.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>"true", "false"</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>false</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>axis2</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;COPY_CONTENT_LENGTH_FROM_INCOMING&quot; scope=&quot;axis2&quot; value=&quot;true&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+        </section>
+        <section name="Synapse Message Context Properties" id="Synapse_Message_Context_Properties">
+          <p>Synapse Message Context Properties allow to retrieve the data related to synapse
+            mediation engine information for current message flow.</p>
+            <subsection name="SYSTEM_DATE" id="SYSTEM_DATE">
+                <p>
+                    Returns the current date as a String. Optionally, a date format as per the standard
+                    date format may be supplied. e.g. synapse:get-property("SYSTEM_DATE", "yyyy.MM.dd G 'at' HH:mm:ss
+                    z")
+                    or get-property('SYSTEM_DATE').
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;StringDateVal&quot; expression=&quot;get-property(&#39;SYSTEM_DATE&#39;)&quot; scope=&quot;default&quot; type=&quot;STRING&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="SYSTEM_TIME" id="SYSTEM_TIME">
+                <p>
+                    Returns the current time in milliseconds.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;StringTimeVal&quot; expression=&quot;get-property(&#39;SYSTEM_TIME&#39;)&quot; scope=&quot;default&quot; type=&quot;STRING&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="MESSAGE_FORMAT" id="MESSAGE_FORMAT">
+                <p>Returns pox, soap11, soap12 depending on the message.
+                    If a message type is unknown this returns soap12.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;StringMessageFormat&quot; expression=&quot;get-property(&#39;MESSAGE_FORMAT&#39;)&quot; scope=&quot;default&quot; type=&quot;STRING&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+            <subsection name="OperationName" id="OperationName">
+                <p>
+                    Returns the operation name corresponding to the message.
+                </p>
+                <dl>
+                    <dt>
+                        <tt>Possible Values</tt>
+                    </dt>
+                    <dd>string</dd>
+                    <dt>
+                        <tt>Default Behavior</tt>
+                    </dt>
+                    <dd>none</dd>
+                    <dt>
+                        <tt>Scope</tt>
+                    </dt>
+                    <dd>synapse</dd>
+                    <dt>
+                        <tt>Example</tt>
+                    </dt>
+                    <dd>
+                        <div class="xmlConf">&lt;property name=&quot;StringOperationName&quot; expression=&quot;get-property(&#39;OperationName&#39;)&quot; scope=&quot;default&quot; type=&quot;STRING&quot;/&gt;</div>
+                    </dd>
+                </dl>
+            </subsection>
+        </section>
+    </body>
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/quick_start.xml b/java/modules/documentation/src/site/xdoc/userguide/quick_start.xml
index 41d4619..f827a77 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/quick_start.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/quick_start.xml
@@ -27,7 +27,7 @@
             <p>
                 Welcome to Apache Synapse quick start guide. This tutorial demonstrates two
                 sample applications covering the fundamental usage scenarios of Synapse, namely
-                message mediation and service mediation. It starts from the absolute begining and
+                message mediation and service mediation. It starts from the absolute beginning and
                 walks you through a series of steps while giving a firm grasp on the Synapse
                 messaging model.
             </p>
@@ -40,7 +40,7 @@
             </p>
             <ul>
                 <li>
-                    A Java 2 SE - JDK or JRE of version 1.5.x or higher (JDK 1.6.0_21 recommended)
+                    A Java runtime - JDK or JRE of version 1.6.0_23 or higher
                 </li>
                 <li>
                     Apache Ant <a href="http://ant.apache.org">http://ant.apache.org</a>
@@ -81,25 +81,25 @@
                 'ant'. You will see an output similar to the following as the service is built
                 and deployed to the sample Axis2 server.
             </p>
-            <div class="consoleOutput">user@domain:/opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService$ ant
+            <div class="consoleOutput">user@domain:/opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService$ ant
 Buildfile: build.xml
 
 clean:
 
 init:
-[mkdir] Created dir: /opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService/temp
-[mkdir] Created dir: /opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService/temp/classes
-[mkdir] Created dir: /opt/synapse-2.0.0/samples/axis2Server/repository/services
+[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp
+[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/classes
+[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/repository/services
 
 compile-all:
-[javac] Compiling 9 source files to /opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService/temp/classes
+[javac] Compiling 9 source files to /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/classes
 
 build-service:
-[mkdir] Created dir: /opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote
-[mkdir] Created dir: /opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote/META-INF
-[copy] Copying 1 file to /opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote/META-INF
-[copy] Copying 9 files to /opt/synapse-2.0.0/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote
-[jar] Building jar: /opt/synapse-2.0.0/samples/axis2Server/repository/services/SimpleStockQuoteService.aar
+[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote
+[mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote/META-INF
+[copy] Copying 1 file to /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote/META-INF
+[copy] Copying 9 files to /opt/synapse-3.0.1/samples/axis2Server/src/SimpleStockQuoteService/temp/SimpleStockQuote
+[jar] Building jar: /opt/synapse-3.0.1/samples/axis2Server/repository/services/SimpleStockQuoteService.aar
 
 BUILD SUCCESSFUL
 Total time: 1 second</div>
@@ -144,41 +144,40 @@
                 above configuration.
             </p>
             <div class="consoleOutput">Starting Synapse/Java ...
-Using SYNAPSE_HOME:    /opt/synapse-2.0.0
-Using JAVA_HOME:       /opt/jdk1.6.0_16
-Using SYNAPSE_XML:     /opt/synapse-2.0.0/repository/conf/sample/synapse_sample_0.xml
-2010-11-26 01:33:03,651 [-] [main]  INFO SynapseServer Starting Apache Synapse...
-2010-11-26 01:33:03,683 [-] [main]  INFO SynapseControllerFactory Using Synapse home : /opt/synapse-2.0.0
-2010-11-26 01:33:03,683 [-] [main]  INFO SynapseControllerFactory Using Axis2 repository : /opt/synapse-2.0.0/repository
-2010-11-26 01:33:03,683 [-] [main]  INFO SynapseControllerFactory Using axis2.xml location : /opt/synapse-2.0.0/repository/conf/axis2.xml
-2010-11-26 01:33:03,683 [-] [main]  INFO SynapseControllerFactory Using synapse.xml location : /opt/synapse-2.0.0/repository/conf/sample/synapse_sample_0.xml
-2010-11-26 01:33:03,683 [-] [main]  INFO SynapseControllerFactory Using server name : localhost
-2010-11-26 01:33:03,698 [-] [main]  INFO SynapseControllerFactory The timeout handler will run every : 15s
-2010-11-26 01:33:03,808 [-] [main]  INFO Axis2SynapseController Initializing Synapse at : Fri Nov 26 01:33:03 IST 2010
-2010-11-26 01:33:04,536 [-] [main] ERROR SandeshaModule Could not load module policies. Using default values.
-2010-11-26 01:33:04,560 [-] [main]  INFO HttpCoreNIOSSLSender Loading Identity Keystore from : lib/identity.jks
-2010-11-26 01:33:04,576 [-] [main]  INFO HttpCoreNIOSSLSender Loading Trust Keystore from : lib/trust.jks
-2010-11-26 01:33:04,668 [-] [main]  INFO HttpCoreNIOSender HTTPS Sender starting
-2010-11-26 01:33:04,674 [-] [main]  INFO HttpCoreNIOSender HTTP Sender starting
-2010-11-26 01:33:04,675 [-] [main]  INFO JMSSender JMS Sender started
-2010-11-26 01:33:04,677 [-] [main]  INFO JMSSender JMS Transport Sender initialized...
-2010-11-26 01:33:04,681 [-] [main]  INFO VFSTransportSender VFS Sender started
-2010-11-26 01:33:04,828 [-] [main]  WARN JmxAdapter Using unsecured JMX remote access!
-2010-11-26 01:33:04,959 [-] [main]  INFO HttpCoreNIOSSLListener Loading Identity Keystore from : lib/identity.jks
-2010-11-26 01:33:04,961 [-] [main]  INFO HttpCoreNIOSSLListener Loading Trust Keystore from : lib/trust.jks
-2010-11-26 01:33:04,976 [-] [main]  INFO Axis2SynapseController Loading mediator extensions...
-2010-11-26 01:33:05,013 [-] [main]  INFO XMLConfigurationBuilder Generating the Synapse configuration model by parsing the XML configuration
-2010-11-26 01:33:05,114 [-] [main]  INFO SynapseConfigurationBuilder Loaded Synapse configuration from : /opt/synapse-2.0.0/repository/conf/sample/synapse_sample_0.xml
-2010-11-26 01:33:05,158 [-] [main]  INFO Axis2SynapseController Deploying the Synapse service...
-2010-11-26 01:33:05,175 [-] [main]  INFO Axis2SynapseController Deploying Proxy services...
-2010-11-26 01:33:05,175 [-] [main]  INFO Axis2SynapseController Deploying EventSources...
-2010-11-26 01:33:05,190 [-] [main]  INFO MailTransportListener MAILTO Listener started
-2010-11-26 01:33:05,212 [-] [main]  INFO HttpCoreNIOListener HTTPS Listener started on port : 8243
-2010-11-26 01:33:05,215 [-] [main]  INFO HttpCoreNIOListener HTTP Listener started on port : 8280
-2010-11-26 01:33:05,215 [-] [main]  INFO VFSTransportListener VFS Listener started
-2010-11-26 01:33:05,215 [-] [main]  INFO Axis2SynapseController Management using JMX available via: service:jmx:rmi:///jndi/rmi://hiranya.wso2.com:1099/synapse
-2010-11-26 01:33:05,215 [-] [main]  INFO ServerManager Server ready for processing...
-2010-11-26 01:33:05,216 [-] [main]  INFO SynapseServer Apache Synapse started successfully</div>
+Using SYNAPSE_HOME:    /opt/synapse-3.0.1
+Using JAVA_HOME:       /opt/jdk1.7.0_79
+Using SYNAPSE_XML:     /opt/synapse-3.0.1/repository/conf/sample/synapse_sample_0.xml
+2016-12-28 10:38:00,456 [-] [main]  INFO SynapseServer Starting Apache Synapse...
+2016-12-28 10:38:00,476 [-] [main]  INFO SynapseControllerFactory Using Synapse home : /opt/synapse-3.0.1
+2016-12-28 10:38:00,476 [-] [main]  INFO SynapseControllerFactory Using Axis2 repository : /opt/synapse-3.0.1/repository
+2016-12-28 10:38:00,476 [-] [main]  INFO SynapseControllerFactory Using axis2.xml location : /opt/synapse-3.0.1/repository/conf/axis2.xml
+2016-12-28 10:38:00,476 [-] [main]  INFO SynapseControllerFactory Using synapse.xml location : /opt/synapse-3.0.1/repository/conf/sample/synapse_sample_0.xml
+2016-12-28 10:38:00,476 [-] [main]  INFO SynapseControllerFactory Using server name : localhost
+2016-12-28 10:38:00,493 [-] [main]  INFO SynapseControllerFactory The timeout handler will run every : 15s
+2016-12-28 10:38:00,566 [-] [main]  INFO Axis2SynapseController Initializing Synapse at : Wed Dec 28 10:38:00 IST 2016
+2016-12-28 10:38:01,140 [-] [main]  INFO PassThroughHttpSSLSender Loading Identity Keystore from : lib/identity.jks
+2016-12-28 10:38:01,174 [-] [main]  INFO PassThroughHttpSSLSender Loading Trust Keystore from : lib/trust.jks
+2016-12-28 10:38:01,242 [-] [main]  INFO PassThroughHttpSSLSender Pass-through HTTPS sender started...
+2016-12-28 10:38:01,243 [-] [main]  INFO PassThroughHttpSender Pass-through HTTP sender started...
+2016-12-28 10:38:01,249 [-] [main]  INFO JMSSender JMS Sender started
+2016-12-28 10:38:01,250 [-] [main]  INFO JMSSender JMS Transport Sender initialized...
+2016-12-28 10:38:01,251 [-] [main]  INFO VFSTransportSender VFS Sender started
+2016-12-28 10:38:01,428 [-] [main]  INFO PassThroughHttpSSLListener Loading Identity Keystore from : lib/identity.jks
+2016-12-28 10:38:01,429 [-] [main]  INFO PassThroughHttpSSLListener Loading Trust Keystore from : lib/trust.jks
+2016-12-28 10:38:01,443 [-] [main]  INFO Axis2SynapseController Loading mediator extensions...
+2016-12-28 10:38:01,451 [-] [main]  INFO XMLConfigurationBuilder Generating the Synapse configuration model by parsing the XML configuration
+2016-12-28 10:38:01,506 [-] [main]  INFO SynapseConfigurationBuilder Loaded Synapse configuration from : /opt/synapse-3.0.1/repository/conf/sample/synapse_sample_0.xml
+2016-12-28 10:38:01,542 [-] [main]  INFO Axis2SynapseController Deploying the Synapse service...
+2016-12-28 10:38:01,563 [-] [main]  INFO Axis2SynapseController Deploying Proxy services...
+2016-12-28 10:38:01,563 [-] [main]  INFO Axis2SynapseController Deploying EventSources...
+2016-12-28 10:38:01,584 [-] [main]  INFO PassThroughHttpSSLListener Starting pass-through HTTPS listener...
+2016-12-28 10:38:01,601 [-] [main]  INFO PassThroughHttpSSLListener Pass-through HTTPS listener started on port: 8243
+2016-12-28 10:38:01,601 [-] [main]  INFO PassThroughHttpListener Starting pass-through HTTP listener...
+2016-12-28 10:38:01,603 [-] [main]  INFO PassThroughHttpListener Pass-through HTTP listener started on port: 8280
+2016-12-28 10:38:01,603 [-] [main]  INFO Axis2SynapseController Management using JMX available via: service:jmx:rmi:///jndi/rmi://localhost:1099/synapse
+2016-12-28 10:38:01,606 [-] [main]  INFO TimeoutHandler This engine will expire all callbacks after : 180 seconds, irrespective of the timeout action, after the specified or optional timeout
+2016-12-28 10:38:01,607 [-] [main]  INFO ServerManager Server ready for processing...
+2016-12-28 10:38:01,608 [-] [main]  INFO SynapseServer Apache Synapse started successfully</div>
             <p>
                 Note that by default Synapse listens for HTTP requests on port 8280.
             </p>
@@ -198,17 +197,16 @@
                 <div class="consoleOutput">Buildfile: build.xml
 
 init:
-    [mkdir] Created dir: /opt/synapse-2.0.0/samples/axis2Client/target/classes
+    [mkdir] Created dir: /opt/synapse-3.0.1/samples/axis2Client/target/classes
 
 compile:
-    [javac] Compiling 22 source files to /opt/synapse-2.0.0/samples/axis2Client/target/classes
-    [javac] Note: /opt/synapse-2.0.0/samples/axis2Client/src/samples/userguide/PWCallback.java uses or overrides a deprecated API.
+    [javac] Compiling 22 source files to /opt/synapse-3.0.1/samples/axis2Client/target/classes
+    [javac] Note: /opt/synapse-3.0.1/samples/axis2Client/src/samples/userguide/PWCallback.java uses or overrides a deprecated API.
     [javac] Note: Recompile with -Xlint:deprecation for details.
-    [javac] Note: /opt/synapse-2.0.0/samples/axis2Client/src/samples/userguide/LoadbalanceFailoverClient.java uses unchecked or unsafe operations.
+    [javac] Note: /opt/synapse-3.0.1/samples/axis2Client/src/samples/userguide/LoadbalanceFailoverClient.java uses unchecked or unsafe operations.
     [javac] Note: Recompile with -Xlint:unchecked for details.
 
 stockquote:
-     [java] 2010-11-26 01:35:16,414 [-] [main] ERROR SandeshaModule Could not load module policies. Using default values.
      [java] 2010-11-26 01:35:16,485 [-] [main]  INFO MailTransportSender MAILTO Sender started
      [java] 2010-11-26 01:35:16,496 [-] [main]  INFO JMSSender JMS Sender started
      [java] 2010-11-26 01:35:16,497 [-] [main]  INFO JMSSender JMS Transport Sender initialized...
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples.xml b/java/modules/documentation/src/site/xdoc/userguide/samples.xml
index 671c44d..d6f7371 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples.xml
@@ -50,7 +50,10 @@
                         <li><a href="samples/sample10.html">Sample 10: Introduction to dynamic endpoints with registry</a></li>
                         <li><a href="samples/sample11.html">Sample 11: A full registry based configuration, and sharing a configuration between multiple instances</a></li>
                         <li><a href="samples/sample12.html">Sample 12: One-way messaging / fire-and-forget through Synapse</a></li>
-                        <li><a href="samples/sample13.html">Sample 13: Dual channel invocation through Synapse</a></li>
+                        <li><a href="samples/sample14.html">Sample 14: Sequences and Endpoints as local registry items</a></li>
+                        <li><a href="samples/sample15.html">Sample 15: Message Copying and Content Enriching with Enrich Mediator</a></li>
+                        <li><a href="samples/sample16.html">Sample 16: Introduction to dynamic and static keys</a></li>
+                        <li><a href="samples/sample17.html">Sample 17: Introduction to the payloadFactory mediator</a></li>
                     </ul>
                 </p>
             </subsection>
@@ -66,6 +69,9 @@
                         <li><a href="samples/sample56.html">Sample 56: WSDL endpoint</a></li>
                         <li><a href="samples/sample57.html">Sample 57: Dynamic load balancing between 3 nodes</a></li>
                         <li><a href="samples/sample58.html">Sample 58: Static load balancing between 3 nodes</a></li>
+                        <li><a href="samples/sample59.html">Sample 59: Weighted Round-Robin loadbalancing between 3 endpoints</a></li>
+                        <li><a href="samples/sample61.html">Sample 61: Routing message to 3 static recipients</a></li>
+                        <li><a href="samples/sample62.html">Sample 62: Routing message to dynamic recipients</a></li>
                     </ul>
                 </p>
             </subsection>
@@ -140,6 +146,7 @@
                         <li><a href="samples/sample352.html">Sample 352: Accessing Synapse MessageContext API through scripts</a></li>
                         <li><a href="samples/sample353.html">Sample 353: Using Ruby scripts for mediation</a></li>
                         <li><a href="samples/sample354.html">Sample 354: Using In-lined Ruby scripts for mediation</a></li>
+                        <li><a href="samples/sample355.html">Sample 355: Using Python scripts for mediation</a></li>
                     </ul>
                 </p>
                 <h4>Database Mediators (Interacting with Databases)</h4>
@@ -202,6 +209,14 @@
                         <li><a href="samples/sample434.html">Sample 434: Callout Mediator - Invoke a service using an inline Endpoint</a></li>
                     </ul>
                 </p>
+                <h4>Respond Mediator</h4>
+                <p>
+                    <ul>
+                        <li><a href="samples/sample440.html">Sample 440: Respond Mediator - Echo Service with a Proxy service</a></li>
+                        <li><a href="samples/sample441.html">Sample 441: Respond Mediator - Mock Service with a Proxy service</a></li>
+
+                    </ul>
+                </p>
                 <h4>URL Rewrite Mediator</h4>
                 <p>
                     <ul>
@@ -261,6 +276,7 @@
                         <li><a href="samples/sample702.html">Sample 702: Introduction to Message Forwarding Processor</a></li>
                         <li><a href="samples/sample703.html">Sample 703: Introduction to Message Resequencing Processor</a></li>
                         <li><a href="samples/sample704.html">Sample 704: Invoke Secured Services with Scheduled Message Forwarding Processor</a></li>
+                        <li><a href="samples/sample705.html">Sample 705: Introduction to Message Forwarding Processor With Advance Parameters</a></li>
                     </ul>
                 </p>
             </subsection>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml
deleted file mode 100644
index b6725a2..0000000
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!--
-  ~  Licensed to the Apache Software Foundation (ASF) under one
-  ~  or more contributor license agreements.  See the NOTICE file
-  ~  distributed with this work for additional information
-  ~  regarding copyright ownership.  The ASF licenses this file
-  ~  to you under the Apache License, Version 2.0 (the
-  ~  "License"); you may not use this file except in compliance
-  ~  with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~  Unless required by applicable law or agreed to in writing,
-  ~  software distributed under the License is distributed on an
-  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  KIND, either express or implied.  See the License for the
-  ~  specific language governing permissions and limitations
-  ~  under the License.
-  -->
-
-<document>
-    <properties>
-        <title>Apache Synapse - Sample 13</title>
-    </properties>
-    <body>
-        <section name="Sample 13: Dual Channel Invocations Through Synapse">
-            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
-
-    &lt;sequence name="main"&gt;
-        &lt;!-- log all attributes of messages passing through --&gt;
-        &lt;log level=&quot;full&quot;/&gt;
-
-        &lt;!-- Send the message to implicit destination --&gt;
-        &lt;send/&gt;
-    &lt;sequence/&gt;
-
-&lt;/definitions&gt;</div>
-            <subsection name="Objective">
-                <p>
-                    Demonstrate the ability to perform dual channel invocations through
-                    Synapse (asynchronous notification).
-                </p>
-            </subsection>
-            <subsection name="Pre-requisites">
-                <p>
-                    <ul>
-                        <li>
-                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
-                        </li>
-                        <li>
-                            This sample makes use of the configuration used in <a href="sample0.html">sample 0</a>.
-                            So start Synapse using the configuration numbered 0 (repository/conf/sample/synapse_sample_0.xml)
-                            <div class="command">
-                                Unix/Linux: sh synapse.sh -sample 0<br/>
-                                Windows: synapse.bat -sample 0
-                            </div>
-                        </li>
-                    </ul>
-                </p>
-            </subsection>
-            <subsection name="Executing the Client">
-                <p>
-                    Execute the client as follows.
-                </p>
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-                <p>
-                    This example invokes the same 'getQuote' operation on the SimpleStockQuoteService
-                    using the custom client which uses the Axis2 ServiceClient API with useSeparateListener
-                    set to 'true', so that the response is coming through a different channel than
-                    the one which is used to send the request. Note the following log thrown out
-                    by the sample client.
-                </p>
-                <div class="consoleOutput">Response received to the callback
-Standard dual channel :: Stock price = $57.16686934968289</div>
-                <p>
-                    If you send your client request through TCPmon, you will notice that Synapse replies
-                    to the client with a HTTP 202 acknowledgment when you send the request and the
-                    communication between Synapse and the server happens on a single channel and then
-                    you get the response back from Synapse to the client callback in a different channel
-                    (which cannot be observed through TCPmon).
-                </p>
-                <p>
-                    Also you could see the wsa:Reply-To header being something like
-                    http://localhost:8200/axis2/services/anonService2 which implies that the reply
-                    is gpoing on a different channel listening on the port 8200. Please note that it
-                    is required to engage addressing when using the dual channel invocation because
-                    it requires the wsa:Reply-To header.
-                </p>                
-            </subsection>
-        </section>
-        <p><a href="../samples.html">Back to Catalog</a></p>
-    </body>
-</document>
\ No newline at end of file
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml
index 920c851..c27a54d 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml
@@ -17,7 +17,7 @@
 	</properties>
 	<body>
 		<section name="Sample 14: Sequences and Endpoints as local registry items">
-			<div class="xmlConf"><pre xml:space="preserve">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;
+			<div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;
              xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
              xsi:schemaLocation=&quot;http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd&quot;&gt;
 
@@ -44,7 +44,7 @@
         &lt;/out&gt;
     &lt;/sequence&gt;
 
-&lt;/definitions&gt;</pre></div>
+&lt;/definitions&gt;</div>
 			<subsection name="Objective">
 				<p>
 					Objective: Sequence and Endpoints as local registry entries
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml
new file mode 100644
index 0000000..7c98494
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
+	contributor license agreements. See the NOTICE file ~ distributed with this
+	work for additional information ~ regarding copyright ownership. The ASF
+	licenses this file ~ to you under the Apache License, Version 2.0 (the ~
+	"License"); you may not use this file except in compliance ~ with the License.
+	You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
+	~ ~ Unless required by applicable law or agreed to in writing, ~ software
+	distributed under the License is distributed on an ~ * "AS IS" BASIS, WITHOUT
+	WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
+	License for the ~ specific language governing permissions and limitations
+	~ under the License. -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 15</title>
+    </properties>
+    <body>
+        <section name="Sample 15: Message Copying and Content Enriching with Enrich Mediator">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuration&quot;&gt;
+    &lt;sequence name=&quot;main&quot;&gt;
+        &lt;in&gt;
+            &lt;enrich&gt;
+                &lt;source type=&quot;custom&quot;
+                        xpath=&quot;//m0:getQuote/m0:request/m0:symbol/text()&quot;
+                        xmlns:m0=&quot;http://services.samples&quot;/&gt;
+                &lt;target type=&quot;property&quot; property=&quot;ORIGINAL_REQ&quot;/&gt;
+            &lt;/enrich&gt;
+            &lt;enrich&gt;
+                &lt;source type=&quot;body&quot;/&gt;
+                &lt;target type=&quot;property&quot; property=&quot;REQUEST_PAYLOAD&quot;/&gt;
+            &lt;/enrich&gt;
+
+            &lt;enrich&gt;
+                &lt;source type=&quot;inline&quot; key=&quot;init_req&quot;/&gt;
+                &lt;target xmlns:m0=&quot;http://services.samples&quot;
+                        xpath=&quot;//m0:getQuote/m0:request/m0:symbol/text()&quot;/&gt;
+            &lt;/enrich&gt;
+
+            &lt;send&gt;
+                &lt;endpoint&gt;
+                    &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
+                &lt;/endpoint&gt;
+            &lt;/send&gt;
+            &lt;drop/&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;header xmlns:urn=&quot;http://synapse.apache.org&quot; name=&quot;urn:lastTradeTimestamp&quot; value=&quot;foo&quot;/&gt;
+            &lt;enrich&gt;
+                &lt;source type=&quot;custom&quot;
+                        xpath=&quot;//ns:getQuoteResponse/ns:return/ax21:lastTradeTimestamp&quot;
+                        xmlns:ns=&quot;http://services.samples&quot;
+                        xmlns:ax21=&quot;http://services.samples/xsd&quot;/&gt;
+                &lt;target xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+                        xmlns:urn=&quot;http://synapse.apache.org&quot;
+                        xpath=&quot;/soapenv:Envelope/soapenv:Header/urn:lastTradeTimestamp&quot;/&gt;
+            &lt;/enrich&gt;
+             &lt;log level=&quot;full&quot;/&gt;
+            &lt;log&gt;
+                &lt;property name=&quot;Original Request Symbol&quot; expression=&quot;get-property(&#39;ORIGINAL_REQ&#39;)&quot;/&gt;
+                &lt;property name=&quot;Request Payload&quot; expression=&quot;get-property(&#39;REQUEST_PAYLOAD&#39;)&quot;/&gt;
+            &lt;/log&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+
+    &lt;/sequence&gt;
+    &lt;localEntry key=&quot;init_req&quot;&gt;MSFT&lt;/localEntry&gt;
+    &lt;localEntry key=&quot;price_req&quot;&gt;
+        &lt;m0:symbol xmlns:m0=&quot;http://services.samples&quot;&gt;MSFT&lt;/m0:symbol&gt;
+    &lt;/localEntry&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Introduction to Message Copying and Content Enriching with Enrich Mediator
+                </p>
+            </subsection>
+
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start the Synapse configuration numbered 15: i.e. synapse -sample 15
+                        </li>
+                        <li>
+                            Start the Axis2 server and deploy the SimpleStockQuoteService if
+                            not already done
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuote</div>
+                <p>This sample demonstrate the various capabilities of Enrich Mediator. Inside the in-sequence we store/copy different
+                    parts of the message to properties and just before sending the message to the StockQuoteService, we modify the
+                    request value based on the local entry value-init_req. Then in the out-sequence, the enrich mediator is used
+                    to enrich a soap header based on the 'lastTradeTimestamp' value of the response.
+                </p>
+
+            </subsection>
+
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
\ No newline at end of file
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml
index d67182e..497acd2 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml
@@ -78,9 +78,6 @@
                 <p>
                     <ul>
                         <li>
-                            Setup Synapse and the sample Axis2 client for JSON  (Refer  Synapse <a href="setup/script.html#json">Samples Setup Guide</a> for details)
-                        </li>
-                        <li>
                             Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
                         </li>
                         <li>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml
new file mode 100644
index 0000000..ac3a202
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
+	contributor license agreements. See the NOTICE file ~ distributed with this
+	work for additional information ~ regarding copyright ownership. The ASF
+	licenses this file ~ to you under the Apache License, Version 2.0 (the ~
+	"License"); you may not use this file except in compliance ~ with the License.
+	You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
+	~ ~ Unless required by applicable law or agreed to in writing, ~ software
+	distributed under the License is distributed on an ~ * "AS IS" BASIS, WITHOUT
+	WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
+	License for the ~ specific language governing permissions and limitations
+	~ under the License. -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 16</title>
+    </properties>
+    <body>
+        <section name="Sample 16: Introduction to dynamic and static registry keys">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) --&gt;
+    &lt;registry provider="org.wso2.carbon.mediation.registry.ESBRegistry"&gt;
+        &lt;!-- the root property of the simple URL registry helps resolve a resource URL as root + key --&gt;
+        &lt;parameter name="root"&gt;file:repository/samples/resources/&lt;/parameter&gt;
+        &lt;!-- all resources loaded from the URL registry would be cached for this number of milli seconds --&gt;
+        &lt;parameter name="cachableDuration"&gt;15000&lt;/parameter&gt;
+    &lt;/registry&gt;
+
+    &lt;sequence name="main"&gt;
+        &lt;in&gt;
+            &lt;!-- define the request processing XSLT resource as a property value --&gt;
+            &lt;property name="symbol" value="transform/transform.xslt"/&gt;
+            &lt;!-- {} denotes that this key is a dynamic one and it is not a static key --&gt;
+            &lt;!-- use Xpath expression "get-property()" to evaluate real key from property --&gt;
+            &lt;xslt key="{get-property('symbol')}"/&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;!-- transform the standard response back into the custom format the client expects --&gt;
+            &lt;!-- the key is looked up in the remote registry using a static key --&gt;
+            &lt;xslt key="transform/transform_back.xslt"/&gt;
+        &lt;/out&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Introduction to dynamic and static keys
+                </p>
+            </subsection>
+
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start the Synapse configuration numbered 16: i.e. synapse -sample 16
+                        </li>
+                        <li>
+                            Start the Axis2 server and deploy the SimpleStockQuoteService if
+                            not already done
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuote</div>
+                <p>This Sample demonstrates the use of dynamic keys with mediators. XSLT mediator is used as an
+                    example for that and deference between static and dynamic usage of keys are shown with that.
+                </p>
+                <p>The first registry resource "transform/transform.xslt" is set as a property value. Inside the
+                    XSLT mediator the local property value is lookup using the Xpath expression "get-property()".
+                    Likewise any Xpath expression can be enclosed inside "{ }" to denote that it is a dynamic key.
+                    Then the mediator will evaluate the real value for that expression.
+                </p>
+                <p>The second XSLT resource "transform/transform_back.xslt" is used simply as a static key as
+                    usual. It is not included inside "{ }" and because of the mediator directly use the static
+                    value as the key.
+                </p>
+                <p>Execute the custom quote client as 'ant stockquote -Dmode=customquote' and analys the output
+                    which is similar to the Sample 8.
+                </p>
+
+            </subsection>
+
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
\ No newline at end of file
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml
new file mode 100644
index 0000000..df61130
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
+	contributor license agreements. See the NOTICE file ~ distributed with this
+	work for additional information ~ regarding copyright ownership. The ASF
+	licenses this file ~ to you under the Apache License, Version 2.0 (the ~
+	"License"); you may not use this file except in compliance ~ with the License.
+	You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
+	~ ~ Unless required by applicable law or agreed to in writing, ~ software
+	distributed under the License is distributed on an ~ * "AS IS" BASIS, WITHOUT
+	WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
+	License for the ~ specific language governing permissions and limitations
+	~ under the License. -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 17</title>
+    </properties>
+    <body>
+        <section name="Sample 17: Introduction to the payloadFactory mediator">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+&lt;sequence name=&quot;main&quot;&gt;
+    &lt;in&gt;
+        &lt;!-- using payloadFactory mediator to transform the request message --&gt;
+        &lt;payloadFactory media-type=&quot;xml&quot;&gt;
+            &lt;format&gt;
+                &lt;m:getQuote xmlns:m=&quot;http://services.samples&quot;&gt;
+                &lt;m:request&gt;
+                &lt;m:symbol&gt;$1&lt;/m:symbol&gt;
+                &lt;/m:request&gt;
+                &lt;/m:getQuote&gt;
+            &lt;/format&gt;
+            &lt;args&gt;
+                &lt;arg xmlns:m0=&quot;http://services.samples&quot; expression=&quot;//m0:Code&quot;/&gt;&lt;/args&gt;
+            &lt;/payloadFactory&gt;
+    &lt;/in&gt;
+    &lt;out&gt;
+        &lt;!-- using payloadFactory mediator to transform the response message --&gt;
+        &lt;payloadFactory media-type=&quot;xml&quot;&gt;
+            &lt;format&gt;
+                &lt;m:CheckPriceResponse xmlns:m=&quot;http://services.samples/xsd&quot;&gt;
+                &lt;m:Code&gt;$1&lt;/m:Code&gt;
+                &lt;m:Price&gt;$2&lt;/m:Price&gt;
+                &lt;/m:CheckPriceResponse&gt;
+            &lt;/format&gt;
+            &lt;args&gt;
+                &lt;arg xmlns:m0=&quot;http://services.samples/xsd&quot; expression=&quot;//m0:symbol&quot;/&gt;
+                &lt;arg xmlns:m0=&quot;http://services.samples/xsd&quot; expression=&quot;//m0:last&quot;/&gt;
+            &lt;/args&gt;
+        &lt;/payloadFactory&gt;
+    &lt;/out&gt;
+    &lt;send/&gt;
+    &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Introduction to the payloadFactory mediator
+                </p>
+            </subsection>
+
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start the Synapse configuration numbered 17: i.e. synapse -sample 17
+                        </li>
+                        <li>
+                            Start the Axis2 server and deploy the SimpleStockQuoteService if
+                            not already done
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=customquote
+                </div>
+                <p>This Sample demonstrates how the PayloadFactory Mediator can be used to perform transformations
+                    as an alternative to the XSLT mediator, which is demonstrated in Sample 8: Introduction to
+                    Static and Dynamic Registry Resources and Using XSLT Transformations
+                </p>
+
+            </subsection>
+
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml
index 4ea1e44..fa754cd 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml
@@ -52,12 +52,12 @@
         &lt;/target&gt;
         &lt;publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
 
-        &lt;parameter name="transport.mail.Address"&gt;synapse.demo.1@gmail.com&lt;/parameter&gt;
+        &lt;parameter name="transport.mail.Address"&gt;synapse.demo.mail1@gmail.com&lt;/parameter&gt;
         &lt;parameter name="transport.mail.Protocol"&gt;pop3&lt;/parameter&gt;
         &lt;parameter name="transport.PollInterval"&gt;5&lt;/parameter&gt;
         &lt;parameter name="mail.pop3.host"&gt;pop.gmail.com&lt;/parameter&gt;
         &lt;parameter name="mail.pop3.port"&gt;995&lt;/parameter&gt;
-        &lt;parameter name="mail.pop3.user"&gt;synapse.demo.1&lt;/parameter&gt;
+        &lt;parameter name="mail.pop3.user"&gt;synapse.demo.mail1&lt;/parameter&gt;
         &lt;parameter name="mail.pop3.password"&gt;mailpassword&lt;/parameter&gt;
         &lt;parameter name="mail.pop3.socketFactory.class"&gt;javax.net.ssl.SSLSocketFactory&lt;/parameter&gt;
         &lt;parameter name="mail.pop3.socketFactory.fallback"&gt;false&lt;/parameter&gt;
@@ -100,7 +100,7 @@
             </subsection>
             <subsection name="Executing the Client">
                 <p>
-                    Send an e-mail to <a href="mailto:synapse.demo.1@gmail.com">synapse.demo.1@gmail.com</a>
+                    Send an e-mail to <a href="mailto:synapse.demo.mail1@gmail.com">synapse.demo.mail1@gmail.com</a>
                     with the following payload.
                 </p>
                 <div class="xmlConf">&lt;getQuote xmlns=&quot;http://services.samples&quot;&gt;
@@ -130,4 +130,4 @@
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        
     </body>
-</document>
\ No newline at end of file
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample355.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample355.xml
new file mode 100644
index 0000000..1d14061
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample355.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 355</title>
+    </properties>
+    <body>
+        <section name="Sample 355: Using Python Scripts for Mediation">
+            <div class="xmlConf">
+                &lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+
+                    &lt;registry provider=&quot;org.apache.synapse.registry.url.SimpleURLRegistry&quot;&gt;
+                        &lt;!-- the root property of the simple URL registry helps resolve a resource URL as root + key --&gt;
+                        &lt;parameter name=&quot;root&quot;&gt;file:repository/conf/sample/resources/&lt;/parameter&gt;
+                        &lt;!-- all resources loaded from the URL registry would be cached for this number of milli seconds --&gt;
+                        &lt;parameter name=&quot;cachableDuration&quot;&gt;15000&lt;/parameter&gt;
+                    &lt;/registry&gt;
+
+                    &lt;localEntry key=&quot;stockquoteScript&quot;
+                                src=&quot;file:repository/conf/sample/resources/script/stockquoteTransformRequest.py&quot;/&gt;
+
+                    &lt;sequence name=&quot;main&quot;&gt;
+                        &lt;in&gt;
+                            &lt;!-- transform the custom quote request into a standard quote request expected by the service --&gt;
+                            &lt;script language=&quot;py&quot; key=&quot;stockquoteScript&quot; function=&quot;transformRequest&quot;/&gt;
+                            &lt;send&gt;
+                                &lt;endpoint&gt;
+                                    &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
+                                &lt;/endpoint&gt;
+                            &lt;/send&gt;
+                        &lt;/in&gt;
+                        &lt;out&gt;
+                            &lt;!-- transform the standard response back into the custom format the client expects --&gt;
+                            &lt;script language=&quot;py&quot; key=&quot;script/stockquoteTransformResponse.py&quot;
+                                    function=&quot;transformResponse&quot;/&gt;
+                            &lt;send/&gt;
+                        &lt;/out&gt;
+                    &lt;/sequence&gt;
+
+                &lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Shows how to embed Python scripts in the Synapse configuration itself.
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                     	<li>
+                            This sample uses Jython, so first setup support for this in Synapse as described at
+							<a href="setup/script.html#python">Configuring Jython</a>
+                        </li>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Synapse does not ship with a Jython engine by default. Therefore you should
+                            download the Jython engine from Jython site and copy the downloaded jar file
+                            to the 'lib' directory of Synapse.
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 355 (repository/conf/sample/synapse_sample_355.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 355<br/>
+                                Windows: synapse.bat -sample 355
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Run the sample client as follows.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=customquote</div>
+                <p>
+                    The Python scripts will transform the requests and responses.
+                </p>                
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample430.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample430.xml
index a75ad12..abfde32 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample430.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample430.xml
@@ -36,10 +36,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/&gt;
         &lt;/callout&gt;
-        &lt;property name="RESPONSE" value="true"/&gt;
-        &lt;header name="To" action="remove"/&gt;
-        &lt;send/&gt;
-        &lt;drop/&gt;
+        &lt;respond/&gt;
     &lt;/sequence&gt;
 
 &lt;/definitions&gt;</div>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample431.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample431.xml
index 2ad544d..e428ad2 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample431.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample431.xml
@@ -39,10 +39,7 @@
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/&gt;
             &lt;enableSec policy="sec_policy"/&gt;
         &lt;/callout&gt;
-        &lt;property name="RESPONSE" value="true"/&gt;
-        &lt;header name="To" action="remove"/&gt;
-        &lt;send/&gt;
-        &lt;drop/&gt;
+        &lt;respond/&gt;
     &lt;/sequence&gt;
 
 &lt;/definitions&gt;</div>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample432.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample432.xml
index b2efc45..cb07ebb 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample432.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample432.xml
@@ -40,10 +40,7 @@
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/&gt;
             &lt;enableSec outboundPolicy="sec_policy_outbound" inboundPolicy="sec_policy_inbound"/&gt;
         &lt;/callout&gt;
-        &lt;property name="RESPONSE" value="true"/&gt;
-        &lt;header name="To" action="remove"/&gt;
-        &lt;send/&gt;
-        &lt;drop/&gt;
+        &lt;respond/&gt;
     &lt;/sequence&gt;
 
 &lt;/definitions&gt;</div>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample433.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample433.xml
index b17d4b7..1abb3e5 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample433.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample433.xml
@@ -36,10 +36,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/&gt;
         &lt;/callout&gt;
-        &lt;property name="RESPONSE" value="true"/&gt;
-        &lt;header name="To" action="remove"/&gt;
-        &lt;send/&gt;
-        &lt;drop/&gt;
+        &lt;respond/&gt;
     &lt;/sequence&gt;
 
     &lt;endpoint name="StockQuoteServiceEndpoint"&gt;
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample434.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample434.xml
index 1d36122..be71db4 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample434.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample434.xml
@@ -38,10 +38,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/&gt;
         &lt;/callout&gt;
-        &lt;property name="RESPONSE" value="true"/&gt;
-        &lt;header name="To" action="remove"/&gt;
-        &lt;send/&gt;
-        &lt;drop/&gt;
+        &lt;respond/&gt;
     &lt;/sequence&gt;
 
 &lt;/definitions&gt;</div>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml
new file mode 100644
index 0000000..a76e689
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 440</title>
+    </properties>
+    <body>
+        <section name="Sample 440: Respond Mediator - Echo Service with a Proxy Service">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+        &lt;proxy name=&quot;EchoService&quot;&gt;
+            &lt;target&gt;
+                &lt;inSequence&gt;
+                    &lt;respond/&gt;
+                &lt;/inSequence&gt;
+            &lt;/target&gt;
+        &lt;/proxy&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate how to use respond mediator to create a simple echo service
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start Synapse using the configuration numbered 440 (repository/conf/sample/synapse_sample_440.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 440<br/>
+                                Windows: synapse.bat -sample 440
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the EchoService proxy service with a payload.
+                    Following is how we can use curl as the client.
+                </p>
+                <div class="command">curl -v -X POST -H "Content-type: application/xml" -d '&lt;test&gt;foo&lt;/test&gt;' 'http://localhost:8280/services/EchoService'</div>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>
+    </body>
+</document>
\ No newline at end of file
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml
new file mode 100644
index 0000000..e0bdd0f
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 441</title>
+    </properties>
+    <body>
+        <section name="Sample 441: Respond Mediator - Mock a service with a proxy service">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+                &lt;proxy name=&quot;MockService&quot;&gt;
+                    &lt;target&gt;
+                        &lt;inSequence&gt;
+                            &lt;log level=&quot;full&quot;/&gt;
+                            &lt;payloadFactory&gt;
+                                &lt;format&gt;
+                                    &lt;m:Sample xmlns:m=&quot;http://services.samples&quot;&gt;
+                                        &lt;m:Response&gt;
+                                            &lt;m:value&gt;foo&lt;/m:value&gt;
+                                        &lt;/m:Response&gt;
+                                    &lt;/m:Sample&gt;
+                                &lt;/format&gt;
+                                &lt;args/&gt;
+                            &lt;/payloadFactory&gt;
+                            &lt;respond/&gt;
+                        &lt;/inSequence&gt;
+                    &lt;/target&gt;
+                &lt;/proxy&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate how to create a simple mock service with a proxy service using the respond mediator.
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start Synapse using the configuration number 441
+                            (repository/conf/sample/synapse_sample_441.ml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 441
+                                <br/>
+                                Windows: synapse.bat -sample 441
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the MockService proxy service with a payload.
+                    Following is how we can use curl as the client
+                </p>
+                <div class="command">curl -v -X POST -H "Content-type: application/xml" -d '&lt;request&gt;foo&lt;/request&gt;'
+                    'http://localhost:8280/services/MockService'
+                </div>
+            </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
\ No newline at end of file
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample470.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample470.xml
index b9bd729..3293474 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample470.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample470.xml
@@ -59,9 +59,7 @@
                 &lt;bean action=&quot;GET_PROPERTY&quot; var=&quot;store&quot; property=&quot;address&quot; target=&quot;{//store/address/text()}&quot;/&gt;
                 &lt;bean action=&quot;GET_PROPERTY&quot; var=&quot;store&quot; property=&quot;phoneNo&quot; target=&quot;{//store/phone/text()}&quot;/&gt;
                 &lt;!-- Send the response back to the client of the ESB. --&gt;
-                &lt;header name=&quot;To&quot; action=&quot;remove&quot;/&gt;
-                &lt;property name=&quot;RESPONSE&quot; value=&quot;true&quot;/&gt;
-                &lt;send/&gt;
+                &lt;respond/&gt;
             &lt;/inSequence&gt;
         &lt;/target&gt;
     &lt;/proxy&gt;
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample471.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample471.xml
index 8b83a16..f409b4e 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample471.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample471.xml
@@ -66,9 +66,7 @@
                         &lt;arg expression=&quot;get-property(&apos;TOTAL&apos;)&quot;/&gt;
                     &lt;/args&gt;
                 &lt;/payloadFactory&gt;
-                &lt;property name=&quot;RESPONSE&quot; value=&quot;true&quot;/&gt;
-                &lt;header name=&quot;To&quot; action=&quot;remove&quot;/&gt;
-                &lt;send/&gt;
+                &lt;respond/&gt;
             &lt;/onComplete&gt;
         &lt;/aggregate&gt;
     &lt;/sequence&gt;
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml
index f415dcc..0f65159 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml
@@ -124,7 +124,7 @@
 [java] Request: 130 ==&gt; Response from server: MyServer2
 ...</div>
                 <p>
-                    You can keep on shutting servers down like this. Client will get a response untill
+                    You can keep on shutting servers down like this. Client will get a response until
                     you shutdown all listed servers. Once all servers are shutdown, the error sequence
                     is triggered and a fault message is sent to the client as follows.
                 </p>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml
new file mode 100644
index 0000000..bcd78d1
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 59</title>
+    </properties>
+    <body>
+        <section name="Sample 59: Weighted Round-Robin loadbalancing between 3 endpoints">
+            <div class="xmlConf">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+    &lt;sequence name="main" onError="errorHandler"&gt;
+        &lt;in&gt;
+            &lt;send&gt;
+                &lt;endpoint&gt;
+                    &lt;loadbalance
+                            algorithm="org.apache.synapse.endpoints.algorithms.WeightedRoundRobin"&gt;
+                        &lt;endpoint&gt;
+                            &lt;address uri="http://localhost:9001/services/LBService1"&gt;
+                                &lt;enableAddressing/&gt;
+                                &lt;suspendOnFailure&gt;
+                                    &lt;initialDuration&gt;20000&lt;/initialDuration&gt;
+                                    &lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                                &lt;/suspendOnFailure&gt;
+                            &lt;/address&gt;
+                            &lt;property name="loadbalance.weight" value="1"/&gt;
+                        &lt;/endpoint&gt;
+                        &lt;endpoint&gt;
+                            &lt;address uri="http://localhost:9002/services/LBService1"&gt;
+                                &lt;enableAddressing/&gt;
+                                &lt;suspendOnFailure&gt;
+                                    &lt;initialDuration&gt;20000&lt;/initialDuration&gt;
+                                    &lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                                &lt;/suspendOnFailure&gt;
+                            &lt;/address&gt;
+                            &lt;property name="loadbalance.weight" value="2"/&gt;
+                        &lt;/endpoint&gt;
+                        &lt;endpoint&gt;
+                            &lt;address uri="http://localhost:9003/services/LBService1"&gt;
+                                &lt;enableAddressing/&gt;
+                                &lt;suspendOnFailure&gt;
+                                    &lt;initialDuration&gt;20000&lt;/initialDuration&gt;
+                                    &lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                                &lt;/suspendOnFailure&gt;
+                            &lt;/address&gt;
+                            &lt;property name="loadbalance.weight" value="3"/&gt;
+                        &lt;/endpoint&gt;
+                    &lt;/loadbalance&gt;
+                &lt;/endpoint&gt;
+            &lt;/send&gt;
+            &lt;drop/&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+    &lt;sequence name="errorHandler"&gt;
+        &lt;makefault response="true"&gt;
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/&gt;
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/&gt;
+        &lt;/makefault&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Demonstrate the weighted load balancing among a set of
+endpoints
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                    <li>Start ESB with sample configuration 59. (i.e. wso2esb-samples -sn 59) </li>
+
+                    <li>Deploy the LoadbalanceFailoverService and start three instances of sample Axis2 server as mentioned in sample 52.</li>
+
+                    <li>Above configuration sends messages with the weighted loadbalance behaviour. Weight of each leaf
+                        address endpoint is defined by integer value of "loadbalance.weight" property associated with each endpoint.
+                        If weight of a endpoint is x, x number of requests will send to that endpoint before switch to next active endpoint.
+                        <br/>To test this, run the loadbalancefailover client to send 100 requests as follows: </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the sample client as follows
+                </p>
+                <div class="command">ant loadbalancefailover -Di=100</div>
+                <p>This client sends 100 requests to the LoadbalanceFailoverService through
+                    ESB. ESB will distribute the load among the three endpoints mentioned in the
+                    configuration in weighted round-robin manner. LoadbalanceFailoverService appends the
+                    name of the server to the response, so that client can determine which server
+                    has processed the message. If you examine the console output of the client,
+                    you can see that requests are processed by three servers as follows: </p>
+                <div class="consoleOutput">[java] Request: 1 ==&gt; Response from server: MyServer1
+                    [java] Request: 2 ==&gt; Response from server: MyServer2
+                    [java] Request: 3 ==&gt; Response from server: MyServer2
+                    [java] Request: 4 ==&gt; Response from server: MyServer3
+                    [java] Request: 5 ==&gt; Response from server: MyServer3
+                    [java] Request: 6 ==&gt; Response from server: MyServer3
+                    [java] Request: 7 ==&gt; Response from server: MyServer1
+                    [java] Request: 8 ==&gt; Response from server: MyServer2
+                    [java] Request: 9 ==&gt; Response from server: MyServer2
+                    [java] Request: 10 ==&gt; Response from server: MyServer3
+                    [java] Request: 11 ==&gt; Response from server: MyServer3
+                    [java] Request: 12 ==&gt; Response from server: MyServer3
+                    ...
+                </div>
+                <p>As logs, endpoint with weight 1 received a 1 request and endpoint with weight 2 received 2
+                    requests and etc... in a cycle</p>
+             </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml
new file mode 100644
index 0000000..907efb3
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 61</title>
+    </properties>
+    <body>
+        <section name="Sample 61: Routing message to 3 static recipients">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+   &lt;sequence name=&quot;errorHandler&quot;&gt;
+      &lt;makefault response=&quot;true&quot;&gt;
+         &lt;code xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot; value=&quot;tns:Receiver&quot; /&gt;
+         &lt;reason value=&quot;COULDN&#39;T SEND THE MESSAGE TO THE SERVER.&quot; /&gt;
+      &lt;/makefault&gt;
+      &lt;send /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;fault&quot;&gt;
+      &lt;log level=&quot;full&quot;&gt;
+         &lt;property name=&quot;MESSAGE&quot; value=&quot;Executing default &amp;quot;fault&amp;quot; sequence&quot; /&gt;
+         &lt;property name=&quot;ERROR_CODE&quot; expression=&quot;get-property(&#39;ERROR_CODE&#39;)&quot; /&gt;
+         &lt;property name=&quot;ERROR_MESSAGE&quot; expression=&quot;get-property(&#39;ERROR_MESSAGE&#39;)&quot; /&gt;
+      &lt;/log&gt;
+      &lt;drop /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
+      &lt;in&gt;
+         &lt;property name=&quot;EP_LIST&quot; value=&quot;http://localhost:9001/services/SimpleStockQuoteService,http://localhost:9002/services/SimpleStockQuoteService,http://localhost:9003/services/SimpleStockQuoteService&quot;/&gt;	
+         &lt;property name=&quot;OUT_ONLY&quot; value=&quot;true&quot; /&gt;
+         &lt;property name=&quot;FORCE_SC_ACCEPTED&quot; value=&quot;true&quot; scope=&quot;axis2&quot; /&gt;
+         &lt;send&gt;
+            &lt;endpoint&gt;
+               &lt;recipientlist&gt;
+                  &lt;endpoints value=&quot;{get-property(&#39;EP_LIST&#39;)}&quot; max-cache=&quot;20&quot; /&gt;
+               &lt;/recipientlist&gt;
+            &lt;/endpoint&gt;
+         &lt;/send&gt;
+         &lt;drop/&gt;
+      &lt;/in&gt;
+   &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Routing message to 3 static recipients
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>Start ESB with sample configuration 61. (i.e. wso2esb-samples -sn 61) </li>
+
+                        <li>Start three instances of the sample Axis2 server on HTTP ports 9001, 9002 and 9003 and give unique names to each server. For instructions on starting the Axis2 server, see  Starting the Axis2 server </li>
+
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the sample client as follows
+                </p>
+                <div class="command">ant stockquote -Dmode=placeorder -Dtrpurl=http://localhost:8280/</div>
+                
+            </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml
new file mode 100644
index 0000000..f23d0a5
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 62</title>
+    </properties>
+    <body>
+        <section name="Sample 62: Routing message to dynamic recipients">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+   &lt;sequence name=&quot;errorHandler&quot;&gt;
+      &lt;makefault response=&quot;true&quot;&gt;
+         &lt;code xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot; value=&quot;tns:Receiver&quot; /&gt;
+         &lt;reason value=&quot;COULDN&#39;T SEND THE MESSAGE TO THE SERVER.&quot; /&gt;
+      &lt;/makefault&gt;
+      &lt;send /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;fault&quot;&gt;
+      &lt;log level=&quot;full&quot;&gt;
+         &lt;property name=&quot;MESSAGE&quot; value=&quot;Executing default &amp;quot;fault&amp;quot; sequence&quot; /&gt;
+         &lt;property name=&quot;ERROR_CODE&quot; expression=&quot;get-property(&#39;ERROR_CODE&#39;)&quot; /&gt;
+         &lt;property name=&quot;ERROR_MESSAGE&quot; expression=&quot;get-property(&#39;ERROR_MESSAGE&#39;)&quot; /&gt;
+      &lt;/log&gt;
+      &lt;drop /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
+      &lt;in&gt;
+         &lt;property name=&quot;EP_LIST&quot; value=&quot;http://localhost:9001/services/SimpleStockQuoteService,http://localhost:9002/services/SimpleStockQuoteService,http://localhost:9003/services/SimpleStockQuoteService&quot;/&gt;	
+         &lt;send&gt;
+            &lt;endpoint&gt;
+               &lt;recipientlist&gt;
+                  &lt;endpoints value=&quot;{get-property(&#39;EP_LIST&#39;)}&quot; max-cache=&quot;20&quot; /&gt;
+               &lt;/recipientlist&gt;
+            &lt;/endpoint&gt;
+         &lt;/send&gt;
+         &lt;drop/&gt;
+      &lt;/in&gt;
+      &lt;out&gt;
+        &lt;!--Aggregate responses--&gt;
+        &lt;aggregate&gt;
+           &lt;onComplete xmlns:m0=&quot;http://services.samples&quot;
+                          expression=&quot;//m0:getQuoteResponse&quot;&gt;
+             &lt;log level=&quot;full&quot;/&gt;
+             &lt;send/&gt;
+           &lt;/onComplete&gt;
+        &lt;/aggregate&gt;
+      &lt;/out&gt;
+   &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Routing message to dynamic recipients
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>Start ESB with sample configuration 62. (i.e. wso2esb-samples -sn 62) </li>
+
+                        <li>Start three instances of the sample Axis2 server on HTTP ports 9001, 9002 and 9003 and give unique names to each server. For instructions on starting the Axis2 server, see  Starting the Axis2 server </li>
+
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the sample client as follows
+                </p>
+                <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/</div>
+                
+            </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample705.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample705.xml
new file mode 100644
index 0000000..8df6daf
--- /dev/null
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample705.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 705</title>
+    </properties>
+    <body>
+        <section name="Sample 705: Introduction to Message Forwarding Processor With Advance Parameters">
+            <div class="xmlConf">&lt;!-- Introduction to Message Forwarding Processor With max deliver attempt and drop
+                the message after max deliver attempt--&gt;
+                &lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+                &lt;endpoint name="StockQuoteServiceEp"&gt;
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"&gt;
+                &lt;suspendOnFailure&gt;
+                &lt;errorCodes&gt;-1&lt;/errorCodes&gt;
+                &lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                &lt;/suspendOnFailure&gt;
+                &lt;/address&gt;
+                &lt;/endpoint&gt;
+                &lt;sequence name="fault"&gt;
+                &lt;log level="full"&gt;
+                &lt;property name="MESSAGE" value="Executing default 'fault' sequence"/&gt;
+                &lt;property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/&gt;
+                &lt;property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/&gt;
+                &lt;/log&gt;
+                &lt;drop/&gt;
+                &lt;/sequence&gt;
+                &lt;sequence name="main"&gt;
+                &lt;in&gt;
+                &lt;log level="full"/&gt;
+                &lt;property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/&gt;
+                &lt;property name="OUT_ONLY" value="true"/&gt;
+                &lt;property name="target.endpoint" value="StockQuoteServiceEp"/&gt;
+                &lt;store messageStore="MyStore"/&gt;
+                &lt;/in&gt;
+                &lt;description&gt;The main sequence for the message mediation&lt;/description&gt;
+                &lt;/sequence&gt;
+                &lt;messageStore name="MyStore"/&gt;
+                &lt;messageProcessor
+                class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor"
+                name="ScheduledProcessor" messageStore="MyStore"&gt;
+                &lt;parameter name="interval"&gt;10000&lt;/parameter&gt;
+                &lt;parameter name="max.deliver.attempts"&gt;3&lt;/parameter&gt;
+                &lt;parameter name="max.deliver.drop"&gt;true&lt;/parameter&gt;
+                &lt;/messageProcessor&gt;
+                &lt;/definitions&gt;
+            </div>
+            <subsection name="Objective">
+                <p>
+                    Introduction to Synapse Scheduled Message Forwarding Processor with advance parameters (max deliver
+                    attempt and drop the message after max deliver attempt)
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start Synapse using the configuration numbered 705 (repository/conf/sample/synapse_sample_705.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 705<br/>
+                                Windows: synapse.bat -sample 705
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the sample client a few times with the following command.
+                </p>
+                <div class="command">
+                    ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder
+                </div>
+
+                <p>
+                    When you start to send request to synapse from client, you will see message forwarding processor without
+                    getting deactivate it keep on processing. This is due to the message will be dropped from the message store after
+                    the maximum number of delivery attempts are made, and the message processor will remain activated.
+
+                    "max.deliver.drop" parameter would have no effect when no value is specified for the Maximum Delivery Attempts parameter.
+                    If this parameter is disabled, the undeliverable message will not be dropped and the message processor will be deactivated.
+                </p>
+            </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/sample850.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/sample850.xml
index e217251..36336d3 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/sample850.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/sample850.xml
@@ -34,10 +34,7 @@
         &lt;with-param xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" name="source_xpath" value="{{s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]}}"/&gt;
         &lt;with-param xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" name="target_xpath" value="{{s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]}}"/&gt;
     &lt;/call-template&gt;
-     &lt;property name="RESPONSE" value="true"/&gt;
-        &lt;header name="To" action="remove"/&gt;
-        &lt;send/&gt;
-        &lt;drop/&gt;
+     &lt;respond/&gt;
 &lt;/sequence&gt;
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/index.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/index.xml
index a0e6c93..fa80a2b 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/index.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/index.xml
@@ -49,7 +49,8 @@
                 Please make sure you have them properly installed and configured in your system.
             </p>
             <ul>
-                <li>Java Development Kit version 1.5 or higher (1.6 recommended)</li>
+                <li>A Java runtime - JDK or JRE of version 1.6.0_23 or higher
+                    </li>
                 <li><a href="http://ant.apache.org">Apache Ant</a> version 1.6.5 or higher</li>
                 <li>
                     A command line interface such as 'Command Prompt' on Windows and the Bash shell
@@ -383,6 +384,7 @@
                 <li><a href="tcp_udp.html">TCP/UDP Setup Guide</a></li>
                 <li><a href="db.html">Database Setup Guide</a></li>
                 <li><a href="script.html">Script Setup Guide</a></li>
+                <li><a href="script.html#json-syn3">JSON Setup Guide</a></li>
                 <li><a href="mail.html">E-Mail Setup Guide</a></li>
             </ul>
         </section>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/jms.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/jms.xml
index aaebce7..4b29073 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/jms.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/jms.xml
@@ -92,10 +92,24 @@
                 files which can be found in the 'lib' directory of ActiveMQ installation, should be
                 copied into the 'lib' directory of Synapse.
             </p>
+            <p> ActiveMQ 5.8.0 and above </p>
             <ul>
-                <li>activemq-core.jar</li>
-                <li>geronimo-jms.jar</li>
-                <li>geronimo-j2ee-management.jar</li>
+                <li>activemq-broker-x.x.x.jar</li>
+                <li>activemq-client-x.x.x.jar</li>
+                <li>activemq-kahadb-store-x.x.x.jar </li>
+                <li>geronimo-jms_1.1_spec-1.1.1.jar</li>
+                <li>geronimo-j2ee-management_1.1_spec-1.0.1.jar</li>
+                <li>geronimo-jta_1.0.1B_spec-1.0.1.jar</li>
+                <li>hawtbuf-1.9.jar</li>
+                <li>Slf4j-api-1.6.6.jar</li>
+                <li>activeio-core-x.x.x.jar (available in AMQ_HOME/lib/optional folder)</li>
+            </ul>
+
+            <p> Earlier version of ActiveMQ </p>
+            <ul>
+                <li>activemq-core-x.x.x.jar</li>
+                <li>geronimo-j2ee-management_1.0_spec-1.0.jar</li>
+                <li>geronimo-jms_1.1_spec-1.1.1.jar</li>
             </ul>
             <p>
                 Now we are all set to enable the JMS transport receiver and sender for Synapse and
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/mail.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/mail.xml
index d1ec9d4..ad46d2c 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/mail.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/mail.xml
@@ -45,9 +45,9 @@
         &lt;parameter name=&quot;mail.smtp.port&quot;&gt;587&lt;/parameter&gt;
         &lt;parameter name=&quot;mail.smtp.starttls.enable&quot;&gt;true&lt;/parameter&gt;
         &lt;parameter name=&quot;mail.smtp.auth&quot;&gt;true&lt;/parameter&gt;
-        &lt;parameter name=&quot;mail.smtp.user&quot;&gt;synapse.demo.0&lt;/parameter&gt;
+        &lt;parameter name=&quot;mail.smtp.user&quot;&gt;synapse.demo.mail1&lt;/parameter&gt;
         &lt;parameter name=&quot;mail.smtp.password&quot;&gt;mailpassword&lt;/parameter&gt;
-        &lt;parameter name=&quot;mail.smtp.from&quot;&gt;synapse.demo.0@gmail.com&lt;/parameter&gt;
+        &lt;parameter name=&quot;mail.smtp.from&quot;&gt;synapse.demo.mail1@gmail.com&lt;/parameter&gt;
 &lt;/transportSender&gt;</div>
 			</p>
 		</section>
@@ -62,4 +62,4 @@
 			<div class="xmlConf">&lt;transportReceiver name=&quot;mailto&quot; class=&quot;org.apache.axis2.transport.mail.MailTransportListener&quot;&gt;&lt;/transportReceiver&gt;</div>
 		</section>
 	</body>
-</document>
\ No newline at end of file
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/script.xml b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/script.xml
index 84d1f1d..17ceebf 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/samples/setup/script.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/samples/setup/script.xml
@@ -35,8 +35,14 @@
 				<li>
 					<a href="#ruby">Ruby Support</a>
 				</li>
+                <li>
+					<a href="#python">Python Support</a>
+				</li>
 				<li>
-					<a href="#json">JSON Support</a>
+					<a href="#json-syn3">JSON Support on Synapse 3.0.0</a>
+				</li>
+				<li>
+					<a href="#json">JSON Support Prior to Synapse 3.0.0</a>
 				</li>
 			</ul>
 		</section>
@@ -69,12 +75,32 @@
 					</a>
 				</p>
 			</subsection>
-			<subsection name="JSON Support" id="json">
+			<subsection name="Python Support" id="python">
+				<p>
+					For Python support you need to download the 'jython.jar'
+					from the Maven repository for Jython, and copy it into the 'lib'
+					folder of Synapse . The Jython JAR can be downloaded from
+					<a class="externalLink"
+						href="http://central.maven.org/maven2/org/python/jython/2.2.1/jython-2.2.1.jar">
+						here
+					</a>
+				</p>
+			</subsection>
+
+			<subsection name="JSON Support on Synapse 3.0.0" id="json-syn3">
 				<p>
 					<a class="externalLink" href="http://json.org">JSON</a>
 					is a lightweight data-interchange format.
-					It can be used as an alternative to XML or SOAP. To enable the JSON
-					support in Synapse, following two jar files should be deployed into the 'lib'
+					It can be used as an alternative to XML or SOAP. From Synapse 3.0.0 onward, there are no additional
+					steps required to enable JSON.
+
+				</p>
+			</subsection>
+
+			<subsection name="JSON Support Prior to Synapse 3.0.0" id="json">
+				<p>
+					To enable JSON
+					support on Synpase versions prior to 3.0.0, the following two jar files should be deployed into the 'lib'
 					directory of Synapse.
 				</p>
 				<ul>
@@ -82,7 +108,7 @@
 						<a class="externalLink" href="http://repo1.maven.org/maven2/org/apache/axis2/axis2-json">axis2-json.jar</a>
 					</li>
 					<li>
-						<a class="externalLink" href="http://jettison.codehaus.org/Download">jettison.jar</a>
+						<a class="externalLink" href="http://central.maven.org/maven2/org/codehaus/jettison/jettison/">jettison.jar</a>
 					</li>
 				</ul>
                 <p>
@@ -107,4 +133,4 @@
 
 		</section>
 	</body>
-</document>
\ No newline at end of file
+</document>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/transports.xml b/java/modules/documentation/src/site/xdoc/userguide/transports.xml
index 91ea733..f7b9089 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/transports.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/transports.xml
@@ -32,7 +32,7 @@
 			</p>
 			<ul>
 				<li>
-                    A non blocking HTTP transport that gives better performance in a highly
+                    A non-blocking HTTP transport that gives better performance in a highly
                     asynchronous environment like Synapse.
 				</li>
 				<li>
@@ -105,7 +105,21 @@
 					<a href="#Contents">Contents</a>
 				</li>
 				<li>
-					<a href="#Non-blocking_HTTP_transport">Non-blocking HTTP transport</a>
+					<a href="#Passthrough_HTTP_transport">Passthrough HTTP transport</a>
+					<ul>
+						<li>
+							<a href="#Example_configurations">Example configurations</a>
+						</li>
+						<li>
+							<a href="#Transport_listener_parameters">Transport listener parameters</a>
+						</li>
+						<li>
+							<a href="#Transport_sender_parameters">Transport sender parameters</a>
+						</li>
+					</ul>
+				</li>
+				<li>
+					<a href="#Non-blocking_HTTP(NHTTP)_transport">Non-blocking HTTP(NHTTP) transport</a>
 					<ul>
 						<li>
 							<a href="#Example_configurations">Example configurations</a>
@@ -162,7 +176,254 @@
                 </li>
 			</ul>
 		</section>
-	    <section name="Non-blocking HTTP transport" id="Non-blocking_HTTP_transport">
+		<section name="Passthrough HTTP transport" id="Passthrough_HTTP_transport">
+			<subsection name="Example configuration" id="Example_configurations">
+				<div class="xmlConf">&lt;transportReceiver name=&quot;http&quot; class=&quot;org.apache.synapse.transport.passthru.PassThroughHttpListener&quot;&gt;
+	&lt;parameter name=&quot;port&quot;&gt;8280&lt;/parameter&gt;
+	&lt;parameter name=&quot;httpGetProcessor&quot;locked=&quot;org.apache.synapse.transport.passthru.api.PassThroughNHttpGetProcessor&quot;&gt;true&lt;/parameter&gt;
+&lt;/transportReceiver&gt;
+
+&lt;transportReceiver name=&quot;https&quot; class=&quot;org.apache.synapse.transport.passthru.PassThroughHttpSSLListener&quot;&gt;
+	&lt;parameter name=&quot;port&quot; locked=&quot;false&quot;&gt;8243&lt;/parameter&gt;
+	&lt;parameter name=&quot;httpGetProcessor&quot;locked=&quot;org.apache.synapse.transport.passthru.api.PassThroughNHttpGetProcessor&quot;&gt;true&lt;/parameter&gt;
+	&lt;parameter name=&quot;keystore&quot; locked=&quot;false&quot;&gt;
+		&lt;KeyStore&gt;
+			&lt;Location&gt;lib/identity.jks&lt;/Location&gt;
+			&lt;Type&gt;JKS&lt;/Type&gt;
+			&lt;Password&gt;password&lt;/Password&gt;
+			&lt;KeyPassword&gt;password&lt;/KeyPassword&gt;
+		&lt;/KeyStore&gt;
+	&lt;/parameter&gt;
+	&lt;parameter name=&quot;truststore&quot; locked=&quot;false&quot;&gt;
+		&lt;TrustStore&gt;
+			&lt;Location&gt;lib/trust.jks&lt;/Location&gt;
+			&lt;Type&gt;JKS&lt;/Type&gt;
+			&lt;Password&gt;password&lt;/Password&gt;
+		&lt;/TrustStore&gt;
+	&lt;/parameter&gt;
+&lt;/transportReceiver&gt;
+
+&lt;transportSender name=&quot;http&quot;  class=&quot;org.apache.synapse.transport.passthru.PassThroughHttpSender&quot;&gt;
+&lt;/transportSender&gt;
+
+&lt;transportSender name=&quot;https&quot; class=&quot;org.apache.synapse.transport.passthru.PassThroughHttpSSLSender&quot;&gt;
+	&lt;parameter name=&quot;keystore&quot; locked=&quot;false&quot;&gt;
+		&lt;KeyStore&gt;
+			&lt;Location&gt;lib/identity.jks&lt;/Location&gt;
+			&lt;Type&gt;JKS&lt;/Type&gt;
+			&lt;Password&gt;password&lt;/Password&gt;
+			&lt;KeyPassword&gt;password&lt;/KeyPassword&gt;
+		&lt;/KeyStore&gt;
+	&lt;/parameter&gt;
+	&lt;parameter name=&quot;truststore&quot; locked=&quot;false&quot;&gt;
+		&lt;TrustStore&gt;
+			&lt;Location&gt;lib/trust.jks&lt;/Location&gt;
+			&lt;Type&gt;JKS&lt;/Type&gt;
+			&lt;Password&gt;password&lt;/Password&gt;
+		&lt;/TrustStore&gt;
+	&lt;/parameter&gt;
+	&lt;parameter name="CertificateRevocationVerifier"&gt;
+		&lt;CacheSize&gt;50&lt;/CacheSize&gt;
+	&lt;CacheDurationMins&gt;5&lt;/CacheDurationMins&gt;
+	&lt;/parameter&gt;
+&lt;/transportSender&gt;</div>
+			</subsection>
+			<subsection name="Transport listener parameters" id="Transport_listener_parameters">
+				<p>The following parameters are supported by both the HTTP and the HTTPS listener:</p>
+				<dl>
+					<dt>
+						<tt>port</tt>
+					</dt>
+					<dd>The TCP port to bind the listener to.</dd>
+					<dt>
+						<tt>bind-address</tt>
+					</dt>
+					<dd>
+						The IP address to bind the listener to. This can be used on hosts that have
+						more than one network interface or IP address to run multiple Synapse instances
+						listening to the same port. If this parameter is not specified, the
+						listener will accept connections on any IP address.
+					</dd>
+					<dt>
+						<tt>hostname</tt>
+					</dt>
+					<dd>
+						The host name to use when computing endpoint references in generated WSDL files.
+						The default value is the host name as provided by the operation system or
+						<tt>localhost</tt> if the host name can't be determined. The value of this
+						parameter is ignored if <tt>WSDLEPRPrefix</tt> is specified.
+					</dd>
+					<dt>
+						<tt>WSDLEPRPrefix</tt>
+					</dt>
+					<dd>
+						The URL prefix to use when computing endpoint references in generated WSDL files.
+						The value must be a valid URL with at least a protocol and host. If this value
+						is unspecified, endpoint references will be computed based on the listener type
+						(HTTP or HTTPS) and <tt>hostname</tt> and <tt>port</tt> parameters.
+						<p>
+							This parameter should be used if clients connect to Synapse through a frontend
+							server, e.g. a (load balancing) Apache, and these clients rely on the address
+							information in the WSDL documents exposed through <tt>...?wsdl</tt> URLs.
+						</p>
+					</dd>
+				</dl>
+				<p>The following parameters are specific to the HTTPS listener: </p>
+				<dl>
+					<dt>
+						<tt>keystore</tt>
+					</dt>
+					<dd>
+						The keystore configuration. The value of this parameter must be a
+						<tt>&lt;KeyStore&gt;</tt>
+						element as shown in the example configurations above.
+					</dd>
+					<dt>
+						<tt>truststore</tt>
+					</dt>
+					<dd>
+						The truststore configuration. The value of this parameter must be a
+						<tt>&lt;TrustStore&gt;</tt>
+						element as shown in the example configurations above.
+					</dd>
+					<dt>
+						<tt>SSLVerifyClient</tt>
+					</dt>
+					<dd>
+						This parameter has the same meaning as the corresponding
+						<a class="externalLink" href="http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslverifyclient">mod_ssl directive</a>
+						and sets the desired certificate verification level for client authentication:
+						<ul>
+							<li>
+								<tt>none</tt> (default): no client certificate is required at all
+							</li>
+							<li>
+								<tt>optional</tt>: the client may present a valid certificate, but is
+								not required to do so
+							</li>
+							<li>
+								<tt>require</tt>: the client has to present a valid certificate,
+								otherwise the connection request will be terminated during SSL handshake
+							</li>
+						</ul>
+					</dd>
+				</dl>
+			</subsection>
+			<subsection name="Transport sender parameters" id="Transport_sender_parameters">
+				<p>
+					The following property can be used to control based on content-types whether the
+					HTTP/HTTPS sender shall output a warning for responses with HTTP status code 500.
+				</p>
+				<dl>
+					<dt>
+						<tt>warnOnHTTP500</tt>
+					</dt>
+					<dd>
+						A list of content-types for which Synapse shall output a warning when receiving
+						an HTTP 500 response (each value each separated by a |). By default, Synapse
+						outputs a warning for any HTTP 500 response, irrespective of the content-type.
+						Consequently, also for each SOAP fault a warning will be logged. If only for
+						specific content-types a warning shall be logged, please provide a |-separated
+						list. To output the warning for messages which do not have a content-type set,
+						please use the value 'none'.
+						<p>
+							Example value: x-application/hessian|none
+						</p>
+					</dd>
+				</dl>
+				<p>
+					The following properties can be used to configure the HTTP sender to use a proxy.
+					They can be specified either as transport parameters in declared in
+					<tt>&lt;transportSender&gt;</tt> or as system properties.
+				</p>
+				<dl>
+					<dt>
+						<tt>http.proxyHost</tt>
+					</dt>
+					<dd>The host name or address of the proxy server.</dd>
+					<dt>
+						<tt>http.proxyPort</tt>
+					</dt>
+					<dd>The TCP port of the proxy server.</dd>
+					<dt>
+						<tt>http.nonProxyHosts</tt>
+					</dt>
+					<dd>
+						The hosts to which the HTTP sender should connect directly and not through
+						the proxy server. The value can be a list of hosts, each separated by a |, and
+						in addition a wildcard character (*) can be used for matching.
+						<p>
+							Example value:
+							<tt>*.foo.com|localhost</tt>
+						</p>
+					</dd>
+				</dl>
+				<p>Note that the HTTPS sender has no proxy support yet.</p>
+				<p>The following parameters are specific to the HTTPS sender:</p>
+				<dl>
+					<dt>
+						<tt>keystore</tt>
+					</dt>
+					<dd>
+						The keystore configuration. The value of this parameter must be a
+						<tt>&lt;KeyStore&gt;</tt> element as shown in the example configurations
+						above.
+					</dd>
+					<dt>
+						<tt>truststore</tt>
+					</dt>
+					<dd>
+						The truststore configuration. The value of this parameter must be a
+						<tt>&lt;TrustStore&gt;</tt>
+						element as shown in the example configurations above.
+					</dd>
+					<dt>
+						<tt>novalidatecert</tt>
+					</dt>
+					<dd>
+						When set to <tt>true</tt>, this parameter disables server certificate
+						validation (trust). The default value is <tt>false</tt>. This parameter will
+						be ignored if <tt>truststore</tt> is set.
+						<p>
+							Setting his parameter to <tt>true</tt>
+							is useful in development and test environments, but should not be used in
+							production environments. If validation is disabled, a warning message will
+							be logged at startup.
+						</p>
+					</dd>
+					<dt>
+						<tt>HostnameVerifier</tt>
+					</dt>
+					<dd>
+						This optional parameter specifies the policy to apply when checking that the
+						hostname of the server matches the names stored inside the X.509 certificate
+						presented by the server. Possible values are <tt>Strict</tt>, <tt>AllowAll</tt>
+						and <tt>DefaultAndLocalhost</tt>. See the
+						<a href="../apidocs/org/apache/synapse/transport/nhttp/HostnameVerifier.html">HostnameVerifier Javadoc</a>
+						for more details.
+					</dd>
+					<dt>
+						<tt>CertificateRevocationVerifier</tt>
+					</dt>
+					<dd>
+						This is an optional parameter to validate the revocation status of the host
+						certificates using <a href="http://www.ietf.org/rfc/rfc2560.txt">OCSP</a> and
+						<a href="http://www.ietf.org/rfc/rfc5280.txt">CRL</a> when making HTTPS connections.
+						Simply uncomment this parameter in the axis2.xml file to enable the feature.
+						Two LRU caches are used to cache CRLs and OCSP responses until they are expired. "CacheSize"
+						property defines the maximum size of a cache. When this limit is reached, the
+						old values will be automatically removed and updated with new values. "CacheDurationMins"
+						is used to configure the time duration (in minutes) between two consecutive
+						runs of the CacheManager task which periodically performs housekeeping work
+						in each cache. Refer the example configuration above to see how to configure
+						these properties. The scheduled CacheManager tasks for OCSP and CRL caches can
+						be manually controlled using the JMX MBeans registered under the "CacheController"
+						category.
+					</dd>
+				</dl>
+			</subsection>
+		</section>
+	    <section name="Non-blocking HTTP (NHTTP) transport" id="Non-blocking_HTTP(NHTTP)_transport">
 			<subsection name="Example configuration" id="Example_configurations">
 				<div class="xmlConf">&lt;transportReceiver name=&quot;http&quot; class=&quot;org.apache.synapse.transport.nhttp.HttpCoreNIOListener&quot;&gt;
     &lt;parameter name=&quot;port&quot;&gt;8280&lt;/parameter&gt;
@@ -310,7 +571,7 @@
 					</dt>
 					<dd>
                         A list of content-types for which Synapse shall output a warning when receiving
-                        an HTTP 500 response (each value each separated by a |). By default Synapse
+                        an HTTP 500 response (each value each separated by a |). By default, Synapse
                         outputs a warning for any HTTP 500 response, irrespective of the content-type.
                         Consequently, also for each SOAP fault a warning will be logged. If only for
                         specific content-types a warning shall be logged, please provide a |-separated
@@ -422,7 +683,7 @@
                     file or a directory. The transport listener will periodically poll the specified
                     location and process any file(s) found. After a file has been processed it will be
 					deleted or moved to another location. Note that this is absolutely mandatory to
-                    prevent the listener from processing files multiple times. Therefore the VFS transport
+                    prevent the listener from processing files multiple times. Therefore, the VFS transport
                     listener can only be used in situations where it has write access to the file system
                     location and where deleting or moving the dropped files is acceptable.
 				</p>
@@ -692,7 +953,7 @@
 				<p>
                     The VFS listener will start reading a file as soon as it appears in the configured
                     location. To avoid processing half written files, the creation of these files should
-                    be made atomic. On most platforms this can be achieved by writing the data to a
+                    be made atomic. On most platforms, this can be achieved by writing the data to a
                     temporary file and then moving the file to the target location. Note however that
                     a move operation is only atomic if the source and destination are on the same
                     physical file system. The location for the temporary file should be chosen with
@@ -726,7 +987,7 @@
                     To enable the FIX transport, you need to uncomment the FIX transport sender and
                     FIX transport receiver configurations in the SYNAPSE_HOME/repository/conf/axis2.xml.
                     Simply locate and uncomment the FIXTransportSender and FIXTransportListener sample
-                    configurations. Also add the following jars to the Synapse class path
+                    configurations. Also, add the following jars to the Synapse class path
 					(SYNAPSE_HOME/lib directory).
 				</p>
 				<ul>
@@ -752,7 +1013,7 @@
 						<tt>transport.fix.AcceptorConfigURL</tt>
 					</dt>
 					<dd>
-                        If a service needs to listen to incoming FIX messages from a remote initiator
+                        If a service needs to listen to incoming FIX messages from a remote initiator,
                         then Synapse needs to create an acceptor. This parameter should contain the
                         URL of the file which contains the FIX configuration for the acceptor.
 						(See sample 257)
@@ -808,7 +1069,7 @@
 					</dt>
 					<dd>
                         If a response FIX message sent from Synapse to a remote FIX engine should be
-                        forwarded from the remote engine to another party this parameter can be used
+                        forwarded from the remote engine to another party, this parameter can be used
                         to set the DeliverToCompID field of the messages at Synapse.
 					</dd>
 					<dt>
@@ -816,7 +1077,7 @@
 					</dt>
 					<dd>
                         If a response FIX message sent from Synapse to a remote FIX engine should be
-                        forwarded from the remote engine to another party this parameter can be used
+                        forwarded from the remote engine to another party, this parameter can be used
                         to set the DeliverToSubID field of the messages at Synapse.
 					</dd>
 					<dt>
@@ -824,7 +1085,7 @@
 					</dt>
 					<dd>
                         If a response FIX message sent from Synapse to a remote FIX engine should be
-                        forwarded from the remote engine to another party this parameter can be used
+                        forwarded from the remote engine to another party, this parameter can be used
                         to set the DeliverToLocationID field of the messages at Synapse.
 					</dd>
 					<dt>
@@ -930,7 +1191,7 @@
                     <dt>
                         <tt>transport.amqp.ConsumerTx</tt>
                     </dt>
-                    <dd>Use transactions at consumer side if set to true. By default this will be
+                    <dd>Use transactions at consumer side if set to true. By default, this will be
                         considered false and explicit acknowledgement will be done</dd>
                     <dt>
                         <tt>transport.amqp.QueueName</tt>
@@ -954,7 +1215,7 @@
                     </dt>
                     <dd>True if the polling task should wait until it process  the accepted
                         messages. This can be used in conjunction with a single thread polling
-                        task(in the whole transport, i.e. only a single AMQP proxy per flow)
+                        task (in the whole transport, i.e. only a single AMQP proxy per flow)
                         to achieve in order delivery</dd>
                     <dt>
                         <tt>transport.amqp.ConnectionFactoryName</tt>
@@ -963,16 +1224,16 @@
                     <dt>
                         <tt>transport.amqp.ResponseConnectionFactoryName</tt>
                     </dt>
-                    <dd>In a two-way scenario which connection factory of the senders' should be used
+                    <dd>In a two-way scenario, which connection factory of the senders' should be used
                         to send the response</dd>
                     <dt>
                         <tt>transport.amqp.ScheduledTaskInitialDelay</tt>
                     </dt>
-                    <dd>The initial delay(in milliseconds) that the polling task should delay before initial attempt</dd>
+                    <dd>The initial delay (in milliseconds) that the polling task should delay before initial attempt</dd>
                     <dt>
                         <tt>transport.amqp.ScheduledTaskDelay</tt>
                     </dt>
-                    <dd>The delay(in milliseconds) that the polling task should delay before next attempt.</dd>
+                    <dd>The delay (in milliseconds) that the polling task should delay before next attempt.</dd>
                     <dt>
                         <tt>transport.amqp.ScheduledTaskTimeUnit</tt>
                     </dt>
@@ -1051,7 +1312,7 @@
                     <dt>
                         <tt>semaphore-time-out</tt>
                     </dt>
-                    <dd>A system property to set the time out(in seconds) of semaphore which waits for
+                    <dd>A system property to set the timeout (in seconds) of semaphore which waits for
                     a response.
                     </dd>
                     <dt>
@@ -1060,11 +1321,11 @@
                     <dd>If a polling task encounter an exception due to some reason(most probably
                         due to broker outage) it will be suspended until a successful re-connect.
                         This system property defines the initial duration that the re-connection
-                        check task should should be suspended(1000 ms by default) before next re-try.</dd>
+                        check task should be suspended (1000 ms by default) before next re-try.</dd>
                     <dt>
                         <tt>reconnection-progression-factor</tt>
                     </dt>
-                    <dd>A system property to define the factor(2.0 by default) to multiply the initial
+                    <dd>A system property to define the factor (2.0 by default) to multiply the initial
                         suspended duration to calculate the next suspending duration for the
                         re-connection check task.</dd>
                     <dt>
diff --git a/java/modules/documentation/src/site/xdoc/userguide/upgrading.xml b/java/modules/documentation/src/site/xdoc/userguide/upgrading.xml
index 817ddcf..5d27cc0 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/upgrading.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/upgrading.xml
@@ -26,10 +26,11 @@
 	<body>
         <section name="Upgrading to the Latest Version">
             <p>
-                If you are using an older version of Synapse (1.x) and now looking to migrate to
-                the latest versions (2.x) this document would be a good starting point. This
+                If you are using an older version of Synapse (1.x/2.x) and now looking to migrate to
+                the latest versions (3.x) this document would be a good starting point. This
                 article provides information on steps that need to be carried out to smoothly
-                migrate from an older release of Synapse to the latest version.
+                migrate from an older release of Synapse to the latest version. If you are migrating from 1.x version
+				to 3.x we recommend you follow the 1.x -> 2.x migration followed by the 2.x -> 3.x.
             </p>
         </section>
 		<section name="Contents">
@@ -38,6 +39,17 @@
 						<a href="#General_comments">General comments</a>
 					</li>
 					<li>
+						<a href="#Upgrading_from_2.1_to_3.0">Upgrading from 2.1 to 3.0</a>
+						<ul>
+							<li>
+								<a href="#Custom_Extensions_3.0">Custom Extensions</a>
+							</li>
+							<li>
+								<a href="#New_mediators_3.0">Respond and Loopback Mediators</a>
+							</li>
+						</ul>
+					</li>
+					<li>
 						<a href="#Upgrading_from_1.2_to_2.1">Upgrading from 1.2 to 2.1</a>
 						<ul>
 							<li>
@@ -81,7 +93,7 @@
 				</li>
 				<li>
                     Recompile and test the extension with the libraries from the new Synapse release.
-					We try to avoid to introduce incompatible changes to Synapse's core APIs between
+					We try to avoid introducing incompatible changes to Synapse's core APIs between
 					releases (except if the related classes or methods were deprecated in the previous
 					release). However, it is not always possible to maintain compatibility. In addition
 					your code might depend on features that are not part of the core API. Therefore,
@@ -99,6 +111,46 @@
                 the migration easier.
 			</p>
 		</section>
+
+		<section name="Upgrading from 2.1 to 3.0" id="Upgrading_from_2.1_to_3.0">
+			<subsection name="Custom Extensions" id="Custom_Extensions_3.0">
+				<p>
+					Synapse 3.0 introduces the PassThrough HTTP Transport which improves HTTP transport performance by removing
+					intermediary buffer use when there is no requirement to read an HTTP payload (i.e. message is merely passed
+					through). If you have custom extensions that depend on accessing or reading buffers directly, you
+					may require to change your code to trigger the PassThrough transport to build the payload. This can
+					be done using the <a href="../apidocs/org/apache/synapse/transport/passthru/util/RelayUtils.html">RelayUtils#buildMessage()</a>
+					static methods.
+				</p>
+			</subsection>
+			<subsection name="Respond and Loopback Mediators" id="New_mediators_3.0">
+				<p>
+					<a href="mediators.html#Respond">Respond</a> and <a href="mediators.html#Loopback">Loopback</a>
+					are new mediators introduced in Apache Synapse 3.0. <a href="mediators.html#Respond">Respond</a> provides
+					a mechanism to send a message back to the client as a response. In older versions of Apache Synapse
+					we would use the <a href="mediators.html#Send">Send</a> mediator to respond back to a client either
+					after a message is received from a backend in an out sequence or force a response back to the client
+					using a series of mediators as follows:
+				</p>
+					<div class="xmlConf">
+&lt;header name="To" action="remove"/&gt;
+&lt;property name="RESPONSE" value="true" scope="default" type="STRING"/&gt;
+&lt;property name="NO_ENTITY_BODY" scope="axis2" action="remove"/&gt;
+&lt;send/&gt;
+					</div>
+				<p>
+					We can replace above methods with the <a href="mediators.html#Respond">Respond</a> mediator anywhere
+					in the mediation flow to respond back to the client with the current message. Any mediators residing
+					after the <a href="mediators.html#Respond">Respond</a> mediator will be ignored.
+				</p>
+
+				<p>Similarly the <a href="mediators.html#Loopback">Loopback</a> mediator is used to jump the flow from
+				an in sequence to the out sequence ignoring any mediators residing after the
+				<a href="mediators.html#Loopback">Loopback</a> mediator. <a href="mediators.html#Loopback">Loopback</a>
+					mediator has no effect from inside an out sequence.
+				</p>
+			</subsection>
+		</section>
 		
 		<section name="Upgrading from 1.2 to 2.1" id="Upgrading_from_1.2_to_2.1">
 			<subsection name="Configuration file vs multi XML configuration" id="Configuration_file_vs_multi_XML_configuration">
@@ -124,8 +176,8 @@
 	 fault.xml
   /tasks
   /templates
-	 registry.xml
-	 synapse.xml</div>
+  registry.xml
+  synapse.xml</div>
 				<p>
                     As you can see in the above sketch of the repository though it is a repository based
 					configuration, it also supports the old style single flat synapse.xml file in which
diff --git a/java/modules/documentation/src/site/xdoc/userguide/xpath.xml b/java/modules/documentation/src/site/xdoc/userguide/xpath.xml
index 1e59b48..64edafb 100644
--- a/java/modules/documentation/src/site/xdoc/userguide/xpath.xml
+++ b/java/modules/documentation/src/site/xdoc/userguide/xpath.xml
@@ -43,7 +43,17 @@
                     </ul>
                     <ul>
                         <li>
-                            <a href="#get_prop">base64Encode</a>
+                            <a href="#base64_encode">base64Encode</a>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <a href="#base64_decode">base64Decode</a>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <a href="#url_encode">url-encode</a>
                         </li>
                     </ul>
                 </li>
@@ -197,11 +207,21 @@
                 <p>Java System properties can be retrieved from the system scope.</p>
 
             </subsection>
-            <subsection name="base64Encode function" id="base64">
+            <subsection name="base64Encode function" id="base64_encode">
                 <p>Returns the base64 encoded value of the argument.</p>
                 <p>Syntax:</p>
                 <div class="xmlConf">base64Encode(String value)</div>
             </subsection>
+            <subsection name="base64Decode function" id="base64_decode">
+                <p>Returns the base64 decoded value of the argument.</p>
+                <p>Syntax:</p>
+                <div class="xmlConf">base64Decode(String value)</div>
+            </subsection>
+            <subsection name="url-encode function" id="url_encode">
+                <p>Returns the URL encoded value of the argument.</p>
+                <p>Syntax:</p>
+                <div class="xmlConf">url-encode(String value)</div>
+            </subsection>
         </section>
         <section name="Variables" id="var">
             <p>There are several XPath variables supported by Synapse. These are used for
diff --git a/java/modules/experimental/pom.xml b/java/modules/experimental/pom.xml
index edf7ca0..1d2a711 100644
--- a/java/modules/experimental/pom.xml
+++ b/java/modules/experimental/pom.xml
@@ -1,77 +1,74 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-  ~  Licensed to the Apache Software Foundation (ASF) under one

-  ~  or more contributor license agreements.  See the NOTICE file

-  ~  distributed with this work for additional information

-  ~  regarding copyright ownership.  The ASF licenses this file

-  ~  to you under the Apache License, Version 2.0 (the

-  ~  "License"); you may not use this file except in compliance

-  ~  with the License.  You may obtain a copy of the License at

-  ~

-  ~   http://www.apache.org/licenses/LICENSE-2.0

-  ~

-  ~  Unless required by applicable law or agreed to in writing,

-  ~  software distributed under the License is distributed on an

-  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

-  ~  KIND, either express or implied.  See the License for the

-  ~  specific language governing permissions and limitations

-  ~  under the License.

-  -->

-

-<project

-    xmlns="http://maven.apache.org/POM/4.0.0"

-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

-    <modelVersion>4.0.0</modelVersion>

-    <parent>

-        <groupId>org.apache.synapse</groupId>

-        <artifactId>Apache-Synapse</artifactId>

-        <version>2.2.0-SNAPSHOT</version>

-        <relativePath>../../pom.xml</relativePath>

-    </parent>

-

-    <groupId>org.apache.synapse</groupId>

-    <artifactId>synapse-experimental</artifactId>

-    

-    <name>Apache Synapse - Experimental code</name>

-    <description>Apache Synapse - Experimental code (use at your own risk!)</description>

-    <packaging>bundle</packaging>

-

-    <scm>

-        <connection>scm:svn:http://svn.apache.org/repos/asf/synapse/trunk/java/modules/experimental</connection>

-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/synapse/trunk/java/modules/experimental</developerConnection>

-        <url>http://svn.apache.org/viewvc/synapse/trunk/java/modules/experimental</url>

-    </scm>

-

-    <build>

-        <plugins>

-            <plugin>

-                <groupId>org.apache.felix</groupId>

-                <artifactId>maven-bundle-plugin</artifactId>

-                <extensions>true</extensions>

-                <configuration>

-                    <instructions>

-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>

-                        <Export-Package>

-                            org.apache.synapse.experimental.*,

-                        </Export-Package>

-                        <Import-Package>

-                            !javax.xml.namespace,

-                            javax.xml.namespace; version=0.0.0,

-                            *;resolution:=optional,

-                        </Import-Package>

-                        <DynamicImport-Package>*</DynamicImport-Package>

-                    </instructions>

-                </configuration>

-            </plugin>

-        </plugins>

-    </build>

-

-    <dependencies>

-        <dependency>

-            <groupId>org.apache.synapse</groupId>

-            <artifactId>synapse-core</artifactId>

-        </dependency>

-    </dependencies>

-

-</project>

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.synapse</groupId>
+        <artifactId>Apache-Synapse</artifactId>
+        <version>3.0.2-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.synapse</groupId>
+    <artifactId>synapse-experimental</artifactId>
+    
+    <name>Apache Synapse - Experimental code</name>
+    <description>Apache Synapse - Experimental code (use at your own risk!)</description>
+    <packaging>bundle</packaging>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/synapse/trunk/java/modules/experimental</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/synapse/trunk/java/modules/experimental</developerConnection>
+        <url>http://svn.apache.org/viewvc/synapse/trunk/java/modules/experimental</url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Export-Package>
+                            org.apache.synapse.experimental.*,
+                        </Export-Package>
+                        <Import-Package>
+                            !javax.xml.namespace,
+                            javax.xml.namespace; version=0.0.0,
+                            *;resolution:=optional,
+                        </Import-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.synapse</groupId>
+            <artifactId>synapse-core</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/java/modules/extensions/pom.xml b/java/modules/extensions/pom.xml
index 1c8b065..2293a46 100644
--- a/java/modules/extensions/pom.xml
+++ b/java/modules/extensions/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -136,8 +133,8 @@
             <artifactId>wso2throttle-core</artifactId>
         </dependency>
         <dependency>
-            <groupId>rhino</groupId>
-            <artifactId>js</artifactId>
+            <groupId>org.mozilla</groupId>
+            <artifactId>rhino</artifactId>
         </dependency>
         <dependency>
             <groupId>xerces</groupId>
diff --git a/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/JavaScriptXmlHelper.java b/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/JavaScriptXmlHelper.java
new file mode 100644
index 0000000..cf3883f
--- /dev/null
+++ b/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/JavaScriptXmlHelper.java
@@ -0,0 +1,110 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.mediators.bsf;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.bsf.xml.DefaultXMLHelper;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Scriptable;
+import org.mozilla.javascript.ScriptableObject;
+import org.mozilla.javascript.xml.XMLObject;
+
+import javax.script.ScriptException;
+import javax.xml.stream.XMLStreamException;
+
+/**
+ * This class will provide the operation to getPayloadXML and setPayload of
+ * ScriptMessageContext to convert between XML and ScriptXML object
+ * since there is an api change in rhino17,This class is provided instead of
+ * getting Helper class by XMLHelper.getArgHelper(engine) in bsf
+ */
+
+public class JavaScriptXmlHelper extends DefaultXMLHelper {
+
+    private final Scriptable scope;
+
+    JavaScriptXmlHelper() {
+        Context cx = Context.enter();
+        try {
+            this.scope = cx.initStandardObjects();
+        } finally {
+            Context.exit();
+        }
+    }
+
+    /**
+     * This method will convert the message payload in to xml
+     *
+     * @param scriptXML from java script Scriptable
+     * @return XML content as OMElement wrapped in Scriptable object
+     * @throws javax.script.ScriptException when error
+     */
+    public OMElement toOMElement(Object scriptXML) throws ScriptException {
+        if (scriptXML == null) {
+            return null;
+        }
+        if (!(scriptXML instanceof XMLObject)) {
+            return null;
+        }
+        // TODO: E4X Bug? Shouldn't need this copy, but without it the outer element gets lost???
+        Scriptable jsXML = (Scriptable) ScriptableObject.callMethod(
+                (Scriptable) scriptXML, "copy", new Object[0]);
+
+        OMElement omElement;
+        try {
+            omElement = AXIOMUtil.stringToOM((String) ScriptableObject.callMethod(
+                    jsXML, "toXMLString", new Object[0]));
+        } catch (XMLStreamException e) {
+            throw new ScriptException(e);
+        }
+        return omElement;
+    }
+
+    /**
+     * This method will convert the message payload in to ScriptXML Object
+     *
+     * @param omElement
+     * @return Scriptable object by adding the xml content
+     * @throws javax.script.ScriptException when error
+     */
+    public Object toScriptXML(OMElement omElement)
+            throws ScriptException {
+        if (omElement == null) {
+            return null;
+        }
+        Context cx = Context.enter();
+        try {
+            XmlObject xml;
+            try {
+                xml = XmlObject.Factory.parse(omElement.getXMLStreamReader());
+            } catch (XmlException e) {
+                throw new ScriptException(e);
+            }
+            Object wrappedXML = cx.getWrapFactory().wrap(cx, this.scope, xml, XmlObject.class);
+            Object obj = cx.newObject(this.scope, "XML", new Object[]{wrappedXML});
+            return obj;
+        } finally {
+            Context.exit();
+        }
+    }
+}
diff --git a/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java b/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
index c4d60d1..1217621 100644
--- a/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
+++ b/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
@@ -66,6 +66,11 @@
     private static final String MC_VAR_NAME = "mc";
 
     /**
+     * Name of the JavaScript language
+     */
+    private static final String JAVA_SCRIPT = "js";
+
+    /**
      * The registry entry key for a script loaded from the registry
      * Handle both static and dynamic(Xpath) Keys
      */
@@ -428,7 +433,12 @@
         if (scriptEngine == null) {
             handleException("No script engine found for language: " + language);
         }
-        xmlHelper = XMLHelper.getArgHelper(scriptEngine);
+        //Invoking a custom Helper class since there is an api change in rhino17 for js
+        if (language.equalsIgnoreCase(JAVA_SCRIPT)) {
+            xmlHelper = new JavaScriptXmlHelper();
+        } else {
+            xmlHelper = XMLHelper.getArgHelper(scriptEngine);
+        }
 
         this.multiThreadedEngine = scriptEngine.getFactory().getParameter("THREADING") != null;
         log.debug("Script mediator for language : " + language +
diff --git a/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java b/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java
index 16a6f4f..1497a51 100644
--- a/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java
+++ b/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java
@@ -19,6 +19,7 @@
 
 package org.apache.synapse.mediators.bsf;
 
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.Stack;
@@ -42,7 +43,9 @@
 import org.apache.synapse.Mediator;
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.config.SynapseConfiguration;
+import org.apache.synapse.config.xml.XMLConfigConstants;
 import org.apache.synapse.core.SynapseEnvironment;
+import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.endpoints.Endpoint;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -184,6 +187,10 @@
         return mc.getEntry(key);
     }
 
+    public Object getLocalEntry(String key) {
+        return mc.getLocalEntry(key);
+    }
+
     public void setProperty(String key, Object value) {
         if (value instanceof XMLObject) {
             OMElement omElement = null;
@@ -200,6 +207,81 @@
         }
     }
 
+    /**
+     * Set Property to the message context
+     *
+     * @param key   property name
+     * @param value property value
+     * @param scope scope of the property
+     */
+    public void setProperty(String key, Object value, String scope) {
+        if (scope == null || XMLConfigConstants.SCOPE_DEFAULT.equals(scope)) {
+            // Setting property into default scope
+            setProperty(key, value);
+        } else if (XMLConfigConstants.SCOPE_AXIS2.equals(scope)) {
+            // Setting property into the  Axis2 Message Context
+            Axis2MessageContext axis2smc = (Axis2MessageContext) mc;
+            org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext();
+            axis2MessageCtx.setProperty(key, value);
+        } else if (XMLConfigConstants.SCOPE_TRANSPORT.equals(scope)) {
+            // Setting Transport Headers
+            Axis2MessageContext axis2smc = (Axis2MessageContext) mc;
+            org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext();
+
+            Object headers = axis2MessageCtx.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+            if (headers == null) {
+                Map headersMap = new HashMap();
+                headersMap.put(key, value);
+                axis2MessageCtx.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, headersMap);
+            } else if (headers instanceof Map) {
+                Map headersMap = (Map) headers;
+                headersMap.put(key, value);
+            }
+
+        }
+    }
+
+    /**
+     * Remove property from message context
+     * Scope: Default
+     *
+     * @param key Property name
+     */
+    public void removeProperty(String key) {
+        Set pros = mc.getPropertyKeySet();
+        if (pros != null) {
+            pros.remove(key);
+        }
+    }
+
+    /**
+     * Remove property from message context
+     *
+     * @param key   Property name
+     * @param scope Property scope
+     */
+    public void removeProperty(String key, String scope) {
+        if (scope == null || XMLConfigConstants.SCOPE_DEFAULT.equals(scope)) {
+            // Removing property from default scope
+            removeProperty(key);
+        } else if (XMLConfigConstants.SCOPE_AXIS2.equals(scope)) {
+            // Removing property from the Axis2 Message Context
+            Axis2MessageContext axis2smc = (Axis2MessageContext) mc;
+            org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext();
+            axis2MessageCtx.removeProperty(key);
+
+        } else if (XMLConfigConstants.SCOPE_TRANSPORT.equals(scope)) {
+            // Removing transport headers
+            Axis2MessageContext axis2smc = (Axis2MessageContext) mc;
+            org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext();
+            Object headers = axis2MessageCtx.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+            if (headers != null && headers instanceof Map) {
+                Map headersMap = (Map) headers;
+                headersMap.remove(key);
+            }
+        }
+    }
+
     public Set getPropertyKeySet() {
         return mc.getPropertyKeySet();
     }
diff --git a/java/modules/extensions/src/test/java/org/apache/synapse/format/hessian/HessianTestHelper.java b/java/modules/extensions/src/test/java/org/apache/synapse/format/hessian/HessianTestHelper.java
index b0e67cc..1f7a8b6 100644
--- a/java/modules/extensions/src/test/java/org/apache/synapse/format/hessian/HessianTestHelper.java
+++ b/java/modules/extensions/src/test/java/org/apache/synapse/format/hessian/HessianTestHelper.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.format.hessian;
 
 import org.apache.axiom.om.OMAbstractFactory;
diff --git a/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java b/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java
index c602e77..ec5009f 100644
--- a/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java
+++ b/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java
@@ -25,8 +25,11 @@
 import junit.extensions.RepeatedTest;
 
 import org.apache.synapse.MessageContext;
+import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.TestUtils;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Random;
 
 public class ScriptMediatorTest extends TestCase {
@@ -53,12 +56,84 @@
                 Integer.parseInt(randomno) * 2);
     }
 
+    public void testSetProperty() throws Exception {
+        MessageContext mc = TestUtils.getAxis2MessageContext("<empty/>", null);
+
+        // For default scope
+        String script = "mc.setProperty(\"PROP_DEFAULT\", \"PROP_DEFAULT_VAL\");";
+        ScriptMediator mediator = new ScriptMediator("js", script, null);
+        mediator.mediate(mc);
+        assertEquals("PROP_DEFAULT_VAL", mc.getProperty("PROP_DEFAULT").toString());
+
+        // For Axis2 scope
+        script = "mc.setProperty(\"PROP_AXIS2\", \"PROP_AXIS_VAL\", \"axis2\");";
+        mediator = new ScriptMediator("js", script, null);
+        mediator.mediate(mc);
+        Axis2MessageContext axis2smc = (Axis2MessageContext) mc;
+        org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext();
+        assertEquals("PROP_AXIS_VAL", axis2MessageCtx.getProperty("PROP_AXIS2").toString());
+
+        // For Transport scope
+        script = "mc.setProperty(\"PROP_TRP\", \"PROP_TRP_VAL\", \"transport\");";
+        mediator = new ScriptMediator("js", script, null);
+        mediator.mediate(mc);
+        Object headers = axis2MessageCtx.getProperty(
+                org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+
+        String trpHeader = null;
+        if (headers != null && headers instanceof Map) {
+            Map headersMap = (Map) headers;
+            trpHeader = (String) headersMap.get("PROP_TRP");
+        }
+        assertEquals("PROP_TRP_VAL", trpHeader);
+
+    }
+
+    public void testRemoveProperty() throws Exception {
+        MessageContext mc = TestUtils.getAxis2MessageContext("<empty/>", null);
+
+        // Setting properties
+        mc.setProperty("PROP_DEFAULT", "PROP_DEFAULT_VAL");
+
+        Axis2MessageContext axis2smc = (Axis2MessageContext) mc;
+        org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext();
+        axis2MessageCtx.setProperty("PROP_AXIS2", "PROP_AXIS2_VAL");
+
+        Map headersMap = new HashMap();
+        headersMap.put("PROP_TRP", "PROP_TRP_VAL");
+        axis2MessageCtx.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, headersMap);
+
+        // For default scope
+        String removalScript = "mc.removeProperty(\"PROP_DEFAULT\");";
+        ScriptMediator mediator = new ScriptMediator("js", removalScript, null);
+        mediator.mediate(mc);
+        assertNull(mc.getProperty("PROP_DEFAULT"));
+
+        // For Axis2 scope
+        removalScript = "mc.removeProperty(\"PROP_AXIS2\",\"axis2\");";
+        mediator = new ScriptMediator("js", removalScript, null);
+        mediator.mediate(mc);
+        assertNull(axis2MessageCtx.getProperty("PROP_AXIS2"));
+
+        // For Transport scope
+        removalScript = "mc.removeProperty(\"PROP_TRP\",\"transport\");";
+        mediator = new ScriptMediator("js", removalScript, null);
+        mediator.mediate(mc);
+        Object headers = axis2MessageCtx.getProperty(
+                org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
+
+        headersMap = (Map) headers;
+        assertNull(headersMap.get("PROP_TRP"));
+    }
 
     public static Test suite() {
         TestSuite suite = new TestSuite();
+        suite.addTest(new ScriptMediatorTest("testInlineMediator"));
         for (int i = 0; i < 10; i++) {
             suite.addTest(new RepeatedTest(new ScriptMediatorTest("testThreadSafety"), 10));
         }
+        suite.addTest(new ScriptMediatorTest("testSetProperty"));
+        suite.addTest(new ScriptMediatorTest("testRemoveProperty"));
         return suite;
     }
 
diff --git a/java/modules/handler/pom.xml b/java/modules/handler/pom.xml
index 9aeaf92..dcfede4 100644
--- a/java/modules/handler/pom.xml
+++ b/java/modules/handler/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-        xmlns="http://maven.apache.org/POM/4.0.0"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -74,8 +71,7 @@
                         <phase>package</phase>
                         <configuration>
                             <tasks>
-                                <copy file="target/synapse-handler-${synapse.version}.jar"
-                                      tofile="target/synapse-handler-${synapse.version}.mar"/>
+                                <copy file="target/synapse-handler-${synapse.version}.jar" tofile="target/synapse-handler-${synapse.version}.mar" />
                             </tasks>
                         </configuration>
                         <goals>
diff --git a/java/modules/integration/pom.xml b/java/modules/integration/pom.xml
index 814e3f7..cb00f72 100644
--- a/java/modules/integration/pom.xml
+++ b/java/modules/integration/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-        xmlns="http://maven.apache.org/POM/4.0.0"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -54,156 +51,156 @@
                         <phase>generate-test-resources</phase>
                         <configuration>
                             <tasks>
-                                <echo message="*** Creating testing repositories for synapse samples"/>
-                                <mkdir dir="target/test_repos"/>
-                                <mkdir dir="target/test_repos/axis2Server"/>
-                                <mkdir dir="target/test_repos/axis2Client"/>
-                                <mkdir dir="target/test_repos/synapse"/>
-                                <mkdir dir="target/test_repos/synapse"/>
-                                <mkdir dir="target/test_repos/synapse/modules"/>
-                                <mkdir dir="target/test_repos/synapse/conf"/>
-                                <mkdir dir="target/test_repos/axis2Server/services"/>
-                                <mkdir dir="target/test_repos/axis2Server/modules"/>
-                                <mkdir dir="target/test_repos/axis2Server/conf"/>
-                                <mkdir dir="target/test_repos/axis2Client/modules"/>
-                                <mkdir dir="target/test_repos/axis2Client/conf"/>
+                                <echo message="*** Creating testing repositories for synapse samples" />
+                                <mkdir dir="target/test_repos" />
+                                <mkdir dir="target/test_repos/axis2Server" />
+                                <mkdir dir="target/test_repos/axis2Client" />
+                                <mkdir dir="target/test_repos/synapse" />
+                                <mkdir dir="target/test_repos/synapse" />
+                                <mkdir dir="target/test_repos/synapse/modules" />
+                                <mkdir dir="target/test_repos/synapse/conf" />
+                                <mkdir dir="target/test_repos/axis2Server/services" />
+                                <mkdir dir="target/test_repos/axis2Server/modules" />
+                                <mkdir dir="target/test_repos/axis2Server/conf" />
+                                <mkdir dir="target/test_repos/axis2Client/modules" />
+                                <mkdir dir="target/test_repos/axis2Client/conf" />
 
                                 <copy todir="target/test_repos/axis2Server/conf/">
                                     <fileset dir="src/test/resources/axis2Xml/axis2Server">
-                                        <include name="*.xml"/>
+                                        <include name="*.xml" />
                                     </fileset>
                                 </copy>
                                 <copy todir="target/test_repos/synapse/conf/">
                                     <fileset dir="src/test/resources/axis2Xml/synapse">
-                                        <include name="*.xml"/>
+                                        <include name="*.xml" />
                                     </fileset>
                                 </copy>
                                 <copy todir="target/test_repos/axis2Client/conf/">
                                     <fileset dir="src/test/resources/axis2Xml/axis2Client">
-                                        <include name="*.xml"/>
+                                        <include name="*.xml" />
                                     </fileset>
                                 </copy>
 
                                 <!--<copy file="src/test/resources/trust.jks"-->
-                                <!--tofile="target/test_repos/synapse/conf/trust.jks"/>-->
+                                <!--tofile="target/test_repos/synapse/conf/trust.jks" />-->
                                 <!--<copy file="src/test/resources/identity.jks"-->
-                                <!--tofile="target/test_repos/synapse/conf/identity.jks"/>-->
+                                <!--tofile="target/test_repos/synapse/conf/identity.jks" />-->
                                 <!--<copy file="../core/src/test/resources/keystore.jks"-->
-                                <!--tofile="target/test_repos/synapse/conf/keystore.jks"/>-->
+                                <!--tofile="target/test_repos/synapse/conf/keystore.jks" />-->
 
-                                <property name="temp.dir" value="target/temp"/>
-                                <property name="classes" value="${temp.dir}/classes"/>
-                                <property name="services" value="target/test_repos/axis2Server/services"/>
+                                <property name="temp.dir" value="target/temp" />
+                                <property name="classes" value="${temp.dir}/classes" />
+                                <property name="services" value="target/test_repos/axis2Server/services" />
 
-                                <property name="src" value="../samples/services/SimpleStockQuoteService/src"/>
+                                <property name="src" value="../samples/services/SimpleStockQuoteService/src" />
 
-                                <mkdir dir="${temp.dir}"/>
-                                <mkdir dir="${classes}"/>
+                                <mkdir dir="${temp.dir}" />
+                                <mkdir dir="${classes}" />
 
                                 <javac source="${java.version}" target="${java.version}" debug="on" destdir="${classes}" fork="true" includeantruntime="false">
-                                    <src path="${src}"/>
-                                    <classpath refid="maven.compile.classpath"/>
+                                    <src path="${src}" />
+                                    <classpath refid="maven.compile.classpath" />
                                 </javac>
 
-                                <property name="SSQ.dir" value="${temp.dir}/SimpleStockQuote"/>
-                                <mkdir dir="${SSQ.dir}"/>
+                                <property name="SSQ.dir" value="${temp.dir}/SimpleStockQuote" />
+                                <mkdir dir="${SSQ.dir}" />
 
-                                <mkdir dir="${SSQ.dir}/META-INF"/>
-                                <copy file="${src}/../conf/services.xml" tofile="${SSQ.dir}/META-INF/services.xml"/>
+                                <mkdir dir="${SSQ.dir}/META-INF" />
+                                <copy file="${src}/../conf/services.xml" tofile="${SSQ.dir}/META-INF/services.xml" />
                                 <!--<copy file="${src}/../wsdl/SimpleStockQuoteService.wsdl"-->
-                                <!--tofile="${SSQ.dir}/META-INF/service.wsdl"/>-->
+                                <!--tofile="${SSQ.dir}/META-INF/service.wsdl" />-->
                                 <copy toDir="${SSQ.dir}">
                                     <fileset dir="${classes}">
-                                        <include name="**/*.class"/>
+                                        <include name="**/*.class" />
                                     </fileset>
                                 </copy>
 
                                 <jar destfile="${services}/SimpleStockQuoteService.aar">
-                                    <fileset dir="${SSQ.dir}"/>
+                                    <fileset dir="${SSQ.dir}" />
                                 </jar>
 
-                                <property name="src2" value="../samples/services/SecureStockQuoteService/src"/>
-                                <delete dir="${temp.dir}"/>
-                                <mkdir dir="${temp.dir}"/>
-                                <mkdir dir="${classes}"/>
+                                <property name="src2" value="../samples/services/SecureStockQuoteService/src" />
+                                <delete dir="${temp.dir}" />
+                                <mkdir dir="${temp.dir}" />
+                                <mkdir dir="${classes}" />
                                 <javac source="${java.version}" target="${java.version}" debug="on" destdir="${classes}" fork="true" includeantruntime="false">
-                                    <src path="${src2}"/>
-                                    <classpath refid="maven.compile.classpath"/>
+                                    <src path="${src2}" />
+                                    <classpath refid="maven.compile.classpath" />
                                 </javac>
-                                <property name="SSQ2.dir" value="${temp.dir}/SecureStockQuoteService"/>
-                                <mkdir dir="${SSQ2.dir}"/>
-                                <mkdir dir="${SSQ2.dir}/META-INF"/>
-                                <copy file="${src2}/../conf/services.xml" tofile="${SSQ2.dir}/META-INF/services.xml"/>
+                                <property name="SSQ2.dir" value="${temp.dir}/SecureStockQuoteService" />
+                                <mkdir dir="${SSQ2.dir}" />
+                                <mkdir dir="${SSQ2.dir}/META-INF" />
+                                <copy file="${src2}/../conf/services.xml" tofile="${SSQ2.dir}/META-INF/services.xml" />
                                 <!--<copy file="${src2}/../wsdl/SimpleStockQuoteService.wsdl"-->
-                                <!--tofile="${SSQ2.dir}/META-INF/service.wsdl"/>-->
-                                <copy file="${src2}/../store.jks" tofile="${SSQ2.dir}/store.jks"/>
+                                <!--tofile="${SSQ2.dir}/META-INF/service.wsdl" />-->
+                                <copy file="${src2}/../store.jks" tofile="${SSQ2.dir}/store.jks" />
                                 <copy toDir="${SSQ2.dir}">
                                     <fileset dir="${classes}">
-                                        <include name="**/*.class"/>
+                                        <include name="**/*.class" />
                                     </fileset>
                                 </copy>
                                 <jar destfile="${services}/SecureStockQuoteService.aar">
-                                    <fileset dir="${SSQ2.dir}"/>
+                                    <fileset dir="${SSQ2.dir}" />
                                 </jar>
 
-                                <property name="src3" value="../samples/services/MTOMSwASampleService/src"/>
-                                <delete dir="${temp.dir}"/>
-                                <mkdir dir="${temp.dir}"/>
-                                <mkdir dir="${classes}"/>
+                                <property name="src3" value="../samples/services/MTOMSwASampleService/src" />
+                                <delete dir="${temp.dir}" />
+                                <mkdir dir="${temp.dir}" />
+                                <mkdir dir="${classes}" />
                                 <javac source="${java.version}" target="${java.version}" debug="on" destdir="${classes}" fork="true" includeantruntime="false">
-                                    <src path="${src3}"/>
-                                    <classpath refid="maven.compile.classpath"/>
+                                    <src path="${src3}" />
+                                    <classpath refid="maven.compile.classpath" />
                                 </javac>
-                                <property name="SSQ3.dir" value="${temp.dir}/MTOMSwASampleService"/>
-                                <mkdir dir="${SSQ3.dir}"/>
-                                <mkdir dir="${SSQ3.dir}/META-INF"/>
-                                <copy file="${src3}/../conf/services.xml" tofile="${SSQ3.dir}/META-INF/services.xml"/>
+                                <property name="SSQ3.dir" value="${temp.dir}/MTOMSwASampleService" />
+                                <mkdir dir="${SSQ3.dir}" />
+                                <mkdir dir="${SSQ3.dir}/META-INF" />
+                                <copy file="${src3}/../conf/services.xml" tofile="${SSQ3.dir}/META-INF/services.xml" />
                                 <copy toDir="${SSQ3.dir}">
                                     <fileset dir="${classes}">
-                                        <include name="**/*.class"/>
+                                        <include name="**/*.class" />
                                     </fileset>
                                 </copy>
                                 <jar destfile="${services}/MTOMSwASampleService.aar">
-                                    <fileset dir="${SSQ3.dir}"/>
+                                    <fileset dir="${SSQ3.dir}" />
                                 </jar>
 
-                                <property name="src5" value="../samples/services/LoadbalanceFailoverService/src"/>
-                                <delete dir="${temp.dir}"/>
-                                <mkdir dir="${temp.dir}"/>
-                                <mkdir dir="${classes}"/>
+                                <property name="src5" value="../samples/services/LoadbalanceFailoverService/src" />
+                                <delete dir="${temp.dir}" />
+                                <mkdir dir="${temp.dir}" />
+                                <mkdir dir="${classes}" />
                                 <javac source="${java.version}" target="${java.version}" debug="on" destdir="${classes}" fork="true" includeantruntime="false">
-                                    <src path="${src5}"/>
-                                    <classpath refid="maven.compile.classpath"/>
+                                    <src path="${src5}" />
+                                    <classpath refid="maven.compile.classpath" />
                                 </javac>
 
-                                <property name="LBFA1.dir" value="${temp.dir}/LBService1"/>
-                                <mkdir dir="${LBFA1.dir}"/>
+                                <property name="LBFA1.dir" value="${temp.dir}/LBService1" />
+                                <mkdir dir="${LBFA1.dir}" />
 
-                                <mkdir dir="${LBFA1.dir}/META-INF"/>
-                                <copy file="${src5}/../conf/service1/services.xml" tofile="${LBFA1.dir}/META-INF/services.xml"/>
+                                <mkdir dir="${LBFA1.dir}/META-INF" />
+                                <copy file="${src5}/../conf/service1/services.xml" tofile="${LBFA1.dir}/META-INF/services.xml" />
                                 <copy toDir="${LBFA1.dir}">
                                     <fileset dir="${classes}">
-                                        <include name="**/LBService1.class"/>
+                                        <include name="**/LBService1.class" />
                                     </fileset>
                                 </copy>
 
                                 <jar destfile="${services}/LBService1.aar">
-                                    <fileset dir="${LBFA1.dir}"/>
+                                    <fileset dir="${LBFA1.dir}" />
                                 </jar>
 
-                                <property name="LBFA2.dir" value="${temp.dir}/LBService2"/>
-                                <mkdir dir="${LBFA2.dir}"/>
+                                <property name="LBFA2.dir" value="${temp.dir}/LBService2" />
+                                <mkdir dir="${LBFA2.dir}" />
 
-                                <mkdir dir="${LBFA2.dir}/META-INF"/>
-                                <copy file="${src5}/../conf/service2/services.xml" tofile="${LBFA2.dir}/META-INF/services.xml"/>
+                                <mkdir dir="${LBFA2.dir}/META-INF" />
+                                <copy file="${src5}/../conf/service2/services.xml" tofile="${LBFA2.dir}/META-INF/services.xml" />
                                 <copy toDir="${LBFA2.dir}">
                                     <fileset dir="${classes}">
-                                        <include name="**/LBService2.class"/>
+                                        <include name="**/LBService2.class" />
                                     </fileset>
                                 </copy>
 
                                 <jar destfile="${services}/LBService2.aar">
-                                    <fileset dir="${LBFA2.dir}"/>
+                                    <fileset dir="${LBFA2.dir}" />
                                 </jar>
 
                             </tasks>
@@ -346,12 +343,6 @@
             <groupId>org.apache.rampart</groupId>
             <artifactId>rampart-core</artifactId>
             <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.woden</groupId>
-                    <artifactId>woden-core</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
@@ -394,8 +385,8 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>rhino</groupId>
-            <artifactId>js</artifactId>
+            <groupId>org.mozilla</groupId>
+            <artifactId>rhino</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/AbstractBackEndServerController.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/AbstractBackEndServerController.java
index d190663..e2f85bf 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/AbstractBackEndServerController.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/AbstractBackEndServerController.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.framework;
 
 import org.apache.axiom.om.OMElement;
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/DerbyServerController.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/DerbyServerController.java
index 22ec2a8..1b89a44 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/DerbyServerController.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/DerbyServerController.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.framework;
 
 import org.apache.axiom.om.OMElement;
@@ -111,4 +130,4 @@
             return false;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/EchoHttpServerController.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/EchoHttpServerController.java
index d958cb8..b20c971 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/EchoHttpServerController.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/EchoHttpServerController.java
@@ -25,6 +25,7 @@
 import org.apache.http.*;
 import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.DefaultBHttpServerConnection;
 import org.apache.http.impl.DefaultBHttpServerConnectionFactory;
 import org.apache.http.protocol.*;
@@ -38,22 +39,29 @@
 import java.net.Socket;
 import java.util.concurrent.atomic.AtomicInteger;
 
+/**
+ * A simple HTTP server implementation which is capable of echoing back the body
+ * or the headers of an HTTP request.
+ */
 public class EchoHttpServerController extends AbstractBackEndServerController {
 
     private static final Log log = LogFactory.getLog(EchoHttpServerController.class);
 
-    private int port;
+    private final int port;
+    private final boolean echoHeaders;
     private RequestListenerThread requestListener;
 
     public EchoHttpServerController(OMElement element) {
         super(element);
         port = Integer.parseInt(SynapseTestUtils.getParameter(element,
-                SampleConfigConstants.TAG_BE_SERVER_CONF_AXIS2_HTTP_PORT, "9000"));
+                SampleConfigConstants.TAG_BE_SERVER_CONF_ECHO_HTTP_PORT, "9000"));
+        echoHeaders = Boolean.parseBoolean(SynapseTestUtils.getParameter(element,
+                SampleConfigConstants.TAG_BE_SERVER_CONF_ECHO_HEADERS, "false"));
     }
 
     public boolean startProcess() {
         try {
-            requestListener = new RequestListenerThread(port);
+            requestListener = new RequestListenerThread(port, echoHeaders);
             requestListener.start();
             return true;
         } catch (IOException e) {
@@ -70,23 +78,39 @@
 
     static class EchoHttpHandler implements HttpRequestHandler {
 
+        private final boolean echoHeaders;
+
+        EchoHttpHandler(boolean echoHeaders) {
+            this.echoHeaders = echoHeaders;
+        }
+
         public void handle(HttpRequest request, HttpResponse response,
                            HttpContext context) throws HttpException, IOException {
 
             if (log.isDebugEnabled()) {
                 log.debug(request.getRequestLine().toString());
             }
-            if (request instanceof HttpEntityEnclosingRequest) {
-                HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
-                byte[] entityContent = EntityUtils.toByteArray(entity);
-                if (log.isDebugEnabled()) {
-                	log.debug("Request entity read; size=" + entityContent.length);
+
+            if (echoHeaders) {
+                StringBuilder body = new StringBuilder();
+                for (Header header : request.getAllHeaders()) {
+                    body.append(header.getName()).append(": ").append(header.getValue()).append("\n");
                 }
                 response.setStatusCode(HttpStatus.SC_OK);
-                response.setEntity(new ByteArrayEntity(entityContent,
-                        ContentType.create(entity.getContentType().getValue())));
+                response.setEntity(new StringEntity(body.toString(), ContentType.TEXT_PLAIN));
             } else {
-                response.setStatusCode(HttpStatus.SC_NO_CONTENT);
+                if (request instanceof HttpEntityEnclosingRequest) {
+                    HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
+                    byte[] entityContent = EntityUtils.toByteArray(entity);
+                    if (log.isDebugEnabled()) {
+                        log.debug("Request entity read; size=" + entityContent.length);
+                    }
+                    response.setStatusCode(HttpStatus.SC_OK);
+                    response.setEntity(new ByteArrayEntity(entityContent,
+                            ContentType.create(entity.getContentType().getValue())));
+                } else {
+                    response.setStatusCode(HttpStatus.SC_NO_CONTENT);
+                }
             }
         }
     }
@@ -97,7 +121,7 @@
         private final ServerSocket serversocket;
         private final HttpService httpService;
 
-        public RequestListenerThread(final int port) throws IOException {
+        public RequestListenerThread(final int port, final boolean echoHeaders) throws IOException {
             this.connFactory = DefaultBHttpServerConnectionFactory.INSTANCE;
             this.serversocket = new ServerSocket();
             this.serversocket.setReuseAddress(true);
@@ -112,7 +136,7 @@
 
             // Set up request handlers
             UriHttpRequestHandlerMapper registry = new UriHttpRequestHandlerMapper();
-            registry.register("*", new EchoHttpHandler());
+            registry.register("*", new EchoHttpHandler(echoHeaders));
 
             // Set up the HTTP service
             this.httpService = new HttpService(httpProcessor, registry);
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/MessageCounter.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/MessageCounter.java
index 146a9e9..b0a73dd 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/MessageCounter.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/MessageCounter.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.synapse.samples.framework;
 
 import org.apache.axis2.AxisFault;
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java
index 37dde8b..18b4417 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java
@@ -25,6 +25,7 @@
 import org.apache.synapse.samples.framework.tests.rest.Sample10002;
 import org.apache.synapse.samples.framework.tests.rest.Sample10003;
 import org.apache.synapse.samples.framework.tests.tasks.*;
+import org.apache.synapse.samples.framework.tests.transport.Sample10101;
 import org.apache.synapse.samples.framework.tests.transport.Sample250;
 import org.apache.synapse.samples.framework.tests.advanced.*;
 import org.apache.synapse.samples.framework.tests.endpoint.*;
@@ -206,6 +207,8 @@
         sampleClassRepo.put("155", Sample155.class);
         sampleClassRepo.put("156", Sample156.class);
         sampleClassRepo.put("157", Sample157.class);
+        sampleClassRepo.put("160", Sample160.class);
+        sampleClassRepo.put("161", Sample161.class);
 
         //Transport switching
         sampleClassRepo.put("250", Sample250.class);
@@ -246,5 +249,7 @@
         sampleClassRepo.put("10001", Sample10001.class);
         sampleClassRepo.put("10002", Sample10002.class);
         sampleClassRepo.put("10003", Sample10003.class);
+
+        sampleClassRepo.put("10101", Sample10101.class);
     }
-}
\ No newline at end of file
+}
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/HttpResponse.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/HttpResponse.java
index 224fff6..3e8e8d0 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/HttpResponse.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/HttpResponse.java
@@ -29,8 +29,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 public class HttpResponse {
 
@@ -80,4 +79,21 @@
     public String getBodyAsString() {
         return new String(this.body);
     }
+
+    public Map<String,List<String>> getBodyAsMap() {
+        String body = getBodyAsString();
+        Map<String,List<String>> map = new HashMap<String,List<String>>();
+        for (String line : body.split("\n")) {
+            int index = line.indexOf(':');
+            String key = line.substring(0, index).trim();
+            String value = line.substring(index + 1).trim();
+            List<String> values = map.get(key);
+            if (values == null) {
+                values = new ArrayList<String>();
+                map.put(key, values);
+            }
+            values.add(value);
+        }
+        return map;
+    }
 }
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteCallback.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteCallback.java
index 4733d45..57c32e0 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteCallback.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteCallback.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.framework.clients;
 
 import org.apache.axiom.om.OMElement;
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/config/SampleConfigConstants.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/config/SampleConfigConstants.java
index 8e9d864..08708f7 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/config/SampleConfigConstants.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/config/SampleConfigConstants.java
@@ -48,7 +48,8 @@
     public static final String TAG_BE_SERVER_CONF_AXIS2_HTTPS_PORT = "httpsPort";
     public static final String TAG_BE_SERVER_CONF_AXIS2_COUNTER_ENABLED = "counterEnabled";
 
-    public static final String TAG_BE_SERVER_CONF_ECHO_HTTP_PORT = "port";
+    public static final String TAG_BE_SERVER_CONF_ECHO_HTTP_PORT = "httpPort";
+    public static final String TAG_BE_SERVER_CONF_ECHO_HEADERS = "echoHeaders";
 
     public static final String TAG_BE_SERVER_CONF_DERBY_PORT = "dbPort";
 
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/proxy/Sample160.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/proxy/Sample160.java
new file mode 100644
index 0000000..02e1d9b
--- /dev/null
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/proxy/Sample160.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.synapse.samples.framework.tests.proxy;
+
+import org.apache.http.HttpHeaders;
+import org.apache.http.HttpStatus;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.BasicHttpClient;
+import org.apache.synapse.samples.framework.clients.HttpResponse;
+
+public class Sample160 extends SynapseTestCase {
+
+    private String requestXml;
+    private BasicHttpClient httpClient;
+
+    public Sample160() {
+        super(160);
+        httpClient = new BasicHttpClient();
+        requestXml = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:ser=\"http://services.samples\" xmlns:xsd=\"http://services.samples/xsd\">\n" +
+                "       <soap:Header/>\n" +
+                "       <soap:Body>\n" +
+                "          <ser:getQuote>\n" +
+                "             <ser:request>\n" +
+                "                <xsd:symbol>IBM</xsd:symbol>\n" +
+                "             </ser:request>\n" +
+                "          </ser:getQuote>\n" +
+                "       </soap:Body>\n" +
+                "    </soap:Envelope>";
+    }
+
+    public void testDisableChunkingWithBasicProxy() throws Exception {
+        String url = "http://localhost:8280/services/StockQuoteProxy";
+        HttpResponse response = httpClient.doPost(url, requestXml.getBytes(),
+                "application/soap+xml;charset=UTF-8");
+        assertEquals(HttpStatus.SC_OK, response.getStatus());
+        assertFalse(HttpHeaders.TRANSFER_ENCODING + " is present in the header",
+                response.getHeaders().containsKey(HttpHeaders.TRANSFER_ENCODING));
+        assertTrue(HttpHeaders.CONTENT_LENGTH + " is missing in the header",
+                response.getHeaders().containsKey(HttpHeaders.CONTENT_LENGTH));
+
+    }
+
+}
\ No newline at end of file
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/proxy/Sample161.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/proxy/Sample161.java
new file mode 100644
index 0000000..f987756
--- /dev/null
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/proxy/Sample161.java
@@ -0,0 +1,44 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.samples.framework.tests.proxy;
+
+import org.apache.http.HttpStatus;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.BasicHttpClient;
+import org.apache.synapse.samples.framework.clients.HttpResponse;
+
+public class Sample161 extends SynapseTestCase {
+
+    private static final String requestXml = "<test>foo</test>";
+
+    public Sample161() {
+        super(161);
+    }
+
+    public void testRespondMediator() throws Exception {
+        String url = "http://localhost:8280/services/EchoService";
+        BasicHttpClient client = new BasicHttpClient();
+        HttpResponse response = client.doPost(url, requestXml.getBytes(), "application/xml");
+        assertEquals(HttpStatus.SC_OK, response.getStatus());
+        assertEquals("Request and Echo Service Response is not equal", requestXml, response.getBodyAsString());
+
+    }
+
+}
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/rest/Sample10001.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/rest/Sample10001.java
index 0abe3c2..0f24d59 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/rest/Sample10001.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/rest/Sample10001.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.framework.tests.rest;
 
 import org.apache.axiom.om.OMElement;
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/tasks/Sample300.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/tasks/Sample300.java
index cde135b..c24f03e 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/tasks/Sample300.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/tasks/Sample300.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.framework.tests.tasks;
 
 import org.apache.synapse.samples.framework.SynapseTestCase;
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample10101.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample10101.java
new file mode 100644
index 0000000..0c4f221
--- /dev/null
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample10101.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.synapse.samples.framework.tests.transport;
+
+import org.apache.http.HttpHeaders;
+import org.apache.http.HttpStatus;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.BasicHttpClient;
+import org.apache.synapse.samples.framework.clients.HttpResponse;
+
+import java.util.List;
+import java.util.Map;
+
+public class Sample10101 extends SynapseTestCase {
+
+    public static final byte[] TEST_PAYLOAD = "<test>foo</test>".getBytes();
+
+    public Sample10101() {
+        super(10101);
+    }
+
+    public void testChunking() throws Exception {
+        BasicHttpClient client = new BasicHttpClient();
+        HttpResponse response = client.doPost("http://127.0.0.1:8280/test/chunked",
+                TEST_PAYLOAD, "application/xml");
+        assertEquals(HttpStatus.SC_OK, response.getStatus());
+        Map<String,List<String>> headers = response.getBodyAsMap();
+        assertTrue(headers.containsKey(HttpHeaders.TRANSFER_ENCODING));
+        assertFalse(headers.containsKey(HttpHeaders.CONTENT_LENGTH));
+        assertEquals("chunked", headers.get(HttpHeaders.TRANSFER_ENCODING).get(0));
+    }
+
+    public void testDisableChunking() throws Exception {
+        BasicHttpClient client = new BasicHttpClient();
+        HttpResponse response = client.doPost("http://127.0.0.1:8280/test/content_length",
+                TEST_PAYLOAD, "application/xml");
+        assertEquals(HttpStatus.SC_OK, response.getStatus());
+        Map<String,List<String>> headers = response.getBodyAsMap();
+        assertFalse(headers.containsKey(HttpHeaders.TRANSFER_ENCODING));
+        assertTrue(headers.containsKey(HttpHeaders.CONTENT_LENGTH));
+        assertEquals(TEST_PAYLOAD.length, Integer.parseInt(headers.get(
+                HttpHeaders.CONTENT_LENGTH).get(0)));
+    }
+
+}
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample250.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample250.java
index 3cf54c5..e4d4bc3 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample250.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample250.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.framework.tests.transport;
 
 import org.apache.synapse.samples.framework.Axis2BackEndServerController;
@@ -11,6 +30,7 @@
     }
 
     public void testPlaceOrder() throws Exception {
+        System.setProperty("java.naming.provider.url", "tcp://localhost:62626");
         Axis2BackEndServerController axis2Server = getAxis2Server();
         if (axis2Server == null) {
             fail("Failed to load the Axis2BackEndServerController");
diff --git a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample251.java b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample251.java
index d391319..1b24437 100644
--- a/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample251.java
+++ b/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/transport/Sample251.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.framework.tests.transport;
 
 import org.apache.synapse.samples.framework.*;
diff --git a/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml b/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml
index 2325202..59e2f4e 100644
--- a/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml
+++ b/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml
@@ -227,9 +227,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender-->
 
     <!-- ================================================= -->
diff --git a/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_jms.xml b/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_jms.xml
index 6c92c6a..e054233 100644
--- a/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_jms.xml
+++ b/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_jms.xml
@@ -226,9 +226,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender-->
 
     <!-- ================================================= -->
diff --git a/java/modules/integration/src/test/resources/axis2Xml/axis2Server/axis2_jms.xml b/java/modules/integration/src/test/resources/axis2Xml/axis2Server/axis2_jms.xml
index 6aeb34b..b2e3fb2 100644
--- a/java/modules/integration/src/test/resources/axis2Xml/axis2Server/axis2_jms.xml
+++ b/java/modules/integration/src/test/resources/axis2Xml/axis2Server/axis2_jms.xml
@@ -170,21 +170,21 @@
     <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
         <parameter name="myTopicConnectionFactory">
         	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:62626</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
 		<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
         </parameter>
 
         <parameter name="myQueueConnectionFactory">
         	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:62626</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
 		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
         </parameter>
 
         <parameter name="default">
         	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:62626</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
 		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
         </parameter>
diff --git a/java/modules/integration/src/test/resources/axis2Xml/synapse/axis2_jms.xml b/java/modules/integration/src/test/resources/axis2Xml/synapse/axis2_jms.xml
index 739dada..40c339f 100644
--- a/java/modules/integration/src/test/resources/axis2Xml/synapse/axis2_jms.xml
+++ b/java/modules/integration/src/test/resources/axis2Xml/synapse/axis2_jms.xml
@@ -200,21 +200,21 @@
     <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
         <parameter name="myTopicConnectionFactory">
         	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:62626</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
 		<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
         </parameter>
 
         <parameter name="myQueueConnectionFactory">
         	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:62626</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
 		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
         </parameter>
 
         <parameter name="default">
         	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:62626</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
 		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
         </parameter>
@@ -307,9 +307,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender>-->
 
     <!--Uncomment this for FIX transport support
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_10001.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_10001.xml
index 8d63d52..214a88d 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_10001.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_10001.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <definitions xmlns="http://ws.apache.org/ns/synapse">
     <api name="StockQuoteAPI" context="/stockquote">
         <resource uri-template="/view/{symbol}" methods="GET">
@@ -38,4 +58,4 @@
             </inSequence>
         </resource>
     </api>
-</definitions>
\ No newline at end of file
+</definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_10002.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_10002.xml
index c2f8a7c..5797a3d 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_10002.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_10002.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
     <syn:proxy name="DirectMediationProxy">
         <syn:target>
@@ -110,4 +130,4 @@
             </xsl:template>
         </xsl:stylesheet>
     </syn:localEntry>
-</syn:definitions>
\ No newline at end of file
+</syn:definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_10003.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_10003.xml
index 3812e5e..b0d6985 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_10003.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_10003.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
     <syn:api name="TestAPI" context="/test">
         <syn:resource methods="OPTIONS">
@@ -13,4 +33,4 @@
             </syn:outSequence>
         </syn:resource>
     </syn:api>
-</syn:definitions>
\ No newline at end of file
+</syn:definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_10101.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_10101.xml
new file mode 100644
index 0000000..c76864f
--- /dev/null
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_10101.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
+    <syn:api name="TestAPI" context="/test">
+        <syn:resource methods="POST" url-mapping="/content_length">
+            <syn:inSequence>
+                <syn:property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
+                <syn:send>
+                    <syn:endpoint>
+                        <syn:address uri="http://localhost:9000/services/EchoService"/>
+                    </syn:endpoint>
+                </syn:send>
+            </syn:inSequence>
+            <syn:outSequence>
+                <syn:send/>
+            </syn:outSequence>
+        </syn:resource>
+        <syn:resource methods="POST" url-mapping="/chunked">
+            <syn:inSequence>
+                <syn:send>
+                    <syn:endpoint>
+                        <syn:address uri="http://localhost:9000/services/EchoService"/>
+                    </syn:endpoint>
+                </syn:send>
+            </syn:inSequence>
+            <syn:outSequence>
+                <syn:send/>
+            </syn:outSequence>
+        </syn:resource>
+    </syn:api>
+</syn:definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_160.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_160.xml
new file mode 100644
index 0000000..2e77861
--- /dev/null
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_160.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!-- DISABLE_CHUNKING in response path proxy services -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+    <proxy name="StockQuoteProxy">
+        <target>
+            <endpoint>
+                <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+            </endpoint>
+            <outSequence>
+                <property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
+                <send/>
+            </outSequence>
+        </target>
+        <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+    </proxy>
+</definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml
new file mode 100644
index 0000000..4ed1035
--- /dev/null
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!-- Respond Mediator with proxy services -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+    <proxy name="EchoService">
+        <target>
+            <inSequence>
+                <respond/>
+            </inSequence>
+        </target>
+    </proxy>
+</definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_251.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_251.xml
new file mode 100644
index 0000000..95bb084
--- /dev/null
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_251.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!-- Switching from http/s to JMS -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+
+    <proxy name="StockQuoteProxy" transports="http">
+        <target>
+            <endpoint>
+                <address
+                        uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:62626&amp;transport.jms.DestinationType=queue"/>
+            </endpoint>
+            <inSequence>
+                <property action="set" name="OUT_ONLY" value="true"/>
+            </inSequence>
+            <outSequence>
+                <send/>
+            </outSequence>
+        </target>
+        <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+    </proxy>
+
+</definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_430_altered.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_430_altered.xml
index e953dd3..9d51aae 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_430_altered.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_430_altered.xml
@@ -32,10 +32,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+        <respond/>
     </sequence>
 
 </definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_431_altered.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_431_altered.xml
index 586e8dd..27d83fd 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_431_altered.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_431_altered.xml
@@ -35,10 +35,7 @@
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
             <enableSec policy="sec_policy"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+        <respond/>
     </sequence>
 
 </definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_432_altered.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_432_altered.xml
index 1f91940..1db2674 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_432_altered.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_432_altered.xml
@@ -36,10 +36,7 @@
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
             <enableSec outboundPolicy="sec_policy_outbound" inboundPolicy="sec_policy_inbound"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+        <respond/>
     </sequence>
 
 </definitions>
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_433_altered.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_433_altered.xml
index 2317e54..985c494 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_433_altered.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_433_altered.xml
@@ -32,10 +32,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+        <respond/>
     </sequence>
 
     <endpoint name="StockQuoteServiceEndpoint">
diff --git a/java/modules/integration/src/test/resources/extras/synapse_sample_434_altered.xml b/java/modules/integration/src/test/resources/extras/synapse_sample_434_altered.xml
index 5da4b54..c4ebc80 100644
--- a/java/modules/integration/src/test/resources/extras/synapse_sample_434_altered.xml
+++ b/java/modules/integration/src/test/resources/extras/synapse_sample_434_altered.xml
@@ -34,10 +34,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+        <respond/>
     </sequence>
 
 </definitions>
diff --git a/java/modules/integration/src/test/resources/identity.jks b/java/modules/integration/src/test/resources/identity.jks
index 025f25e..e7e6514 100644
--- a/java/modules/integration/src/test/resources/identity.jks
+++ b/java/modules/integration/src/test/resources/identity.jks
Binary files differ
diff --git a/java/modules/integration/src/test/resources/nhttp.properties b/java/modules/integration/src/test/resources/nhttp.properties
index 5a98af4..3a0f74a 100644
--- a/java/modules/integration/src/test/resources/nhttp.properties
+++ b/java/modules/integration/src/test/resources/nhttp.properties
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 http.socket.timeout=60000
 http.connection.timeout=0
 http.socket.buffer-size=8096
@@ -5,4 +22,4 @@
 http.nio.interest-ops-queueing=false
 
 # This property is crucial for automated tests
-http.socket.reuseaddr=true
\ No newline at end of file
+http.socket.reuseaddr=true
diff --git a/java/modules/integration/src/test/resources/passthru-http.properties b/java/modules/integration/src/test/resources/passthru-http.properties
index b2d30d1..8a11778 100644
--- a/java/modules/integration/src/test/resources/passthru-http.properties
+++ b/java/modules/integration/src/test/resources/passthru-http.properties
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 http.socket.timeout=60000
 http.connection.timeout=0
 http.socket.buffer-size=8192
@@ -5,4 +22,4 @@
 http.nio.interest-ops-queueing=false
 
 # This property is crucial for automated tests
-http.socket.reuseaddr=true
\ No newline at end of file
+http.socket.reuseaddr=true
diff --git a/java/modules/integration/src/test/resources/sample0.xml b/java/modules/integration/src/test/resources/sample0.xml
index 96585b0..1b506b7 100644
--- a/java/modules/integration/src/test/resources/sample0.xml
+++ b/java/modules/integration/src/test/resources/sample0.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>0</sampleID>
     <sampleName>Introduction to Synapse</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample1.xml b/java/modules/integration/src/test/resources/sample1.xml
index 18be136..863552c 100644
--- a/java/modules/integration/src/test/resources/sample1.xml
+++ b/java/modules/integration/src/test/resources/sample1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>1</sampleID>
     <sampleName>Simple content based routing (CBR) of messages</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample10.xml b/java/modules/integration/src/test/resources/sample10.xml
index dfec1f7..6e02801 100644
--- a/java/modules/integration/src/test/resources/sample10.xml
+++ b/java/modules/integration/src/test/resources/sample10.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>10</sampleID>
     <sampleName>Introduction to dynamic endpoints with the Registry</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample100.xml b/java/modules/integration/src/test/resources/sample100.xml
index 9a7fcfe..475d5c7 100644
--- a/java/modules/integration/src/test/resources/sample100.xml
+++ b/java/modules/integration/src/test/resources/sample100.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>100</sampleID>
     <sampleName>Using WS-Security for outgoing messages</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample10001.xml b/java/modules/integration/src/test/resources/sample10001.xml
index 1161056..30a6a4d 100644
--- a/java/modules/integration/src/test/resources/sample10001.xml
+++ b/java/modules/integration/src/test/resources/sample10001.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>10001</sampleID>
     <sampleName>Mediating SOAP Faults Through APIs</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample10002.xml b/java/modules/integration/src/test/resources/sample10002.xml
index 2e45f94..310b24d 100644
--- a/java/modules/integration/src/test/resources/sample10002.xml
+++ b/java/modules/integration/src/test/resources/sample10002.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>10002</sampleID>
     <sampleName>Pass Through Transport and Deferred Building Sanity Checks</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample10003.xml b/java/modules/integration/src/test/resources/sample10003.xml
index 633b25b..39e964d 100644
--- a/java/modules/integration/src/test/resources/sample10003.xml
+++ b/java/modules/integration/src/test/resources/sample10003.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>10003</sampleID>
     <sampleName>Pass Through Transport OPTIONS Method Support</sampleName>
@@ -15,4 +35,4 @@
     <clientConfig>
         <clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
     </clientConfig>
-</synapseSample>
\ No newline at end of file
+</synapseSample>
diff --git a/java/modules/integration/src/test/resources/sample101.xml b/java/modules/integration/src/test/resources/sample101.xml
index 5e8741e..ddab8ce 100644
--- a/java/modules/integration/src/test/resources/sample101.xml
+++ b/java/modules/integration/src/test/resources/sample101.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>101</sampleID>
     <sampleName>Reliable message exchange between Synapse and the back-end server using WS-ReliableMessaging</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample10101.xml b/java/modules/integration/src/test/resources/sample10101.xml
new file mode 100644
index 0000000..053102e
--- /dev/null
+++ b/java/modules/integration/src/test/resources/sample10101.xml
@@ -0,0 +1,38 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<synapseSample>
+    <sampleID>10101</sampleID>
+    <sampleName>Pass Through Transport Chunked Encoding Support</sampleName>
+    <synapseConfig>
+        <axis2Repo>modules/integration/target/test_repos/synapse</axis2Repo>
+        <axis2Xml>modules/integration/target/test_repos/synapse/conf/axis2_def.xml</axis2Xml>
+        <synapseXml>modules/integration/src/test/resources/extras/synapse_sample_10101.xml</synapseXml>
+    </synapseConfig>
+    <backEndServerConfig>
+        <echoServer id="0">
+            <httpPort>9000</httpPort>
+            <echoHeaders>true</echoHeaders>
+        </echoServer>
+    </backEndServerConfig>
+    <clientConfig>
+        <clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
+    </clientConfig>
+</synapseSample>
diff --git a/java/modules/integration/src/test/resources/sample11.xml b/java/modules/integration/src/test/resources/sample11.xml
index 751b386..d9c681d 100644
--- a/java/modules/integration/src/test/resources/sample11.xml
+++ b/java/modules/integration/src/test/resources/sample11.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>11</sampleID>
     <sampleName>A full registry based configuration, and sharing a configuration between multiple instances</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample12.xml b/java/modules/integration/src/test/resources/sample12.xml
index 187a4b5..63d0b32 100644
--- a/java/modules/integration/src/test/resources/sample12.xml
+++ b/java/modules/integration/src/test/resources/sample12.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>12</sampleID>
     <sampleName>One way messaging / fireAndForget through Synapse</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample13.xml b/java/modules/integration/src/test/resources/sample13.xml
index 96c5317..db87648 100644
--- a/java/modules/integration/src/test/resources/sample13.xml
+++ b/java/modules/integration/src/test/resources/sample13.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>13</sampleID>
     <sampleName>Dual channel invocation through Synapse</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample15.xml b/java/modules/integration/src/test/resources/sample15.xml
index fea8151..d057e08 100644
--- a/java/modules/integration/src/test/resources/sample15.xml
+++ b/java/modules/integration/src/test/resources/sample15.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>15</sampleID>
     <sampleName>Message Enrichment through Synapse</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample150.xml b/java/modules/integration/src/test/resources/sample150.xml
index ea52e34..4d632fc 100644
--- a/java/modules/integration/src/test/resources/sample150.xml
+++ b/java/modules/integration/src/test/resources/sample150.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>150</sampleID>
     <sampleName>Introduction to proxy services</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample151.xml b/java/modules/integration/src/test/resources/sample151.xml
index 49a4076..cffa37a 100644
--- a/java/modules/integration/src/test/resources/sample151.xml
+++ b/java/modules/integration/src/test/resources/sample151.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>151</sampleID>
     <sampleName>Custom sequences and endpoints with proxy services</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample152.xml b/java/modules/integration/src/test/resources/sample152.xml
index bcb9f8d..8d12fd5 100644
--- a/java/modules/integration/src/test/resources/sample152.xml
+++ b/java/modules/integration/src/test/resources/sample152.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>152</sampleID>
     <sampleName>Switching transports and message format from SOAP to REST/POX</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample153.xml b/java/modules/integration/src/test/resources/sample153.xml
index fda3042..1628107 100644
--- a/java/modules/integration/src/test/resources/sample153.xml
+++ b/java/modules/integration/src/test/resources/sample153.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>153</sampleID>
     <sampleName>Routing the messages arrived to a proxy service without processing the security headers</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample154.xml b/java/modules/integration/src/test/resources/sample154.xml
index 397158b..37ab7de 100644
--- a/java/modules/integration/src/test/resources/sample154.xml
+++ b/java/modules/integration/src/test/resources/sample154.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>154</sampleID>
     <sampleName>Load Balancing with Proxy Services</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample155.xml b/java/modules/integration/src/test/resources/sample155.xml
index 67a336d..ccd5bb4 100644
--- a/java/modules/integration/src/test/resources/sample155.xml
+++ b/java/modules/integration/src/test/resources/sample155.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>155</sampleID>
     <sampleName>Dual channel invocation on both client side and serverside of Synapse with Proxy Services</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample156.xml b/java/modules/integration/src/test/resources/sample156.xml
index 5035057..c4a42d3 100644
--- a/java/modules/integration/src/test/resources/sample156.xml
+++ b/java/modules/integration/src/test/resources/sample156.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>156</sampleID>
     <sampleName>Service Integration with specifying the receiving sequence</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample157.xml b/java/modules/integration/src/test/resources/sample157.xml
index 405a457..dbf6bd1 100644
--- a/java/modules/integration/src/test/resources/sample157.xml
+++ b/java/modules/integration/src/test/resources/sample157.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>157</sampleID>
     <sampleName>Conditional Router for Routing Messages based on HTTP URL, HTTP Headers and Query Parameters</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample16.xml b/java/modules/integration/src/test/resources/sample16.xml
index 050ab44..9f2c905 100644
--- a/java/modules/integration/src/test/resources/sample16.xml
+++ b/java/modules/integration/src/test/resources/sample16.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>16</sampleID>
     <sampleName>Introduction to dynamic and static keys</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample160.xml b/java/modules/integration/src/test/resources/sample160.xml
new file mode 100644
index 0000000..0103365
--- /dev/null
+++ b/java/modules/integration/src/test/resources/sample160.xml
@@ -0,0 +1,38 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<synapseSample>
+    <sampleID>160</sampleID>
+    <sampleName>DISABLE_CHUNKING in response path proxy services</sampleName>
+    <synapseConfig>
+        <axis2Repo>modules/integration/target/test_repos/synapse</axis2Repo>
+        <axis2Xml>modules/integration/target/test_repos/synapse/conf/axis2_def.xml</axis2Xml>
+        <synapseXml>modules/integration/src/test/resources/extras/synapse_sample_160.xml</synapseXml>
+    </synapseConfig>
+    <backEndServerConfig>
+        <axis2Server id='0'>
+            <axis2Repo>modules/integration/target/test_repos/axis2Server</axis2Repo>
+            <axis2Xml>modules/integration/target/test_repos/axis2Server/conf/axis2_def.xml</axis2Xml>
+        </axis2Server>
+    </backEndServerConfig>
+    <clientConfig>
+	    <clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
+    </clientConfig>
+</synapseSample>
diff --git a/java/modules/integration/src/test/resources/sample161.xml b/java/modules/integration/src/test/resources/sample161.xml
new file mode 100644
index 0000000..c130a0b
--- /dev/null
+++ b/java/modules/integration/src/test/resources/sample161.xml
@@ -0,0 +1,38 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<synapseSample>
+    <sampleID>161</sampleID>
+    <sampleName>Proxy with respond mediator</sampleName>
+    <synapseConfig>
+        <axis2Repo>modules/integration/target/test_repos/synapse</axis2Repo>
+        <axis2Xml>modules/integration/target/test_repos/synapse/conf/axis2_def.xml</axis2Xml>
+        <synapseXml>modules/integration/src/test/resources/extras/synapse_sample_161.xml</synapseXml>
+    </synapseConfig>
+    <backEndServerConfig>
+        <axis2Server id='0'>
+            <axis2Repo>modules/integration/target/test_repos/axis2Server</axis2Repo>
+            <axis2Xml>modules/integration/target/test_repos/axis2Server/conf/axis2_def.xml</axis2Xml>
+        </axis2Server>
+    </backEndServerConfig>
+    <clientConfig>
+	<clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
+    </clientConfig>
+</synapseSample>
diff --git a/java/modules/integration/src/test/resources/sample2.xml b/java/modules/integration/src/test/resources/sample2.xml
index 96e3d54..f26ac8e 100644
--- a/java/modules/integration/src/test/resources/sample2.xml
+++ b/java/modules/integration/src/test/resources/sample2.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>2</sampleID>
     <sampleName>CBR with the Switch-case mediator, using message properties</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample250.xml b/java/modules/integration/src/test/resources/sample250.xml
index 4bee179..1485b54 100644
--- a/java/modules/integration/src/test/resources/sample250.xml
+++ b/java/modules/integration/src/test/resources/sample250.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>250</sampleID>
     <sampleName>JMS to HTTP</sampleName>
@@ -9,7 +29,7 @@
     </synapseConfig>
     <backEndServerConfig>
         <jmsBroker id='0'>
-            <providerURL>tcp://localhost:61616</providerURL>
+            <providerURL>tcp://localhost:62626</providerURL>
             <initialNamingFactory>org.apache.activemq.jndi.ActiveMQInitialContextFactory</initialNamingFactory>
         </jmsBroker>
         <axis2Server id='1'>
diff --git a/java/modules/integration/src/test/resources/sample251.xml b/java/modules/integration/src/test/resources/sample251.xml
index 1e5fa89..b8a96fc 100644
--- a/java/modules/integration/src/test/resources/sample251.xml
+++ b/java/modules/integration/src/test/resources/sample251.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>251</sampleID>
     <sampleName>HTTP to JMS</sampleName>
@@ -5,11 +25,11 @@
         <!--if we don't specify the optional values, framework will use defaults-->
         <axis2Repo>modules/integration/target/test_repos/synapse</axis2Repo>
         <axis2Xml>modules/integration/target/test_repos/synapse/conf/axis2_jms.xml</axis2Xml>
-        <synapseXml>repository/conf/sample/synapse_sample_251.xml</synapseXml>
+        <synapseXml>modules/integration/src/test/resources/extras/synapse_sample_251.xml</synapseXml>
     </synapseConfig>
     <backEndServerConfig>
         <jmsBroker id='0'>
-            <providerURL>tcp://localhost:61616</providerURL>
+            <providerURL>tcp://localhost:62626</providerURL>
             <initialNamingFactory>org.apache.activemq.jndi.ActiveMQInitialContextFactory</initialNamingFactory>
         </jmsBroker>
         <axis2Server id='1'>
diff --git a/java/modules/integration/src/test/resources/sample3.xml b/java/modules/integration/src/test/resources/sample3.xml
index 092eac7..e922e40 100644
--- a/java/modules/integration/src/test/resources/sample3.xml
+++ b/java/modules/integration/src/test/resources/sample3.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>3</sampleID>
     <sampleName>Local Registry entry definitions, reusable endpoints and sequences</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample300.xml b/java/modules/integration/src/test/resources/sample300.xml
index 453e8d0..8a338e5 100644
--- a/java/modules/integration/src/test/resources/sample300.xml
+++ b/java/modules/integration/src/test/resources/sample300.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>300</sampleID>
     <sampleName>Introduction to Synapse Tasks</sampleName>
@@ -17,4 +37,4 @@
     <clientConfig>
         <clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
     </clientConfig>
-</synapseSample>
\ No newline at end of file
+</synapseSample>
diff --git a/java/modules/integration/src/test/resources/sample301.xml b/java/modules/integration/src/test/resources/sample301.xml
index 7667bc4..2fd12b1 100644
--- a/java/modules/integration/src/test/resources/sample301.xml
+++ b/java/modules/integration/src/test/resources/sample301.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>301</sampleID>
     <sampleName>Task injecting to a named sequence</sampleName>
@@ -17,4 +37,4 @@
     <clientConfig>
         <clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
     </clientConfig>
-</synapseSample>
\ No newline at end of file
+</synapseSample>
diff --git a/java/modules/integration/src/test/resources/sample302.xml b/java/modules/integration/src/test/resources/sample302.xml
index f7907a5..2e1303c 100644
--- a/java/modules/integration/src/test/resources/sample302.xml
+++ b/java/modules/integration/src/test/resources/sample302.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>302</sampleID>
     <sampleName>Task injecting to a Proxy service</sampleName>
@@ -17,4 +37,4 @@
     <clientConfig>
         <clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
     </clientConfig>
-</synapseSample>
\ No newline at end of file
+</synapseSample>
diff --git a/java/modules/integration/src/test/resources/sample350.xml b/java/modules/integration/src/test/resources/sample350.xml
index 72febab..799dd11 100644
--- a/java/modules/integration/src/test/resources/sample350.xml
+++ b/java/modules/integration/src/test/resources/sample350.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>350</sampleID>
     <sampleName>Introduction to the script mediator using js scripts</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample351.xml b/java/modules/integration/src/test/resources/sample351.xml
index e262be6..b2e01ca 100644
--- a/java/modules/integration/src/test/resources/sample351.xml
+++ b/java/modules/integration/src/test/resources/sample351.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>351</sampleID>
     <sampleName>In-line script mediation with JavaScript</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample352.xml b/java/modules/integration/src/test/resources/sample352.xml
index c0bcdc5..20b680c 100644
--- a/java/modules/integration/src/test/resources/sample352.xml
+++ b/java/modules/integration/src/test/resources/sample352.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>352</sampleID>
     <sampleName>Accessing Synapse message context API methods using scripting language</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample353.xml b/java/modules/integration/src/test/resources/sample353.xml
index aec1262..59a9704 100644
--- a/java/modules/integration/src/test/resources/sample353.xml
+++ b/java/modules/integration/src/test/resources/sample353.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>353</sampleID>
     <sampleName>Using Ruby scripts for mediation</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample354.xml b/java/modules/integration/src/test/resources/sample354.xml
index b58b59c..8449422 100644
--- a/java/modules/integration/src/test/resources/sample354.xml
+++ b/java/modules/integration/src/test/resources/sample354.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>354</sampleID>
     <sampleName>Using In-lined Ruby scripts for mediation</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample360.xml b/java/modules/integration/src/test/resources/sample360.xml
index b70644f..74d291f 100644
--- a/java/modules/integration/src/test/resources/sample360.xml
+++ b/java/modules/integration/src/test/resources/sample360.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>360</sampleID>
     <sampleName>Introduction to the dblookup mediator</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample361.xml b/java/modules/integration/src/test/resources/sample361.xml
index 1763300..1c4b9bf 100644
--- a/java/modules/integration/src/test/resources/sample361.xml
+++ b/java/modules/integration/src/test/resources/sample361.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>361</sampleID>
     <sampleName>Introduction to the dbreport mediator</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample362.xml b/java/modules/integration/src/test/resources/sample362.xml
index eacbd7f..2a8c97e 100644
--- a/java/modules/integration/src/test/resources/sample362.xml
+++ b/java/modules/integration/src/test/resources/sample362.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>362</sampleID>
     <sampleName>Action of dbreport and dblookup mediators together</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample370.xml b/java/modules/integration/src/test/resources/sample370.xml
index 86f208b..56938c8 100644
--- a/java/modules/integration/src/test/resources/sample370.xml
+++ b/java/modules/integration/src/test/resources/sample370.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>370</sampleID>
     <sampleName>Introduction to throttle mediator and concurrency throttling</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample371.xml b/java/modules/integration/src/test/resources/sample371.xml
index 1e94e5e..f6ddbe4 100644
--- a/java/modules/integration/src/test/resources/sample371.xml
+++ b/java/modules/integration/src/test/resources/sample371.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>371</sampleID>
     <sampleName>Restricting requests based on policies</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample372.xml b/java/modules/integration/src/test/resources/sample372.xml
index 751093e..db2f94f 100644
--- a/java/modules/integration/src/test/resources/sample372.xml
+++ b/java/modules/integration/src/test/resources/sample372.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>372</sampleID>
     <sampleName>Use of both concurrency throttling and request rate based throttling</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample380.xml b/java/modules/integration/src/test/resources/sample380.xml
index 04b8f34..31913f7 100644
--- a/java/modules/integration/src/test/resources/sample380.xml
+++ b/java/modules/integration/src/test/resources/sample380.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>380</sampleID>
     <sampleName>Writing your own custom mediation in Java</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample390.xml b/java/modules/integration/src/test/resources/sample390.xml
index cf9ca49..54973de 100644
--- a/java/modules/integration/src/test/resources/sample390.xml
+++ b/java/modules/integration/src/test/resources/sample390.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>390</sampleID>
     <sampleName>Introduction to the XQuery mediator</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample391.xml b/java/modules/integration/src/test/resources/sample391.xml
index c94ae7d..38578d8 100644
--- a/java/modules/integration/src/test/resources/sample391.xml
+++ b/java/modules/integration/src/test/resources/sample391.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>391</sampleID>
     <sampleName>How to use data from an external XML document with in XQuery </sampleName>
diff --git a/java/modules/integration/src/test/resources/sample4.xml b/java/modules/integration/src/test/resources/sample4.xml
index 869c90e..9048d95 100644
--- a/java/modules/integration/src/test/resources/sample4.xml
+++ b/java/modules/integration/src/test/resources/sample4.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>4</sampleID>
     <sampleName>Introduction to error handling</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample420.xml b/java/modules/integration/src/test/resources/sample420.xml
index 1c84ba8..8066bf0 100644
--- a/java/modules/integration/src/test/resources/sample420.xml
+++ b/java/modules/integration/src/test/resources/sample420.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>420</sampleID>
     <sampleName>Simple cache implemented on Synapse for the actual service</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample430.xml b/java/modules/integration/src/test/resources/sample430.xml
index 224bc2e..19748f2 100644
--- a/java/modules/integration/src/test/resources/sample430.xml
+++ b/java/modules/integration/src/test/resources/sample430.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>430</sampleID>
     <sampleName>Simple Callout Mediator for synchronizing web service invocation</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample431.xml b/java/modules/integration/src/test/resources/sample431.xml
index aaed111..5ca8252 100644
--- a/java/modules/integration/src/test/resources/sample431.xml
+++ b/java/modules/integration/src/test/resources/sample431.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>431</sampleID>
     <sampleName>Callout Mediator with security</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample432.xml b/java/modules/integration/src/test/resources/sample432.xml
index 3e80cc1..661b95a 100644
--- a/java/modules/integration/src/test/resources/sample432.xml
+++ b/java/modules/integration/src/test/resources/sample432.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>432</sampleID>
     <sampleName>Callout mediator Security Sample for different policies for inbound and outbound</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample433.xml b/java/modules/integration/src/test/resources/sample433.xml
index f32d656..0b5806f 100644
--- a/java/modules/integration/src/test/resources/sample433.xml
+++ b/java/modules/integration/src/test/resources/sample433.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>433</sampleID>
     <sampleName>Callout mediator - Invoke a service using a defined Endpoint</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample434.xml b/java/modules/integration/src/test/resources/sample434.xml
index 413ba19..9d97ceb 100644
--- a/java/modules/integration/src/test/resources/sample434.xml
+++ b/java/modules/integration/src/test/resources/sample434.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>434</sampleID>
     <sampleName>Callout mediator - Invoke a service using an inline Endpoint</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample450.xml b/java/modules/integration/src/test/resources/sample450.xml
index 4406bcf..53a4ed3 100644
--- a/java/modules/integration/src/test/resources/sample450.xml
+++ b/java/modules/integration/src/test/resources/sample450.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>450</sampleID>
     <sampleName>Introduction to the URL Rewrite Mediator</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample451.xml b/java/modules/integration/src/test/resources/sample451.xml
index e520739..52172aa 100644
--- a/java/modules/integration/src/test/resources/sample451.xml
+++ b/java/modules/integration/src/test/resources/sample451.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>451</sampleID>
     <sampleName>Conditional URL Rewriting</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample452.xml b/java/modules/integration/src/test/resources/sample452.xml
index b5bc15f..cd71682 100644
--- a/java/modules/integration/src/test/resources/sample452.xml
+++ b/java/modules/integration/src/test/resources/sample452.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>452</sampleID>
     <sampleName>Conditional URL Rewriting with Multiple Rules</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample460.xml b/java/modules/integration/src/test/resources/sample460.xml
index 8527b09..bcee1c6 100644
--- a/java/modules/integration/src/test/resources/sample460.xml
+++ b/java/modules/integration/src/test/resources/sample460.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>460</sampleID>
     <sampleName>How to initialize and use a Spring Bean as a Mediator</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample5.xml b/java/modules/integration/src/test/resources/sample5.xml
index 33f46e1..61d71de 100644
--- a/java/modules/integration/src/test/resources/sample5.xml
+++ b/java/modules/integration/src/test/resources/sample5.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>5</sampleID>
     <sampleName>Creating SOAP fault messages and changing the direction of a message</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample50.xml b/java/modules/integration/src/test/resources/sample50.xml
index c5df0ae..0615931 100644
--- a/java/modules/integration/src/test/resources/sample50.xml
+++ b/java/modules/integration/src/test/resources/sample50.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>50</sampleID>
     <sampleName>POX to SOAP conversion</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample51.xml b/java/modules/integration/src/test/resources/sample51.xml
index a325af7..60d4a6f 100644
--- a/java/modules/integration/src/test/resources/sample51.xml
+++ b/java/modules/integration/src/test/resources/sample51.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>51</sampleID>
     <sampleName>MTOM and SwA optimizations and request/response correlation</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample52.xml b/java/modules/integration/src/test/resources/sample52.xml
index f997f9e..8349dca 100644
--- a/java/modules/integration/src/test/resources/sample52.xml
+++ b/java/modules/integration/src/test/resources/sample52.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>52</sampleID>
     <sampleName>Session-less load balancing between 3 endpoints</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample53.xml b/java/modules/integration/src/test/resources/sample53.xml
index b485ceb..a04dffd 100644
--- a/java/modules/integration/src/test/resources/sample53.xml
+++ b/java/modules/integration/src/test/resources/sample53.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>53</sampleID>
     <sampleName>Failover sending among 3 endpoints</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample54.xml b/java/modules/integration/src/test/resources/sample54.xml
index 8f0dca2..5e4faa0 100644
--- a/java/modules/integration/src/test/resources/sample54.xml
+++ b/java/modules/integration/src/test/resources/sample54.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>54</sampleID>
     <sampleName>Session affinity load balancing between 3 endpoints</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample55.xml b/java/modules/integration/src/test/resources/sample55.xml
index 441daaf..376a331 100644
--- a/java/modules/integration/src/test/resources/sample55.xml
+++ b/java/modules/integration/src/test/resources/sample55.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>55</sampleID>
     <sampleName>Session affinity load balancing between fail over endpoints</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample56.xml b/java/modules/integration/src/test/resources/sample56.xml
index 687b1e4..380558e 100644
--- a/java/modules/integration/src/test/resources/sample56.xml
+++ b/java/modules/integration/src/test/resources/sample56.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>56</sampleID>
     <sampleName>WSDL endpoint</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample57.xml b/java/modules/integration/src/test/resources/sample57.xml
index 5c135f9..2ee1d8e 100644
--- a/java/modules/integration/src/test/resources/sample57.xml
+++ b/java/modules/integration/src/test/resources/sample57.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>57</sampleID>
     <sampleName>Dynamic load balancing between 3 nodes</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample58.xml b/java/modules/integration/src/test/resources/sample58.xml
index 05ec098..363fe95 100644
--- a/java/modules/integration/src/test/resources/sample58.xml
+++ b/java/modules/integration/src/test/resources/sample58.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>58</sampleID>
     <sampleName>Static load balancing between 3 nodes</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample59.xml b/java/modules/integration/src/test/resources/sample59.xml
index 6e4d132..a85b8bd 100644
--- a/java/modules/integration/src/test/resources/sample59.xml
+++ b/java/modules/integration/src/test/resources/sample59.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>59</sampleID>
     <sampleName>Weighted load balancing between 3 endpoints</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample6.xml b/java/modules/integration/src/test/resources/sample6.xml
index dc584f4..6493309 100644
--- a/java/modules/integration/src/test/resources/sample6.xml
+++ b/java/modules/integration/src/test/resources/sample6.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>6</sampleID>
     <sampleName>Manipulating SOAP headers, and filtering incoming and outgoing messages</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample7.xml b/java/modules/integration/src/test/resources/sample7.xml
index eff39b2..3708f07 100644
--- a/java/modules/integration/src/test/resources/sample7.xml
+++ b/java/modules/integration/src/test/resources/sample7.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>7</sampleID>
     <sampleName>Introduction to local Registry entries and using Schema validation</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample8.xml b/java/modules/integration/src/test/resources/sample8.xml
index e09f6f4..043b48c 100644
--- a/java/modules/integration/src/test/resources/sample8.xml
+++ b/java/modules/integration/src/test/resources/sample8.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>8</sampleID>
     <sampleName>Introduction to static and dynamic registry resources, and using XSLT transformations</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample800.xml b/java/modules/integration/src/test/resources/sample800.xml
index 47e3f4c..b300409 100644
--- a/java/modules/integration/src/test/resources/sample800.xml
+++ b/java/modules/integration/src/test/resources/sample800.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>800</sampleID>
     <sampleName>Introduction to REST APIs</sampleName>
diff --git a/java/modules/integration/src/test/resources/sample9.xml b/java/modules/integration/src/test/resources/sample9.xml
index 99a69ca..15fa908 100644
--- a/java/modules/integration/src/test/resources/sample9.xml
+++ b/java/modules/integration/src/test/resources/sample9.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <synapseSample>
     <sampleID>9</sampleID>
     <sampleName>Introduction to dynamic sequences with the Registry</sampleName>
diff --git a/java/modules/integration/src/test/resources/trust.jks b/java/modules/integration/src/test/resources/trust.jks
index 98c9a91..e7e6514 100644
--- a/java/modules/integration/src/test/resources/trust.jks
+++ b/java/modules/integration/src/test/resources/trust.jks
Binary files differ
diff --git a/java/modules/migrator/pom.xml b/java/modules/migrator/pom.xml
index 79c160f..19a6855 100644
--- a/java/modules/migrator/pom.xml
+++ b/java/modules/migrator/pom.xml
@@ -18,15 +18,13 @@
   ~  under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/java/modules/packaging/package-archetype/pom.xml b/java/modules/packaging/package-archetype/pom.xml
index db8cdc7..660f185 100644
--- a/java/modules/packaging/package-archetype/pom.xml
+++ b/java/modules/packaging/package-archetype/pom.xml
@@ -17,15 +17,12 @@
   ~  specific language governing permissions and limitations
   ~  under the License.
   -->
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../../pom.xml</relativePath>
     </parent>
     <artifactId>synapse-package-archetype</artifactId>
@@ -70,4 +67,4 @@
             </plugin>
         </plugins>
     </build>
-</project>
\ No newline at end of file
+</project>
diff --git a/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/pom.xml b/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/pom.xml
index bca9a6b..3f22961 100644
--- a/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/pom.xml
@@ -34,11 +34,11 @@
             <activation>
                 <property>
                     <name>synapse.version</name>
-                    <value>2.2.0-SNAPSHOT</value>
+                    <value>3.0.1-SNAPSHOT</value>
                 </property>
             </activation>
             <repositories>
-                <repository>
+                <!--repository>
                     <id>apache-snapshots</id>
                     <name>Apache Maven 2 Snapshot Repository</name>
                     <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
@@ -46,9 +46,9 @@
                         <updatePolicy>never</updatePolicy>
                     </releases>
                     <snapshots>
-                        <updatePolicy>interval:10080</updatePolicy> <!-- i.e. refresh weekly -->
+                        <updatePolicy>interval:10080</updatePolicy>
                     </snapshots>
-                </repository>
+                </repository-->
             </repositories>
         </profile>
     </profiles>
diff --git a/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/repository/conf/axis2.xml b/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/repository/conf/axis2.xml
index dc97edd..9289824 100644
--- a/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/repository/conf/axis2.xml
+++ b/java/modules/packaging/package-archetype/src/main/resources/archetype-resources/repository/conf/axis2.xml
@@ -273,9 +273,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender>-->
 
     <!--Uncomment this for FIX transport support
diff --git a/java/modules/packaging/package-skeleton/pom.xml b/java/modules/packaging/package-skeleton/pom.xml
index b29f9ee..ea35428 100644
--- a/java/modules/packaging/package-skeleton/pom.xml
+++ b/java/modules/packaging/package-skeleton/pom.xml
@@ -17,15 +17,12 @@
   ~  specific language governing permissions and limitations
   ~  under the License.
   -->
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../../pom.xml</relativePath>
     </parent>
     <artifactId>synapse-package-skeleton</artifactId>
diff --git a/java/modules/patches/pom.xml b/java/modules/patches/pom.xml
index d90fb58..50d3b74 100644
--- a/java/modules/patches/pom.xml
+++ b/java/modules/patches/pom.xml
@@ -17,15 +17,12 @@
   ~  specific language governing permissions and limitations
   ~  under the License.
   -->
-<project
-        xmlns="http://maven.apache.org/POM/4.0.0"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <artifactId>synapse-patches</artifactId>
@@ -55,7 +52,7 @@
                             <goal>jar</goal>
                         </goals>
                         <configuration>
-                            <outputDirectory>./jars</outputDirectory>
+                            <outputDirectory>./target/jars</outputDirectory>
                         </configuration>
                     </execution>
                 </executions>
@@ -71,8 +68,8 @@
                         <configuration>
                             <target>
                                 <unjar dest="${project.build.outputDirectory}">
-                                    <fileset dir="${basedir}/jars">
-                                        <include name="**/*.jar"/>
+                                    <fileset dir="${basedir}/target/jars">
+                                        <include name="**/*.jar" />
                                     </fileset>
                                 </unjar>
                             </target>
diff --git a/java/modules/patches/src/main/assembly/jars.xml b/java/modules/patches/src/main/assembly/jars.xml
index 2e5f5a7..798e35e 100644
--- a/java/modules/patches/src/main/assembly/jars.xml
+++ b/java/modules/patches/src/main/assembly/jars.xml
@@ -25,11 +25,11 @@
     </formats>
     <fileSets>
         <fileSet>
-            <directory>jars</directory>
+            <directory>target/jars</directory>
             <outputDirectory>/</outputDirectory>
             <includes>
                 <include>*.jar</include>
             </includes>
         </fileSet>
     </fileSets>
-</assembly>
\ No newline at end of file
+</assembly>
diff --git a/java/modules/samples/pom.xml b/java/modules/samples/pom.xml
index 2b337de..2ae38dc 100644
--- a/java/modules/samples/pom.xml
+++ b/java/modules/samples/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-        xmlns="http://maven.apache.org/POM/4.0.0"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -57,189 +54,163 @@
                                 <phase>generate-test-resources</phase>
                                 <configuration>
                                     <tasks>
-                                        <echo message="*** Creating a sample n2n testing repository ***"/>
+                                        <echo message="*** Creating a sample n2n testing repository ***" />
 
-                                        <mkdir dir="target/test_repos"/>
-                                        <mkdir dir="target/test_repos/axis2Server"/>
-                                        <mkdir dir="target/test_repos/axis2Client"/>
-                                        <mkdir dir="target/test_repos/synapse"/>
-                                        <mkdir dir="target/test_repos/synapse"/>
-                                        <mkdir dir="target/test_repos/synapse/modules"/>
-                                        <mkdir dir="target/test_repos/synapse/conf"/>
-                                        <mkdir dir="target/test_repos/axis2Server/services"/>
-                                        <mkdir dir="target/test_repos/axis2Server/modules"/>
-                                        <mkdir dir="target/test_repos/axis2Server/conf"/>
-                                        <mkdir dir="target/test_repos/axis2Client/modules"/>
-                                        <mkdir dir="target/test_repos/axis2Client/conf"/>
+                                        <mkdir dir="target/test_repos" />
+                                        <mkdir dir="target/test_repos/axis2Server" />
+                                        <mkdir dir="target/test_repos/axis2Client" />
+                                        <mkdir dir="target/test_repos/synapse" />
+                                        <mkdir dir="target/test_repos/synapse" />
+                                        <mkdir dir="target/test_repos/synapse/modules" />
+                                        <mkdir dir="target/test_repos/synapse/conf" />
+                                        <mkdir dir="target/test_repos/axis2Server/services" />
+                                        <mkdir dir="target/test_repos/axis2Server/modules" />
+                                        <mkdir dir="target/test_repos/axis2Server/conf" />
+                                        <mkdir dir="target/test_repos/axis2Client/modules" />
+                                        <mkdir dir="target/test_repos/axis2Client/conf" />
 
-                                        <copy file="../../repository/conf/sample/resources/misc/server/axis2.xml"
-                                              tofile="target/test_repos/axis2Server/conf/axis2.xml"/>
-                                        <copy file="../../repository/conf/sample/resources/misc/client/axis2.xml"
-                                              tofile="target/test_repos/axis2Client/conf/axis2.xml"/>
-                                        <copy file="../../repository/conf/axis2.xml"
-                                              tofile="target/test_repos/synapse/conf/axis2.xml"/>
-                                        <copy file="../core/src/main/resources/trust.jks"
-                                              tofile="target/test_repos/synapse/conf/trust.jks"/>
-                                        <copy file="../core/src/main/resources/identity.jks"
-                                              tofile="target/test_repos/synapse/conf/identity.jks"/>
-                                        <copy file="../core/src/test/resources/keystore.jks"
-                                              tofile="target/test_repos/synapse/conf/keystore.jks"/>
+                                        <copy file="../../repository/conf/sample/resources/misc/server/axis2.xml" tofile="target/test_repos/axis2Server/conf/axis2.xml" />
+                                        <copy file="../../repository/conf/sample/resources/misc/client/axis2.xml" tofile="target/test_repos/axis2Client/conf/axis2.xml" />
+                                        <copy file="../../repository/conf/axis2.xml" tofile="target/test_repos/synapse/conf/axis2.xml" />
+                                        <copy file="../core/src/main/resources/trust.jks" tofile="target/test_repos/synapse/conf/trust.jks" />
+                                        <copy file="../core/src/main/resources/identity.jks" tofile="target/test_repos/synapse/conf/identity.jks" />
+                                        <copy file="../core/src/test/resources/keystore.jks" tofile="target/test_repos/synapse/conf/keystore.jks" />
 
-                                        <property name="temp.dir" value="target/temp"/>
-                                        <property name="classes" value="${temp.dir}/classes"/>
-                                        <property name="services"
-                                                  value="target/test_repos/axis2Server/services"/>
+                                        <property name="temp.dir" value="target/temp" />
+                                        <property name="classes" value="${temp.dir}/classes" />
+                                        <property name="services" value="target/test_repos/axis2Server/services" />
 
-                                        <property name="src"
-                                                  value="services/SimpleStockQuoteService/src"/>
+                                        <property name="src" value="services/SimpleStockQuoteService/src" />
 
-                                        <mkdir dir="${temp.dir}"/>
-                                        <mkdir dir="${classes}"/>
+                                        <mkdir dir="${temp.dir}" />
+                                        <mkdir dir="${classes}" />
 
                                         <javac debug="on" destdir="${classes}" fork="true">
-                                            <src path="${src}"/>
-                                            <classpath refid="maven.compile.classpath"/>
+                                            <src path="${src}" />
+                                            <classpath refid="maven.compile.classpath" />
                                         </javac>
 
-                                        <property name="SSQ.dir"
-                                                  value="${temp.dir}/SimpleStockQuote"/>
-                                        <mkdir dir="${SSQ.dir}"/>
+                                        <property name="SSQ.dir" value="${temp.dir}/SimpleStockQuote" />
+                                        <mkdir dir="${SSQ.dir}" />
 
-                                        <mkdir dir="${SSQ.dir}/META-INF"/>
-                                        <copy file="${src}/../conf/services.xml"
-                                              tofile="${SSQ.dir}/META-INF/services.xml"/>
-                                        <copy file="${src}/../wsdl/SimpleStockQuoteService.wsdl"
-                                              tofile="${SSQ.dir}/META-INF/service.wsdl"/>
+                                        <mkdir dir="${SSQ.dir}/META-INF" />
+                                        <copy file="${src}/../conf/services.xml" tofile="${SSQ.dir}/META-INF/services.xml" />
+                                        <copy file="${src}/../wsdl/SimpleStockQuoteService.wsdl" tofile="${SSQ.dir}/META-INF/service.wsdl" />
                                         <copy toDir="${SSQ.dir}">
                                             <fileset dir="${classes}">
-                                                <include name="**/*.class"/>
+                                                <include name="**/*.class" />
                                             </fileset>
                                         </copy>
 
                                         <jar destfile="${services}/SimpleStockQuoteService.aar">
-                                            <fileset dir="${SSQ.dir}"/>
+                                            <fileset dir="${SSQ.dir}" />
                                         </jar>
 
-                                        <property name="src2"
-                                                  value="services/SecureStockQuoteService/src"/>
-                                        <delete dir="${temp.dir}"/>
-                                        <mkdir dir="${temp.dir}"/>
-                                        <mkdir dir="${classes}"/>
+                                        <property name="src2" value="services/SecureStockQuoteService/src" />
+                                        <delete dir="${temp.dir}" />
+                                        <mkdir dir="${temp.dir}" />
+                                        <mkdir dir="${classes}" />
                                         <javac debug="on" destdir="${classes}" fork="true">
-                                            <src path="${src2}"/>
-                                            <classpath refid="maven.compile.classpath"/>
+                                            <src path="${src2}" />
+                                            <classpath refid="maven.compile.classpath" />
                                         </javac>
-                                        <property name="SSQ2.dir"
-                                                  value="${temp.dir}/SecureStockQuoteService"/>
-                                        <mkdir dir="${SSQ2.dir}"/>
-                                        <mkdir dir="${SSQ2.dir}/META-INF"/>
-                                        <copy file="${src2}/../conf/services.xml"
-                                              tofile="${SSQ2.dir}/META-INF/services.xml"/>
-                                        <copy file="${src2}/../wsdl/SimpleStockQuoteService.wsdl"
-                                              tofile="${SSQ2.dir}/META-INF/service.wsdl"/>
-                                        <copy file="${src2}/../store.jks"
-                                              tofile="${SSQ2.dir}/store.jks"/>
+                                        <property name="SSQ2.dir" value="${temp.dir}/SecureStockQuoteService" />
+                                        <mkdir dir="${SSQ2.dir}" />
+                                        <mkdir dir="${SSQ2.dir}/META-INF" />
+                                        <copy file="${src2}/../conf/services.xml" tofile="${SSQ2.dir}/META-INF/services.xml" />
+                                        <copy file="${src2}/../wsdl/SimpleStockQuoteService.wsdl" tofile="${SSQ2.dir}/META-INF/service.wsdl" />
+                                        <copy file="${src2}/../store.jks" tofile="${SSQ2.dir}/store.jks" />
                                         <copy toDir="${SSQ2.dir}">
                                             <fileset dir="${classes}">
-                                                <include name="**/*.class"/>
+                                                <include name="**/*.class" />
                                             </fileset>
                                         </copy>
                                         <jar destfile="${services}/SecureStockQuoteService.aar">
-                                            <fileset dir="${SSQ2.dir}"/>
+                                            <fileset dir="${SSQ2.dir}" />
                                         </jar>
 
-                                        <property name="src3"
-                                                  value="services/MTOMSwASampleService/src"/>
-                                        <delete dir="${temp.dir}"/>
-                                        <mkdir dir="${temp.dir}"/>
-                                        <mkdir dir="${classes}"/>
+                                        <property name="src3" value="services/MTOMSwASampleService/src" />
+                                        <delete dir="${temp.dir}" />
+                                        <mkdir dir="${temp.dir}" />
+                                        <mkdir dir="${classes}" />
                                         <javac debug="on" destdir="${classes}" fork="true">
-                                            <src path="${src3}"/>
-                                            <classpath refid="maven.compile.classpath"/>
+                                            <src path="${src3}" />
+                                            <classpath refid="maven.compile.classpath" />
                                         </javac>
-                                        <property name="SSQ3.dir"
-                                                  value="${temp.dir}/MTOMSwASampleService"/>
-                                        <mkdir dir="${SSQ3.dir}"/>
-                                        <mkdir dir="${SSQ3.dir}/META-INF"/>
-                                        <copy file="${src3}/../conf/services.xml"
-                                              tofile="${SSQ3.dir}/META-INF/services.xml"/>
+                                        <property name="SSQ3.dir" value="${temp.dir}/MTOMSwASampleService" />
+                                        <mkdir dir="${SSQ3.dir}" />
+                                        <mkdir dir="${SSQ3.dir}/META-INF" />
+                                        <copy file="${src3}/../conf/services.xml" tofile="${SSQ3.dir}/META-INF/services.xml" />
                                         <copy toDir="${SSQ3.dir}">
                                             <fileset dir="${classes}">
-                                                <include name="**/*.class"/>
+                                                <include name="**/*.class" />
                                             </fileset>
                                         </copy>
                                         <jar destfile="${services}/MTOMSwASampleService.aar">
-                                            <fileset dir="${SSQ3.dir}"/>
+                                            <fileset dir="${SSQ3.dir}" />
                                         </jar>
 
-                                        <property name="src4"
-                                                  value="services/ReliableStockQuoteService/src"/>
-                                        <delete dir="${temp.dir}"/>
-                                        <mkdir dir="${temp.dir}"/>
-                                        <mkdir dir="${classes}"/>
+                                        <property name="src4" value="services/ReliableStockQuoteService/src" />
+                                        <delete dir="${temp.dir}" />
+                                        <mkdir dir="${temp.dir}" />
+                                        <mkdir dir="${classes}" />
                                         <javac debug="on" destdir="${classes}" fork="true">
-                                            <src path="${src4}"/>
-                                            <classpath refid="maven.compile.classpath"/>
+                                            <src path="${src4}" />
+                                            <classpath refid="maven.compile.classpath" />
                                         </javac>
-                                        <property name="RSQ.dir"
-                                                  value="${temp.dir}/ReliableStockQuoteService"/>
-                                        <mkdir dir="${RSQ.dir}"/>
+                                        <property name="RSQ.dir" value="${temp.dir}/ReliableStockQuoteService" />
+                                        <mkdir dir="${RSQ.dir}" />
 
-                                        <mkdir dir="${RSQ.dir}/META-INF"/>
-                                        <copy file="${src4}/../conf/services.xml"
-                                              tofile="${RSQ.dir}/META-INF/services.xml"/>
-                                        <copy file="${src4}/../wsdl/ReliableStockQuoteService.wsdl"
-                                              tofile="${RSQ.dir}/META-INF/service.wsdl"/>
+                                        <mkdir dir="${RSQ.dir}/META-INF" />
+                                        <copy file="${src4}/../conf/services.xml" tofile="${RSQ.dir}/META-INF/services.xml" />
+                                        <copy file="${src4}/../wsdl/ReliableStockQuoteService.wsdl" tofile="${RSQ.dir}/META-INF/service.wsdl" />
                                         <copy toDir="${RSQ.dir}">
                                             <fileset dir="${classes}">
-                                                <include name="**/*.class"/>
+                                                <include name="**/*.class" />
                                             </fileset>
                                         </copy>
 
                                         <jar destfile="${services}/ReliableStockQuoteService.aar">
-                                            <fileset dir="${RSQ.dir}"/>
+                                            <fileset dir="${RSQ.dir}" />
                                         </jar>
 
-                                        <property name="src5"
-                                                  value="services/LoadbalanceFailoverService/src"/>
-                                        <delete dir="${temp.dir}"/>
-                                        <mkdir dir="${temp.dir}"/>
-                                        <mkdir dir="${classes}"/>
+                                        <property name="src5" value="services/LoadbalanceFailoverService/src" />
+                                        <delete dir="${temp.dir}" />
+                                        <mkdir dir="${temp.dir}" />
+                                        <mkdir dir="${classes}" />
                                         <javac debug="on" destdir="${classes}" fork="true">
-                                            <src path="${src5}"/>
-                                            <classpath refid="maven.compile.classpath"/>
+                                            <src path="${src5}" />
+                                            <classpath refid="maven.compile.classpath" />
                                         </javac>
 
-                                        <property name="LBFA1.dir" value="${temp.dir}/LBService1"/>
-                                        <mkdir dir="${LBFA1.dir}"/>
+                                        <property name="LBFA1.dir" value="${temp.dir}/LBService1" />
+                                        <mkdir dir="${LBFA1.dir}" />
 
-                                        <mkdir dir="${LBFA1.dir}/META-INF"/>
-                                        <copy file="${src5}/../conf/service1/services.xml"
-                                              tofile="${LBFA1.dir}/META-INF/services.xml"/>
+                                        <mkdir dir="${LBFA1.dir}/META-INF" />
+                                        <copy file="${src5}/../conf/service1/services.xml" tofile="${LBFA1.dir}/META-INF/services.xml" />
                                         <copy toDir="${LBFA1.dir}">
                                             <fileset dir="${classes}">
-                                                <include name="**/LBService1.class"/>
+                                                <include name="**/LBService1.class" />
                                             </fileset>
                                         </copy>
 
                                         <jar destfile="${services}/LBService1.aar">
-                                            <fileset dir="${LBFA1.dir}"/>
+                                            <fileset dir="${LBFA1.dir}" />
                                         </jar>
 
-                                        <property name="LBFA2.dir" value="${temp.dir}/LBService2"/>
-                                        <mkdir dir="${LBFA2.dir}"/>
+                                        <property name="LBFA2.dir" value="${temp.dir}/LBService2" />
+                                        <mkdir dir="${LBFA2.dir}" />
 
-                                        <mkdir dir="${LBFA2.dir}/META-INF"/>
-                                        <copy file="${src5}/../conf/service2/services.xml"
-                                              tofile="${LBFA2.dir}/META-INF/services.xml"/>
+                                        <mkdir dir="${LBFA2.dir}/META-INF" />
+                                        <copy file="${src5}/../conf/service2/services.xml" tofile="${LBFA2.dir}/META-INF/services.xml" />
                                         <copy toDir="${LBFA2.dir}">
                                             <fileset dir="${classes}">
-                                                <include name="**/LBService2.class"/>
+                                                <include name="**/LBService2.class" />
                                             </fileset>
                                         </copy>
 
                                         <jar destfile="${services}/LBService2.aar">
-                                            <fileset dir="${LBFA2.dir}"/>
+                                            <fileset dir="${LBFA2.dir}" />
                                         </jar>
 
                                     </tasks>
@@ -414,12 +385,6 @@
         <dependency>
             <groupId>org.apache.rampart</groupId>
             <artifactId>rampart-core</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.woden</groupId>
-                    <artifactId>woden-core</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
 
     </dependencies>
diff --git a/java/modules/samples/services/EJBSampleBeans/pom.xml b/java/modules/samples/services/EJBSampleBeans/pom.xml
index c1a6300..b63f46b 100644
--- a/java/modules/samples/services/EJBSampleBeans/pom.xml
+++ b/java/modules/samples/services/EJBSampleBeans/pom.xml
@@ -30,14 +30,14 @@
     <name>Apache Synapse - Samples - EJB</name>

     <description>Apache Synapse - Samples - EJB</description>

 

-    <repositories>

+    <!--repositories>

         <repository>

             <id>maven2-repository.dev.java.net</id>

             <name>Java.net Repository for Maven</name>

             <url>http://download.java.net/maven/2/</url>

             <layout>default</layout>

         </repository>

-    </repositories>

+    </repositories-->

 

     <build>

         <sourceDirectory>src</sourceDirectory>

diff --git a/java/modules/samples/services/SecureStockQuoteService/store.jks b/java/modules/samples/services/SecureStockQuoteService/store.jks
index 02d7c4e..fe3c5f8 100644
--- a/java/modules/samples/services/SecureStockQuoteService/store.jks
+++ b/java/modules/samples/services/SecureStockQuoteService/store.jks
Binary files differ
diff --git a/java/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java b/java/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java
index afacd21..2f0dd66 100755
--- a/java/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java
+++ b/java/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package samples.userguide;
 
 import org.apache.axiom.om.OMElement;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_100_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_100_Integration.java
index 2dafc4c..3b2de4e 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_100_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_100_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_101_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_101_Integration.java
index 445999e..c0caa39 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_101_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_101_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_102_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_102_Integration.java
index 3e59730..52a8fa6 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_102_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_102_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_103_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_103_Integration.java
index 91957a0..a3aede1 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_103_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_103_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_104_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_104_Integration.java
index 1d2156b..3857ec3 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_104_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_104_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_10_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_10_Integration.java
index 909554e..b80d626 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_10_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_10_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_110_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_110_Integration.java
index dd10af5..d303ce1 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_110_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_110_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_111_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_111_Integration.java
index 8dcd0f5..e6331cb 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_111_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_111_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_112_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_112_Integration.java
index 5c5d57c..80e242a 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_112_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_112_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_113_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_113_Integration.java
index c8fe3ff..34fe5fa 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_113_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_113_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_114_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_114_Integration.java
index 91887c0..15c3870 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_114_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_114_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_11_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_11_Integration.java
index 24aaa5b..d8ff4aa 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_11_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_11_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_500_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_500_Integration.java
index 4a89d5e..4f8b9fd 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_500_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_500_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_501_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_501_Integration.java
index 0635227..c04472a 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_501_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_501_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_502_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_502_Integration.java
index 05a2af0..a5e6729 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_502_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_502_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_503_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_503_Integration.java
index f7cd905..96f7cb7 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_503_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_503_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_50_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_50_Integration.java
index 9c4b9a9..95c7c97 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_50_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_50_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_510_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_510_Integration.java
index 70d4390..34167a2 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_510_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_510_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_51_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_51_Integration.java
index e7fea63..da4c43d 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_51_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_51_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_52_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_52_Integration.java
index 84d72bf..dea5583 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_52_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_52_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_53_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_53_Integration.java
index b968692..dc00ec2 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_53_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_53_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_54_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_54_Integration.java
index 5c5e390..a11958e 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_54_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_54_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_55_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_55_Integration.java
index 245d83e..7d377bc 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_55_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_55_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_56_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_56_Integration.java
index 7da79f2..faf9920 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_56_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_56_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_57_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_57_Integration.java
index a76710e..782f5e4 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_57_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_57_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_600_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_600_Integration.java
index 15ebb06..625f399 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_600_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_600_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_60_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_60_Integration.java
index 26a9a07..c21f8d7 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_60_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_60_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_8_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_8_Integration.java
index fadadc8..d62171c 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_8_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_8_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_9_Integration.java b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_9_Integration.java
index 76d7a38..879c486 100644
--- a/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_9_Integration.java
+++ b/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/SynapseSample_9_Integration.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.samples.n2n;
 
 import org.apache.synapse.SynapseConstants;
diff --git a/java/modules/securevault/pom.xml b/java/modules/securevault/pom.xml
index bce7228..aed59f9 100644
--- a/java/modules/securevault/pom.xml
+++ b/java/modules/securevault/pom.xml
@@ -1,107 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-  ~  Licensed to the Apache Software Foundation (ASF) under one

-  ~  or more contributor license agreements.  See the NOTICE file

-  ~  distributed with this work for additional information

-  ~  regarding copyright ownership.  The ASF licenses this file

-  ~  to you under the Apache License, Version 2.0 (the

-  ~  "License"); you may not use this file except in compliance

-  ~  with the License.  You may obtain a copy of the License at

-  ~

-  ~   http://www.apache.org/licenses/LICENSE-2.0

-  ~

-  ~  Unless required by applicable law or agreed to in writing,

-  ~  software distributed under the License is distributed on an

-  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

-  ~  KIND, either express or implied.  See the License for the

-  ~  specific language governing permissions and limitations

-  ~  under the License.

-  -->

-

-<project

-        xmlns="http://maven.apache.org/POM/4.0.0"

-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

-    <modelVersion>4.0.0</modelVersion>

-    <parent>

-        <groupId>org.apache.synapse</groupId>

-        <artifactId>Apache-Synapse</artifactId>

-        <version>2.2.0-SNAPSHOT</version>

-        <relativePath>../../pom.xml</relativePath>

-    </parent>

-    <artifactId>synapse-securevault</artifactId>

-    <name>Apache Synapse - Secure Vault</name>

-    <description>Apache Synapse - Secure vault</description>

-    <packaging>bundle</packaging>

-

-    <scm>

-        <connection>scm:svn:http://svn.apache.org/repos/asf/synapse/trunk/java/modules/securevault</connection>

-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/synapse/trunk/java/modules/securevault</developerConnection>

-        <url>http://svn.apache.org/viewvc/synapse/trunk/java/modules/securevault</url>

-    </scm>

-

-    <build>

-        <plugins>

-            <plugin>

-                <artifactId>maven-compiler-plugin</artifactId>

-            </plugin>

-            <plugin>

-                <artifactId>maven-surefire-plugin</artifactId>

-            </plugin>

-            <plugin>

-                <groupId>org.apache.felix</groupId>

-                <artifactId>maven-bundle-plugin</artifactId>

-                <extensions>true</extensions>

-                <configuration>

-                    <instructions>

-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>

-                        <Export-Package>

-                            org.apache.synapse.securevault.*,

-                        </Export-Package>

-                        <Import-Package>

-                            !javax.xml.namespace,

-                            javax.xml.namespace; version=0.0.0,

-                            *;resolution:=optional,

-                        </Import-Package>

-                        <DynamicImport-Package>*</DynamicImport-Package>

-                    </instructions>

-                </configuration>

-            </plugin>

-        </plugins>

-    </build>

-    <dependencies>

-        <dependency>

-            <groupId>org.apache.ws.commons.axiom</groupId>

-            <artifactId>axiom-api</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>org.apache.ws.commons.axiom</groupId>

-            <artifactId>axiom-impl</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>log4j</groupId>

-            <artifactId>log4j</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>jline</groupId>

-            <artifactId>jline</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>junit</groupId>

-            <artifactId>junit</artifactId>

-            <scope>test</scope>

-        </dependency>

-        <dependency>

-            <groupId>commons-cli</groupId>

-            <artifactId>commons-cli</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>commons-io</groupId>

-            <artifactId>commons-io</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>commons-codec</groupId>

-            <artifactId>commons-codec</artifactId>

-        </dependency>

-    </dependencies>

-</project>

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.synapse</groupId>
+        <artifactId>Apache-Synapse</artifactId>
+        <version>3.0.2-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>synapse-securevault</artifactId>
+    <name>Apache Synapse - Secure Vault</name>
+    <description>Apache Synapse - Secure vault</description>
+    <packaging>bundle</packaging>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/synapse/trunk/java/modules/securevault</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/synapse/trunk/java/modules/securevault</developerConnection>
+        <url>http://svn.apache.org/viewvc/synapse/trunk/java/modules/securevault</url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Export-Package>
+                            org.apache.synapse.securevault.*,
+                        </Export-Package>
+                        <Import-Package>
+                            !javax.xml.namespace,
+                            javax.xml.namespace; version=0.0.0,
+                            *;resolution:=optional,
+                        </Import-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>jline</groupId>
+            <artifactId>jline</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/CACertsLoader.java b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/CACertsLoader.java
index 3405a31..7ededf3 100644
--- a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/CACertsLoader.java
+++ b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/CACertsLoader.java
@@ -1,5 +1,23 @@
-package org.apache.synapse.securevault.keystore;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 
+package org.apache.synapse.securevault.keystore;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
diff --git a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/JKSKeyStoreLoader.java b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/JKSKeyStoreLoader.java
index 7f3362a..bdd638f 100644
--- a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/JKSKeyStoreLoader.java
+++ b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/JKSKeyStoreLoader.java
@@ -1,6 +1,22 @@
-/**
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
+
 package org.apache.synapse.securevault.keystore;
 
 import java.security.KeyStore;
diff --git a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS12KeyStoreLoader.java b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS12KeyStoreLoader.java
index 2f02f7b..fc5c84d 100644
--- a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS12KeyStoreLoader.java
+++ b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS12KeyStoreLoader.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.securevault.keystore;
 
 import java.security.KeyStore;
diff --git a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS8KeyStoreLoader.java b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS8KeyStoreLoader.java
index 73a6d94..647cad3 100644
--- a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS8KeyStoreLoader.java
+++ b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/PKCS8KeyStoreLoader.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.securevault.keystore;
 
 import org.apache.commons.codec.binary.Base64;
diff --git a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/secret/SecretManager.java b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/secret/SecretManager.java
index 3924d45..b0e83d6 100644
--- a/java/modules/securevault/src/main/java/org/apache/synapse/securevault/secret/SecretManager.java
+++ b/java/modules/securevault/src/main/java/org/apache/synapse/securevault/secret/SecretManager.java
@@ -1,6 +1,22 @@
-/**
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
+
 package org.apache.synapse.securevault.secret;
 
 import org.apache.commons.logging.Log;
@@ -236,4 +252,4 @@
         }
         return isValid;
     }
-}
\ No newline at end of file
+}
diff --git a/java/modules/tasks/pom.xml b/java/modules/tasks/pom.xml
index 81dfe9f..f80f3ac 100644
--- a/java/modules/tasks/pom.xml
+++ b/java/modules/tasks/pom.xml
@@ -1,87 +1,84 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-  ~  Licensed to the Apache Software Foundation (ASF) under one

-  ~  or more contributor license agreements.  See the NOTICE file

-  ~  distributed with this work for additional information

-  ~  regarding copyright ownership.  The ASF licenses this file

-  ~  to you under the Apache License, Version 2.0 (the

-  ~  "License"); you may not use this file except in compliance

-  ~  with the License.  You may obtain a copy of the License at

-  ~

-  ~   http://www.apache.org/licenses/LICENSE-2.0

-  ~

-  ~  Unless required by applicable law or agreed to in writing,

-  ~  software distributed under the License is distributed on an

-  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

-  ~  KIND, either express or implied.  See the License for the

-  ~  specific language governing permissions and limitations

-  ~  under the License.

-  -->

-

-<project

-        xmlns="http://maven.apache.org/POM/4.0.0"

-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

-    <modelVersion>4.0.0</modelVersion>

-    <parent>

-        <groupId>org.apache.synapse</groupId>

-        <artifactId>Apache-Synapse</artifactId>

-        <version>2.2.0-SNAPSHOT</version>

-        <relativePath>../../pom.xml</relativePath>

-    </parent>

-

-    <groupId>org.apache.synapse</groupId>

-    <artifactId>synapse-tasks</artifactId>

-    <name>Apache Synapse - Tasks</name>

-    <description>Apache Synapse - Scheduled Tasks Core</description>

-    <packaging>bundle</packaging>

-

-    <scm>

-        <connection>scm:svn:http://svn.apache.org/repos/asf/synapse/trunk/java/modules/tasks</connection>

-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/synapse/trunk/java/modules/tasks</developerConnection>

-        <url>http://svn.apache.org/viewvc/synapse/trunk/java/modules/tasks</url>

-    </scm>

-

-    <build>

-        <plugins>

-            <plugin>

-                <groupId>org.apache.maven.plugins</groupId>

-                <artifactId>maven-surefire-plugin</artifactId>

-            </plugin>

-            <plugin>

-                <groupId>org.apache.felix</groupId>

-                <artifactId>maven-bundle-plugin</artifactId>

-                <extensions>true</extensions>

-                <configuration>

-                    <instructions>

-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>

-                        <Export-Package>

-                            org.apache.synapse.task.*,

-                        </Export-Package>

-                        <Import-Package>

-                            !javax.xml.namespace,

-                            javax.xml.namespace; version=0.0.0,

-                            *;resolution:=optional,

-                        </Import-Package>

-                        <DynamicImport-Package>*</DynamicImport-Package>

-                    </instructions>

-                </configuration>

-            </plugin>

-        </plugins>

-    </build>

-

-    <dependencies>

-        <dependency>

-            <groupId>org.apache.synapse</groupId>

-            <artifactId>synapse-commons</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>org.quartz-scheduler</groupId>

-            <artifactId>quartz</artifactId>

-        </dependency>

-        <dependency>

-            <groupId>commons-collections</groupId>

-            <artifactId>commons-collections</artifactId>

-        </dependency>

-    </dependencies>

-</project>

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.synapse</groupId>
+        <artifactId>Apache-Synapse</artifactId>
+        <version>3.0.2-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.synapse</groupId>
+    <artifactId>synapse-tasks</artifactId>
+    <name>Apache Synapse - Tasks</name>
+    <description>Apache Synapse - Scheduled Tasks Core</description>
+    <packaging>bundle</packaging>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/synapse/trunk/java/modules/tasks</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/synapse/trunk/java/modules/tasks</developerConnection>
+        <url>http://svn.apache.org/viewvc/synapse/trunk/java/modules/tasks</url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Export-Package>
+                            org.apache.synapse.task.*,
+                        </Export-Package>
+                        <Import-Package>
+                            !javax.xml.namespace,
+                            javax.xml.namespace; version=0.0.0,
+                            *;resolution:=optional,
+                        </Import-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.synapse</groupId>
+            <artifactId>synapse-commons</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/java/modules/transports/core/nhttp/pom.xml b/java/modules/transports/core/nhttp/pom.xml
index 4aa4ecb..16a2f4e 100644
--- a/java/modules/transports/core/nhttp/pom.xml
+++ b/java/modules/transports/core/nhttp/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>synapse-transports</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -157,8 +154,11 @@
         <dependency>
             <groupId>commons-lang</groupId>
             <artifactId>commons-lang</artifactId>
-        </dependency>
-
+        </dependency>   
+        <dependency>
+        	<groupId>commons-collections</groupId>
+        	<artifactId>commons-collections</artifactId>
+      	</dependency>
         <!-- BouncyCastle API which is required when validating Certificates. -->
         <dependency>
             <groupId>org.bouncycastle</groupId>
diff --git a/java/modules/transports/core/nhttp/src/main/assembly/testkit-logs.xml b/java/modules/transports/core/nhttp/src/main/assembly/testkit-logs.xml
index 7eae7ff..2df5925 100644
--- a/java/modules/transports/core/nhttp/src/main/assembly/testkit-logs.xml
+++ b/java/modules/transports/core/nhttp/src/main/assembly/testkit-logs.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <assembly>
     <id>testkit-logs</id>
     <formats>
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/AccessHandler.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/AccessHandler.java
index acc0062..4b2a94c 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/AccessHandler.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/AccessHandler.java
@@ -37,4 +37,8 @@
     public static Access getAccess() {
         return access;
     }
+
+    public static Log getAccessLog() {
+        return accessLog;
+    }
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ClientHandler.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ClientHandler.java
index 9eadfe2..3585e17 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ClientHandler.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ClientHandler.java
@@ -279,14 +279,15 @@
 
         if (axis2Request != null && !axis2Request.isCompleted()) {
             checkAxisRequestComplete(conn, NhttpConstants.CONNECTION_CLOSED, message, null);
+            shutdownConnection(conn, true, "Connection closed before response is received");
         } else {
             if (log.isDebugEnabled()) {
                 log.debug(getErrorMessage("Keep-alive connection closed", conn));
             }
+            shutdownConnection(conn, false, null);
         }
 
         HttpContext context = conn.getContext();
-        shutdownConnection(conn);
         context.removeAttribute(RESPONSE_SINK_BUFFER);
         context.removeAttribute(REQUEST_SOURCE_BUFFER);
         metrics.disconnected();
@@ -309,14 +310,15 @@
 
         if (axis2Request != null && !axis2Request.isCompleted()) {
             checkAxisRequestComplete(conn, NhttpConstants.CONNECTION_TIMEOUT, message, null);
+            shutdownConnection(conn, true, "Connection timeout before response is received");
         } else {
             if (log.isDebugEnabled()) {
                 log.debug(getErrorMessage("Keep-alive connection timed out", conn));
             }
+            shutdownConnection(conn, false, null);
         }
 
         HttpContext context = conn.getContext();
-        shutdownConnection(conn);
         context.removeAttribute(RESPONSE_SINK_BUFFER);
         context.removeAttribute(REQUEST_SOURCE_BUFFER);
     }
@@ -332,7 +334,7 @@
             exception(conn, (IOException) e);
         } else {
             log.error(e.getMessage(), e);
-            shutdownConnection(conn);
+            shutdownConnection(conn, true, "Error occurred : " + e.getMessage());
         }
     }
 
@@ -346,7 +348,7 @@
         String message = getErrorMessage("HTTP protocol violation : " + e.getMessage(), conn);
         log.error(message, e);
     	checkAxisRequestComplete(conn, NhttpConstants.PROTOCOL_VIOLATION, message, e);
-        shutdownConnection(conn);
+        shutdownConnection(conn, true, "HTTP protocol violation : " + e.getMessage());
     }
 
     /**
@@ -363,7 +365,7 @@
             log.error(message, e);
         }
         checkAxisRequestComplete(conn, NhttpConstants.SND_IO_ERROR_SENDING, message, e);
-        shutdownConnection(conn);
+        shutdownConnection(conn, true, "I/O error : " + e.getMessage());
     }
 
     /**
@@ -547,12 +549,12 @@
                     try {
                         // this is a connection we should not re-use
                         ConnectionPool.forget(conn);
-                        shutdownConnection(conn);
+                        shutdownConnection(conn, false, null);
                         context.removeAttribute(RESPONSE_SINK_BUFFER);
                         context.removeAttribute(REQUEST_SOURCE_BUFFER);
                     } catch (Exception ignore) {}
                 } else if (!connStrategy.keepAlive(response, context)) {
-                    shutdownConnection(conn);
+                    shutdownConnection(conn, false, null);
                     context.removeAttribute(RESPONSE_SINK_BUFFER);
                     context.removeAttribute(REQUEST_SOURCE_BUFFER);
                 } else {
@@ -957,7 +959,7 @@
                 try {
                     // this is a connection we should not re-use
                     ConnectionPool.forget(conn);
-                    shutdownConnection(conn);
+                    shutdownConnection(conn, false, null);
                     context.removeAttribute(RESPONSE_SINK_BUFFER);
                     context.removeAttribute(REQUEST_SOURCE_BUFFER);
                 } catch (Exception ignore) {}
@@ -976,19 +978,28 @@
         workerPool.execute(task);        
     }
 
+
     /**
      * Shutdown the connection ignoring any IO errors during the process
-     * 
+     *
      * @param conn the connection to be shutdown
+     * @param isError whether shutdown is due to an error
+     * @param errorMsg error message if shutdown happens on error
      */
-    private void shutdownConnection(final NHttpClientConnection conn) {
+    private void shutdownConnection(final NHttpClientConnection conn, boolean isError, String errorMsg) {
         if (conn instanceof HttpInetConnection) {
             HttpInetConnection inetConnection = (HttpInetConnection) conn;
-            if (log.isDebugEnabled()) {
-                log.debug("Connection to remote address : " + inetConnection.getRemoteAddress()
+            if (log.isWarnEnabled() && (isError || log.isDebugEnabled())) {
+                String msg = "Connection to remote address : " + inetConnection.getRemoteAddress()
                         + ":" + inetConnection.getRemotePort() + " from local address : "
                         + inetConnection.getLocalAddress() + ":" + inetConnection.getLocalPort() +
-                        " is closed!");
+                        " is closed!"
+                        + (errorMsg != null ? " - On error : " + errorMsg : "");
+                if (isError) {
+                    log.warn(msg);
+                } else {
+                    log.debug(msg);
+                }
             }
             
             if (countConnections) {
@@ -1131,7 +1142,7 @@
             log.error(msg, e);
         }
         if (conn != null) {
-            shutdownConnection(conn);
+            shutdownConnection(conn, true, msg);
         }
     }
 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListener.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListener.java
index 27976e7..ba58c9b 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListener.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListener.java
@@ -43,7 +43,7 @@
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
 import org.apache.synapse.transport.nhttp.util.NhttpMetricsCollector;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 
 import javax.net.ssl.SSLContext;
 import java.io.IOException;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLListener.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLListener.java
index 99f7e63..130af1b 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLListener.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLListener.java
@@ -46,7 +46,7 @@
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 
 public class HttpCoreNIOSSLListener extends HttpCoreNIOListener {
 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLSender.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLSender.java
index 7843423..1cf7b25 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLSender.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSSLSender.java
@@ -31,7 +31,7 @@
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.transport.base.ParamUtils;
 import org.apache.axiom.om.OMElement;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 import org.apache.synapse.transport.utils.sslcert.CertificateVerificationConfig;
 import org.apache.synapse.transport.utils.sslcert.CertificateVerificationException;
 import org.apache.synapse.transport.utils.sslcert.adaptor.SynapseAdaptorForOcspCrl;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSender.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSender.java
index 20b0f28..826ccb3 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSender.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSender.java
@@ -59,7 +59,7 @@
 import org.apache.synapse.transport.nhttp.util.MessageFormatterDecoratorFactory;
 import org.apache.synapse.transport.nhttp.util.NhttpUtil;
 import org.apache.synapse.transport.nhttp.util.NhttpMetricsCollector;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 
 import javax.net.ssl.SSLContext;
 import java.io.IOException;
@@ -102,10 +102,9 @@
     private List<String> knownDirectHosts = new ArrayList<String>();
     /** The list of known hosts to go via proxy */
     private List<String> knownProxyHosts = new ArrayList<String>();
-    /** Weather User-Agent header coming from client should be preserved */
-    private boolean preserveUserAgentHeader = false;
-    /** Weather Server header coming from server should be preserved */
-    private boolean preserveServerHeader = true;
+    /** NHttp transporter base configurations */
+    private NHttpConfiguration cfg;
+
     /**
      * Initialize the transport sender, and execute reactor in new separate thread
      * @param cfgCtx the Axis2 configuration context
@@ -116,6 +115,7 @@
         // is this an SSL Sender?
         sslContext = getSSLContext(transportOut);
         SSLSetupHandler sslSetupHandler = getSSLSetupHandler(transportOut);
+        cfg = NHttpConfiguration.getInstance();
 
         // configure proxy settings - only supports HTTP right now (See SYNAPSE-418)
         if (sslContext == null) {
@@ -152,9 +152,6 @@
             cfgCtx.setNonReplicableProperty("warnOnHTTP500", warnOnHttp500);
         }
 
-        preserveUserAgentHeader = NHttpConfiguration.getInstance().isPreserveUserAgentHeader();
-        preserveServerHeader = NHttpConfiguration.getInstance().isPreserveServerHeader();
-
         try {
             String prefix = (sslContext == null ? "http" : "https") + "-Sender I/O dispatcher";
             ioReactor = new DefaultConnectingIOReactor(
@@ -321,17 +318,23 @@
             String headerName = (String) iter.next();
             if (HTTP.CONN_DIRECTIVE.equalsIgnoreCase(headerName) ||
                 HTTP.TRANSFER_ENCODING.equalsIgnoreCase(headerName) ||
-                HTTP.DATE_HEADER.equalsIgnoreCase(headerName) ||
                 HTTP.CONTENT_TYPE.equalsIgnoreCase(headerName) ||
                 HTTP.CONTENT_LEN.equalsIgnoreCase(headerName)) {
                 iter.remove();
             }
 
-            if (!preserveServerHeader && HTTP.SERVER_HEADER.equalsIgnoreCase(headerName)) {
+            if (HTTP.SERVER_HEADER.equalsIgnoreCase(headerName)
+                && !cfg.isPreserveHttpHeader(HTTP.SERVER_HEADER)) {
                 iter.remove();
             }
 
-            if (!preserveUserAgentHeader && HTTP.USER_AGENT.equalsIgnoreCase(headerName)) {
+            if (HTTP.USER_AGENT.equalsIgnoreCase(headerName)
+                && !cfg.isPreserveHttpHeader(HTTP.USER_AGENT)) {
+                iter.remove();
+            }
+
+            if (HTTP.DATE_HEADER.equalsIgnoreCase(headerName)
+                && !cfg.isPreserveHttpHeader(HTTP.DATE_HEADER)) {
                 iter.remove();
             }
         }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NHttpConfiguration.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NHttpConfiguration.java
index 953387f..e65cc31 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NHttpConfiguration.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NHttpConfiguration.java
@@ -19,9 +19,11 @@
 
 package org.apache.synapse.transport.nhttp;
 
+import org.apache.http.protocol.HTTP;
 import org.apache.synapse.transport.utils.config.HttpTransportConfiguration;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -57,7 +59,8 @@
 
     private static NHttpConfiguration _instance = new NHttpConfiguration();
     private List<String> methods;
-
+    //Preserve HTTP headers
+    private List<String> preserveHeaders;
     /** Comma separated list of blocked uris*/
     public static final String BLOCK_SERVICE_LIST = "http.block_service_list";
     /** Default value for BLOCK_SERVICE_LIST*/
@@ -65,6 +68,7 @@
     
     private NHttpConfiguration() {
         super("nhttp");
+        populatePreserveHttpHeaders();
     }
 
     @Override
@@ -116,14 +120,6 @@
         return getIntProperty(NhttpConstants.DISABLE_KEEPALIVE, 0) == 1;
     }
 
-    public boolean isPreserveUserAgentHeader() {
-        return getBooleanProperty(NhttpConstants.USER_AGENT_HEADER_PRESERVE, false);
-    }
-
-    public boolean isPreserveServerHeader() {
-        return getBooleanProperty(NhttpConstants.SERVER_HEADER_PRESERVE, true);
-    }
-
     public boolean isCountConnections() {
         return getBooleanProperty(NhttpConstants.COUNT_CONNECTIONS, false);
     }
@@ -143,4 +139,42 @@
         return methods.contains(method);
     }
 
+    /**
+     * Check preserving status of the http header field
+     *
+     * @param httpHeader http header name
+     * @return return true if preserve else false
+     */
+    public boolean isPreserveHttpHeader(String httpHeader) {
+        if (preserveHeaders == null || preserveHeaders.isEmpty() || httpHeader == null) {
+            return false;
+        } else {
+            return preserveHeaders.contains(httpHeader.toUpperCase());
+        }
+    }
+
+    private void populatePreserveHttpHeaders() {
+        if (preserveHeaders == null) {
+            preserveHeaders = new ArrayList<String>();
+            String presHeaders = getStringProperty(NhttpConstants.HTTP_HEADERS_PRESERVE, "");
+
+            if (presHeaders != null && !presHeaders.isEmpty()) {
+                String[] splitHeaders = presHeaders.toUpperCase().trim().split(",");
+
+                if (splitHeaders != null && splitHeaders.length > 0) {
+                    preserveHeaders.addAll(Arrays.asList(splitHeaders));
+                }
+            }
+
+            if (getBooleanProperty(NhttpConstants.SERVER_HEADER_PRESERVE, true)
+                && !preserveHeaders.contains(HTTP.SERVER_HEADER.toUpperCase())) {
+                preserveHeaders.add(HTTP.SERVER_HEADER.toUpperCase());
+            }
+
+            if (getBooleanProperty(NhttpConstants.USER_AGENT_HEADER_PRESERVE, false)
+                && !preserveHeaders.contains(HTTP.USER_AGENT.toUpperCase())) {
+                preserveHeaders.add(HTTP.USER_AGENT.toUpperCase());
+            }
+        }
+    }
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java
index 5e17947..b3ecc97 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java
@@ -53,6 +53,9 @@
     public static final String REQUEST_CONTENT_TYPE = "DEFAULT_REQUEST_CONTENT_TYPE";
     public static final String DEFAULT_CONTENT_TYPE = "application/octet-stream";
 
+    public static final String CLIENT_REMOTE_ADDR = "CLIENT_REMOTE_ADDR";
+    public static final String CLIENT_REMOTE_PORT = "CLIENT_REMOTE_PORT";
+
     public static final String SEND_TIMEOUT = "SEND_TIMEOUT";
 
     public static final String HIDDEN_SERVICE_PARAM_NAME = "hiddenService";
@@ -78,6 +81,12 @@
      * */
     public static final String SERVER_HEADER_PRESERVE = "http.server.preserve";
 
+    /**
+     * Defines weather synapse needs to preserve the original Http headers. Configures
+     * through nhttp.properties file
+     */
+    public static final String HTTP_HEADERS_PRESERVE = "http.headers.preserve";
+
     /** Denotes a connection close is forced if set at the NhttpContext */
     public static final String FORCE_CLOSING = "forceClosing";
     /** Denotes a message is being processed by the current connection if this is set at the context */
@@ -163,4 +172,10 @@
 
     //property name of nhttp log directory
     public static final String NHTTP_LOG_DIRECTORY = "nhttp.log.directory";
+    
+	/**
+	 * This holds a MultiValue Map, which keeps transport headers' values other
+	 * than last value (in order they appear) against the transport header.
+	 */
+	public static final String EXCESS_TRANSPORT_HEADERS = "EXCESS_TRANSPORT_HEADERS";
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ServerHandler.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ServerHandler.java
index dc8e142..8305e0d 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ServerHandler.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/ServerHandler.java
@@ -29,6 +29,7 @@
 import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
+import org.apache.http.message.BasicHttpResponse;
 import org.apache.http.nio.*;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.nio.util.ContentOutputBuffer;
@@ -52,6 +53,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -205,6 +207,17 @@
                 int priority = parser.parse(evaluatorContext);
                 executor.execute(worker, priority);
             }
+            
+            // See if the client expects a 100-Continue
+            Header expect = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);
+            if (expect != null && HTTP.EXPECT_CONTINUE.equalsIgnoreCase(expect.getValue())) {
+                HttpResponse ack = new BasicHttpResponse(request.getProtocolVersion(), HttpStatus.SC_CONTINUE, "Continue");
+                conn.submitResponse(ack);
+                if (log.isDebugEnabled()) {
+                 log.debug("Expect :100 Continue hit sending ack back to the server");
+                }
+                return;
+            }
 
         } catch (Exception e) {
             if (metrics != null) {
@@ -263,7 +276,7 @@
 
         if (outBuf == null) {
             // fix for SYNAPSE 584. This is a temporarily fix because of HTTPCORE-208
-            shutdownConnection(conn);
+            shutdownConnection(conn, false, null);
             return;
         }
 
@@ -367,10 +380,10 @@
 
             conn.submitResponse(response);
         } catch (HttpException e) {
-            shutdownConnection(conn);
+            shutdownConnection(conn, true, e.getMessage());
             throw e;
         } catch (IOException e) {
-            shutdownConnection(conn);
+            shutdownConnection(conn, true, e.getMessage());
             throw e;
         }
     }
@@ -387,13 +400,15 @@
             if (log.isDebugEnabled()) {
                 log.debug("Keepalive connection was closed");
             }
+            shutdownConnection(conn, false, null);
         } else {
-            log.error("Connection Timeout - before message body was fully read : " + conn);
+            String msg = "Connection Timeout - before message body was fully read : " + conn;
+            log.error(msg);
             if (metrics != null) {
                 metrics.incrementTimeoutsReceiving();
             }
+            shutdownConnection(conn, true, msg);
         }
-        shutdownConnection(conn);
     }
 
     public void connected(final NHttpServerConnection conn) {
@@ -441,7 +456,7 @@
     public void closed(final NHttpServerConnection conn) {
 
         HttpContext context = conn.getContext();
-        shutdownConnection(conn);
+        shutdownConnection(conn, false, null);
         context.removeAttribute(REQUEST_SINK_BUFFER);
         context.removeAttribute(RESPONSE_SOURCE_BUFFER);
         context.removeAttribute(CONNECTION_CREATION_TIME);
@@ -505,11 +520,12 @@
         } else if (e instanceof IOException) {
             exception(conn, (IOException) e);
         } else {
-            log.error("Unexpected error: " + e.getClass().getName(), e);
+            String errMsg = "Unexpected error: " + e.getClass().getName();
+            log.error(errMsg, e);
             if (metrics != null) {
                 metrics.incrementFaultsReceiving();
             }
-            shutdownConnection(conn);
+            shutdownConnection(conn, true, errMsg);
         }
     }
 
@@ -519,31 +535,36 @@
      * @param e the exception encountered
      */
     public void exception(NHttpServerConnection conn, IOException e) {
+        String errMsg = "I/O error : " + e.getMessage();
         if (e instanceof ConnectionClosedException || (e.getMessage() != null &&
                 e.getMessage().contains("Connection reset by peer") ||
                 e.getMessage().contains("forcibly closed"))) {
             if (log.isDebugEnabled()) {
-                log.debug("I/O error (Probably the keepalive connection " +
-                        "was closed):" + e.getMessage());
+                errMsg = "I/O error (Probably the keepalive connection " +
+                        "was closed):" + e.getMessage();
+                log.debug(errMsg);
             }
         } else if (e.getMessage() != null) {
-            String msg = e.getMessage().toLowerCase();
-            if (msg.indexOf("broken") != -1) {
-                log.warn("I/O error (Probably the connection " +
-                        "was closed by the remote party):" + e.getMessage());
+            errMsg = e.getMessage().toLowerCase();
+            if (errMsg.indexOf("broken") != -1) {
+                errMsg = "I/O error (Probably the connection " +
+                        "was closed by the remote party):" + e.getMessage();
+                log.warn(errMsg);
             } else {
-                log.error("I/O error: " + e.getMessage(), e);
+                errMsg = "I/O error: " + e.getMessage();
+                log.error(errMsg, e);
             }
             if (metrics != null) {
                 metrics.incrementFaultsReceiving();
             }
         } else {
-            log.error("Unexpected I/O error: " + e.getClass().getName(), e);
+            errMsg = "Unexpected I/O error: " + e.getMessage();
+            log.error(errMsg, e);
             if (metrics != null) {
                 metrics.incrementFaultsReceiving();
             }
         }
-        shutdownConnection(conn);
+        shutdownConnection(conn, true, errMsg);
     }
 
     // ----------- utility methods -----------
@@ -551,15 +572,17 @@
     private void handleException(String msg, Exception e, NHttpServerConnection conn) {
         log.error(msg, e);
         if (conn != null) {
-            shutdownConnection(conn);
+            shutdownConnection(conn, true, e.getMessage());
         }
     }
 
     /**
      * Shutdown the connection ignoring any IO errors during the process
      * @param conn the connection to be shutdown
+     * @param isError whether shutdown is due to an error
+     * @param errorMsg error message if shutdown happens on error
      */
-    private void shutdownConnection(final NHttpServerConnection conn) {
+    private void shutdownConnection(final NHttpServerConnection conn, boolean isError, String errorMsg) {
         SharedOutputBuffer outputBuffer = (SharedOutputBuffer)
             conn.getContext().getAttribute(RESPONSE_SOURCE_BUFFER);
         if (outputBuffer != null) {
@@ -571,6 +594,39 @@
             inputBuffer.close();
         }
 
+        if (log.isWarnEnabled() && (isError || log.isDebugEnabled()) && conn instanceof HttpInetConnection) {
+
+            HttpInetConnection inetConnection = (HttpInetConnection) conn;
+            InetAddress remoteAddress = inetConnection.getRemoteAddress();
+            int remotePort = inetConnection.getRemotePort();
+
+            String msg;
+            if (remotePort != -1 && remoteAddress != null) {  // If connection is still alive
+                msg = "Connection from remote address : "
+                        + remoteAddress + ":" + remotePort
+                        + " to local address : "
+                        + inetConnection.getLocalAddress() + ":" + inetConnection.getLocalPort() +
+                        " is closed!"
+                        + (errorMsg != null ? " - On error : " + errorMsg : "");
+
+            } else {  // if connection is already closed. obtain params from http context
+                HttpContext httpContext = conn.getContext();
+                msg = "Connection from remote address : "
+                        + httpContext.getAttribute(NhttpConstants.CLIENT_REMOTE_ADDR)
+                        + ":" + httpContext.getAttribute(NhttpConstants.CLIENT_REMOTE_PORT)
+                        + " to local address : "
+                        + inetConnection.getLocalAddress() + ":" + inetConnection.getLocalPort() +
+                        " is closed!"
+                        + (errorMsg != null ? " - On error : " + errorMsg : "");
+            }
+
+            if (isError) {
+                log.warn(msg);
+            } else {
+                log.debug(msg);
+            }
+        }
+
         synchronized (this) {
             if (activeConnections.remove(conn) && log.isDebugEnabled()) {
                 log.debug("Removing the connection : " + conn
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/util/RESTUtil.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/util/RESTUtil.java
index 9a7ecf3..b4e3946 100755
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/util/RESTUtil.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/util/RESTUtil.java
@@ -53,6 +53,10 @@
  */
 public class RESTUtil {
 
+   private static RequestURIOperationDispatcher requestURIOperationDispatcher = new RequestURIOperationDispatcher();
+   private static HTTPLocationBasedDispatcher httpLocationBasedDispatcher = new HTTPLocationBasedDispatcher();
+   private static RequestURIBasedDispatcher requestDispatcher = new RequestURIBasedDispatcher();
+
     /**
      * This method will return the URI part for the GET HTTPRequest by converting
      * the SOAP infoset to the URL-encoded GET format
@@ -295,16 +299,11 @@
     }
     
     public static void dispatchAndVerify(MessageContext msgContext) throws AxisFault {
-        RequestURIBasedDispatcher requestDispatcher = new RequestURIBasedDispatcher();
         requestDispatcher.invoke(msgContext);
         AxisService axisService = msgContext.getAxisService();
         if (axisService != null) {
-            HTTPLocationBasedDispatcher httpLocationBasedDispatcher =
-                    new HTTPLocationBasedDispatcher();
             httpLocationBasedDispatcher.invoke(msgContext);
             if (msgContext.getAxisOperation() == null) {
-                RequestURIOperationDispatcher requestURIOperationDispatcher =
-                        new RequestURIOperationDispatcher();
                 requestURIOperationDispatcher.invoke(msgContext);
             }
 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java
index 9dd739e..9263d93 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java
@@ -36,6 +36,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.transport.nhttp.NhttpConstants;
+import org.apache.synapse.transport.passthru.config.TargetConfiguration;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
@@ -49,8 +50,8 @@
 
     private static final Log log = LogFactory.getLog(ClientWorker.class);
 
-    /** the Axis2 configuration context */
-    private ConfigurationContext cfgCtx = null;
+    /** the Http connectors configuration context */
+    private TargetConfiguration targetConfiguration = null;
 
     /** the response message context that would be created */
     private MessageContext responseMsgCtx = null;
@@ -61,20 +62,22 @@
     /** weather a body is expected or not */
     private boolean expectEntityBody = true;
 
-    public ClientWorker(ConfigurationContext cfgCtx,
+    public ClientWorker(TargetConfiguration targetConfiguration,
                         MessageContext outMsgCtx,
                         TargetResponse response) {
-        this.cfgCtx = cfgCtx;
+        this.targetConfiguration = targetConfiguration;
         this.response = response;
         this.expectEntityBody = response.isExpectResponseBody();
 
         Map<String,String> headers = response.getHeaders();
+        Map excessHeaders = response.getExcessHeaders();
       
 		String oriURL = headers.get(PassThroughConstants.LOCATION);
 		
 		// Special casing 302 scenario in following section. Not sure whether it's the correct fix,
 		// but this fix makes it possible to do http --> https redirection.
-		if (oriURL != null && response.getStatus() != HttpStatus.SC_MOVED_TEMPORARILY) {
+		if (oriURL != null && response.getStatus() != HttpStatus.SC_MOVED_TEMPORARILY && !targetConfiguration
+                .isPreserveHttpHeader(PassThroughConstants.LOCATION)) {
 			URL url;
 			try {
 				url = new URL(oriURL);
@@ -141,6 +144,11 @@
             headerMap.put(headerEntry.getKey(), headerEntry.getValue());
         }
         responseMsgCtx.setProperty(MessageContext.TRANSPORT_HEADERS, headerMap);
+        responseMsgCtx.setProperty(NhttpConstants.EXCESS_TRANSPORT_HEADERS, excessHeaders);
+        if (headerMap.get(HTTP.CONTENT_LEN) != null){
+            responseMsgCtx.setProperty(PassThroughConstants.ORIGINAL_CONTENT_LENGTH,
+                    headerMap.get(HTTP.CONTENT_LEN));
+        }
 
         if (response.getStatus() == 202) {
             responseMsgCtx.setProperty(AddressingConstants.
@@ -236,7 +244,7 @@
             return cTypeProperty.toString();
         }
         // Try to get the content type from the axis configuration
-        Parameter cTypeParam = cfgCtx.getAxisConfiguration().getParameter(
+        Parameter cTypeParam = targetConfiguration.getConfigurationContext().getAxisConfiguration().getParameter(
                 PassThroughConstants.CONTENT_TYPE);
         if (cTypeParam != null) {
             return cTypeParam.getValue().toString();
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/DeliveryAgent.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/DeliveryAgent.java
index 372f069..38ab070 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/DeliveryAgent.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/DeliveryAgent.java
@@ -145,6 +145,11 @@
                 }
                 targetErrorHandler.handleError(msgCtx, errorCode, errorMessage,
                         null, ProtocolState.REQUEST_READY);
+                synchronized (msgCtx) {
+                    msgCtx.setProperty(PassThroughConstants.WAIT_BUILDER_IN_STREAM_COMPLETE,
+                                       Boolean.TRUE);
+                    msgCtx.notifyAll();
+                }
             }
         } else {
             throw new IllegalStateException("Queue cannot be null for: " + key);
@@ -216,8 +221,8 @@
                     PassThroughConstants.MESSAGE_BUILDER_INVOKED))) {
                 synchronized (msgContext) {
                     OutputStream out = pipe.getOutputStream();
-                    msgContext.setProperty("GET_ME_OUT", out);
-                    msgContext.setProperty("READY2ROCK", Boolean.TRUE);
+                    msgContext.setProperty(PassThroughConstants.BUILDER_OUTPUT_STREAM, out);
+                    msgContext.setProperty(PassThroughConstants.WAIT_BUILDER_IN_STREAM_COMPLETE, Boolean.TRUE);
                     msgContext.notifyAll();
                 }
                 return;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughConstants.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughConstants.java
index 7620a8e..64c5ffe 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughConstants.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughConstants.java
@@ -74,9 +74,9 @@
 
     protected static final String PASS_THROUGH_TRANSPORT_WORKER_POOL =
             "PASS_THROUGH_TRANSPORT_WORKER_POOL";
-    protected static final String PASS_THROUGH_SOURCE_CONFIGURATION =
+    public static final String PASS_THROUGH_SOURCE_CONFIGURATION =
             "PASS_THROUGH_SOURCE_CONFIGURATION";
-    protected static final String PASS_THROUGH_SOURCE_CONNECTION = "pass-through.Source-Connection";
+    public static final String PASS_THROUGH_SOURCE_CONNECTION = "pass-through.Source-Connection";
     protected static final String PASS_THROUGH_SOURCE_REQUEST = "pass-through.Source-Request";
 
     protected static final String PASS_THROUGH_TARGET_CONNECTION = "pass-through.Target-Connection";
@@ -125,5 +125,20 @@
 	public static final String FORCE_PASS_THROUGH_BUILDER = "force.passthrough.builder";
 	
 	public static final String GET_REQUEST_HANDLED = "GET_REQUEST_HANDLED";
+	
+	public static final String WAIT_BUILDER_IN_STREAM_COMPLETE="WAIT_BUILDER_IN_STREAM_COMPLETE"; 
+ 	
+	public static final String BUILDER_OUTPUT_STREAM="BUILDER_OUTPUT_STREAM";
+	
+	public static final String PASSTHRU_CONNECT_ERROR="PASSTHRU_CONNECT_ERROR";
 
+    public static final String COPY_CONTENT_LENGTH_FROM_INCOMING="COPY_CONTENT_LENGTH_FROM_INCOMING";
+    
+    public static final String ORIGINAL_CONTENT_LENGTH ="ORIGINAL_CONTENT_LENGTH";
+    
+    //Http method type constants to be used in synapse
+    public static final String HTTP_HEAD = "HEAD";
+
+    //use to create source buffer in passthrough transport
+    public static final String SOURCE ="source";
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpListener.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpListener.java
index 32400ab..81a12c2 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpListener.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpListener.java
@@ -49,7 +49,7 @@
 import org.apache.synapse.transport.passthru.config.SourceConfiguration;
 import org.apache.synapse.transport.passthru.jmx.PassThroughTransportMetricsCollector;
 import org.apache.synapse.transport.passthru.jmx.TransportView;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 
 import javax.net.ssl.SSLContext;
 import java.io.IOException;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLListener.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLListener.java
index 81605c3..a0b9761 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLListener.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLListener.java
@@ -28,7 +28,7 @@
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 
 import javax.net.ssl.*;
 import javax.xml.namespace.QName;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLSender.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLSender.java
index c7aed4d..7742ead 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLSender.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSSLSender.java
@@ -29,7 +29,7 @@
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 import org.apache.synapse.transport.utils.sslcert.CertificateVerificationConfig;
 import org.apache.synapse.transport.utils.sslcert.CertificateVerificationException;
 import org.apache.synapse.transport.utils.sslcert.adaptor.SynapseAdaptorForOcspCrl;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSender.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSender.java
index 2c53555..4a774b1 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSender.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSender.java
@@ -19,8 +19,9 @@
 
 package org.apache.synapse.transport.passthru;
 
+import org.apache.axiom.blob.Blobs;
+import org.apache.axiom.blob.OverflowableBlob;
 import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.util.blob.OverflowBlob;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingConstants;
@@ -38,6 +39,7 @@
 import org.apache.axis2.transport.base.threads.NativeThreadFactory;
 import org.apache.axis2.transport.base.threads.WorkerPool;
 import org.apache.axis2.util.MessageProcessorSelector;
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.HttpException;
@@ -61,10 +63,9 @@
 import org.apache.synapse.transport.passthru.jmx.TransportView;
 import org.apache.synapse.transport.passthru.util.PassThroughTransportUtils;
 import org.apache.synapse.transport.passthru.util.SourceResponseFactory;
-import org.apache.synapse.transport.utils.logging.LoggingUtils;
+import org.apache.synapse.transport.utils.conn.logging.LoggingUtils;
 
 import javax.net.ssl.SSLContext;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
@@ -246,9 +247,7 @@
 
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
         // remove unwanted HTTP headers (if any from the current message)
-        PassThroughTransportUtils.removeUnwantedHeaders(msgContext,
-                targetConfiguration.isPreserveServerHeader(),
-                targetConfiguration.isPreserveUserAgentHeader());
+        PassThroughTransportUtils.removeUnwantedHeaders(msgContext, targetConfiguration);
 
         if (AddressingHelper.isReplyRedirected(msgContext)
                 && !msgContext.getReplyTo().hasNoneAddress()) {
@@ -359,10 +358,24 @@
     }
 
 	private void sendRequestContent(final MessageContext msgContext) throws AxisFault {
+        // NOTE:this a special case where, when the backend service expects content-length but,
+        // we don't want the message to be built. If FORCE_HTTP_CONTENT_LENGTH and
+        // COPY_CONTENT_LENGTH_FROM_INCOMING, we assume that the content coming from the
+        // client side has not changed.
+        boolean forceContentLength = msgContext.isPropertyTrue(NhttpConstants.FORCE_HTTP_CONTENT_LENGTH);
+        boolean copyContentLength = msgContext.isPropertyTrue(PassThroughConstants.COPY_CONTENT_LENGTH_FROM_INCOMING);
+
+        if (forceContentLength && copyContentLength &&
+                msgContext.getProperty(PassThroughConstants.ORIGINAL_CONTENT_LENGTH) != null) {
+            long contentLength = Long.parseLong((String) msgContext.getProperty(
+                    PassThroughConstants.ORIGINAL_CONTENT_LENGTH));
+            msgContext.setProperty(PassThroughConstants.PASS_THROUGH_MESSAGE_LENGTH, contentLength);
+        }
+
 		if (Boolean.TRUE.equals(msgContext.getProperty(PassThroughConstants.MESSAGE_BUILDER_INVOKED))) {
 			synchronized (msgContext) {
-				while (!Boolean.TRUE.equals(msgContext.getProperty("READY2ROCK")) &&
-				       !Boolean.TRUE.equals(msgContext.getProperty("PASSTHRU_CONNECT_ERROR"))) {
+				while (!Boolean.TRUE.equals(msgContext.getProperty(PassThroughConstants.WAIT_BUILDER_IN_STREAM_COMPLETE)) &&
+	 				       !Boolean.TRUE.equals(msgContext.getProperty(PassThroughConstants.PASSTHRU_CONNECT_ERROR))) {
 					try {
 						msgContext.wait();
 					} catch (InterruptedException e) {
@@ -371,11 +384,11 @@
 				}
 			}
 
-			if (Boolean.TRUE.equals(msgContext.getProperty("PASSTHRU_CONNECT_ERROR"))) {
+			if (Boolean.TRUE.equals(msgContext.getProperty(PassThroughConstants.PASSTHRU_CONNECT_ERROR))) {
 				return;
 			}
 
-			OutputStream out = (OutputStream) msgContext.getProperty("GET_ME_OUT");
+			OutputStream out = (OutputStream) msgContext.getProperty(PassThroughConstants.BUILDER_OUTPUT_STREAM);
 			if (out != null) {
 				String disableChunking = (String) msgContext.getProperty(
                         PassThroughConstants.DISABLE_CHUNKING);
@@ -383,21 +396,27 @@
                         PassThroughConstants.FORCE_HTTP_1_0);
 				Pipe pipe = (Pipe) msgContext.getProperty(PassThroughConstants.PASS_THROUGH_PIPE);
 				
-				if("true".equals(disableChunking) || "true".equals(forceHttp10) ){
-					ByteArrayOutputStream _out = new ByteArrayOutputStream();
+				if ("true".equals(disableChunking) || "true".equals(forceHttp10) ){
 					MessageFormatter formatter =  MessageProcessorSelector.getMessageFormatter(
                             msgContext);
 					OMOutputFormat format = PassThroughTransportUtils.getOMOutputFormat(msgContext);
-					formatter.writeTo(msgContext, format, _out, false);
+                    OverflowableBlob serialized = null;
                     try {
-                        long messageSize = setStreamAsTempData(formatter, msgContext, format);
-                        msgContext.setProperty(
-                                PassThroughConstants.PASS_THROUGH_MESSAGE_LENGTH, messageSize);
-                        formatter.writeTo(msgContext, format, out, false);
+                        serialized = setStreamAsTempData(formatter, msgContext, format);
+                        msgContext.setProperty(PassThroughConstants.PASS_THROUGH_MESSAGE_LENGTH,
+                                serialized.getSize());
+                        serialized.writeTo(out);
                     } catch (IOException e) {
                     	 handleException("I/O error while serializing message", e);
+                    } finally {
+                        if (serialized != null) {
+                            try {
+                                serialized.release();
+                            } catch (IOException ignored) {
+                            }
+                        }
                     }
-                	pipe.setSerializationComplete(true);
+                    pipe.setSerializationComplete(true);
 				} else {
 					if ((disableChunking == null || !"true".equals(disableChunking)) ||
 					    (forceHttp10 == null || !"true".equals(forceHttp10))) {
@@ -409,7 +428,7 @@
 					}
 					
 					if (isCompleteWithoutData(msgContext)) {
-							pipe.setSerializationCompleteWithoutData(true);
+                        pipe.setSerializationCompleteWithoutData(true);
 					} else {
 						pipe.setSerializationComplete(true);
 					}
@@ -497,6 +516,7 @@
         SourceResponse sourceResponse = SourceResponseFactory.create(msgContext,
                 sourceRequest, sourceConfiguration);
 
+        sourceResponse.processChunkingOptions(msgContext);
         SourceContext.setResponse(conn, sourceResponse);
 
         Boolean noEntityBody = (Boolean) msgContext.getProperty(PassThroughConstants.NO_ENTITY_BODY);
@@ -556,7 +576,7 @@
             }
 
             SourceContext.updateState(conn, ProtocolState.CLOSED);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         }
     }
 
@@ -589,7 +609,7 @@
     }
 
     /**
-     * Write the stream to a temporary storage and calculate the content length
+     * Write the stream to a temporary storage and return a handle to the temporary storage
      *
      * @param messageFormatter Formatter used to serialize the message
      * @param msgContext Message to be serialized
@@ -597,18 +617,19 @@
      *
      * @throws IOException if an exception occurred while writing data
      */
-    private long setStreamAsTempData(MessageFormatter messageFormatter,
+    private OverflowableBlob setStreamAsTempData(MessageFormatter messageFormatter,
                                      MessageContext msgContext,
                                      OMOutputFormat format) throws IOException {
 
-        OverflowBlob serialized = new OverflowBlob(256, 4096, "http-nio_", ".dat");
+        OverflowableBlob serialized = Blobs.createOverflowableBlob(4096, "http-nio_",
+                ".dat", FileUtils.getTempDirectory());
         OutputStream out = serialized.getOutputStream();
         try {
             messageFormatter.writeTo(msgContext, format, out, true);
         } finally {
             out.close();
         }
-        return serialized.getLength();
+        return serialized;
     }
 
     private boolean isBypass(String hostName) {
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/Pipe.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/Pipe.java
index 89f055e..2a8a40b 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/Pipe.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/Pipe.java
@@ -23,10 +23,9 @@
 import org.apache.http.nio.ContentDecoder;
 import org.apache.http.nio.ContentEncoder;
 import org.apache.synapse.transport.passthru.config.BaseConfiguration;
+import org.apache.synapse.transport.passthru.util.ControlledByteBuffer;
 
 import java.io.*;
-import java.nio.ByteBuffer;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -43,9 +42,9 @@
     private IOControl consumerIoControl;
 
     /** Fixed size buffer to read and write data */
-    private ByteBuffer buffer;
+    private ControlledByteBuffer buffer;
 
-    private ByteBuffer outputBuffer;
+    private ControlledByteBuffer outputBuffer;
 
     private boolean producerCompleted = false;
 
@@ -70,13 +69,10 @@
 
   	private boolean hasHttpProducer = true;
 
-    private AtomicBoolean inBufferInputMode = new AtomicBoolean(true);
-    private AtomicBoolean outBufferInputMode;
-
     private ByteBufferInputStream inputStream;
     private ByteBufferOutputStream outputStream;
 
-    public Pipe(IOControl producerIoControl, ByteBuffer buffer,
+    public Pipe(IOControl producerIoControl, ControlledByteBuffer buffer,
                 String name, BaseConfiguration baseConfig) {
         this.producerIoControl = producerIoControl;
         this.buffer = buffer;
@@ -84,7 +80,7 @@
         this.baseConfig = baseConfig;
     }
 
-    public Pipe(ByteBuffer buffer, String name, BaseConfiguration baseConfig) {
+    public Pipe(ControlledByteBuffer buffer, String name, BaseConfiguration baseConfig) {
         this.buffer = buffer;
         this.name += "_" + name;
         this.baseConfig = baseConfig;
@@ -118,14 +114,11 @@
         }
 
         lock.lock();
-        ByteBuffer consumerBuffer;
-        AtomicBoolean inputMode;
+        ControlledByteBuffer consumerBuffer;
         if (outputBuffer != null) {
             consumerBuffer = outputBuffer;
-            inputMode = outBufferInputMode;
         } else {
             consumerBuffer = buffer;
-            inputMode = inBufferInputMode;
         }
         try {
             // if producer at error we have to stop the encoding and return immediately
@@ -134,9 +127,9 @@
                 return -1;
             }
 
-            setOutputMode(consumerBuffer, inputMode);
-            int bytesWritten = encoder.write(consumerBuffer);
-            setInputMode(consumerBuffer, inputMode);
+            setOutputMode(consumerBuffer);
+            int bytesWritten = encoder.write(consumerBuffer.getByteBuffer());
+            setInputMode(consumerBuffer);
 
             if (consumerBuffer.position() == 0) {
                 if (outputBuffer == null) {
@@ -179,8 +172,8 @@
 
         lock.lock();
         try {
-            setInputMode(buffer, inBufferInputMode);
-            int bytesRead = decoder.read(buffer);
+            setInputMode(buffer);
+            int bytesRead = decoder.read(buffer.getByteBuffer());
 
             // if consumer is at error we have to let the producer complete
             if (consumerError) {
@@ -258,7 +251,6 @@
     public synchronized OutputStream getOutputStream() {
         if (outputStream == null) {
             outputBuffer = baseConfig.getBufferFactory().getBuffer();
-            outBufferInputMode = new AtomicBoolean(true);
             outputStream = new ByteBufferOutputStream();
         }
         return outputStream;
@@ -267,7 +259,7 @@
     public synchronized void setSerializationComplete(boolean serializationComplete) {
         if (!this.serializationComplete) {
             this.serializationComplete = serializationComplete;
-            if (consumerIoControl != null && hasData(outputBuffer, outBufferInputMode)) {
+            if (consumerIoControl != null && hasData(outputBuffer)) {
                 consumerIoControl.requestOutput();
             }
         }
@@ -284,12 +276,16 @@
     	this.rawSerializationComplete = rawSerializationComplete;
     }
 
-	public ByteBuffer getBuffer() {
+	public ControlledByteBuffer getBuffer() {
         return buffer;
     }
 
-    private void setInputMode(ByteBuffer buffer, AtomicBoolean inputMode) {
-        if (inputMode.compareAndSet(false, true)) {
+    public synchronized boolean isSerializationComplete(){
+        return serializationComplete;
+    }
+
+    private void setInputMode(ControlledByteBuffer buffer) {
+        if (buffer.setInputMode()) {
             if (buffer.hasRemaining()) {
                 buffer.compact();
             } else {
@@ -298,16 +294,16 @@
         }
     }
 
-    private void setOutputMode(ByteBuffer buffer, AtomicBoolean inputMode) {
-        if (inputMode.compareAndSet(true, false)) {
+    private void setOutputMode(ControlledByteBuffer buffer) {
+        if (buffer.setOutputMode()) {
             buffer.flip();
         }
     }
 
-    private boolean hasData(ByteBuffer buffer, AtomicBoolean inputMode) {
+    private boolean hasData(ControlledByteBuffer buffer) {
         lock.lock();
         try {
-            setOutputMode(buffer, inputMode);
+            setOutputMode(buffer);
             return buffer.hasRemaining();
         } finally {
             lock.unlock();
@@ -320,8 +316,11 @@
         public int read() throws IOException {
             lock.lock();
             try {
-                if (!hasData(buffer, inBufferInputMode)) {
+                if (!hasData(buffer)) {
                     waitForData();
+                    if (producerError) {
+                        return -1;
+                    }
                 }
                 if (isEndOfStream()) {
                     return -1;
@@ -339,13 +338,13 @@
 
             lock.lock();
             try {
-                if (!hasData(buffer, inBufferInputMode)) {
+                if (!hasData(buffer)) {
                     waitForData();
                 }
                 if (isEndOfStream()) {
                     return -1;
                 }
-                setOutputMode(buffer, inBufferInputMode);
+                setOutputMode(buffer);
                 int chunk = len;
                 if (chunk > buffer.remaining()) {
                     chunk = buffer.remaining();
@@ -361,7 +360,10 @@
             lock.lock();
             try {
                 try {
-                    while (!hasData(buffer, inBufferInputMode) && !producerCompleted) {
+                    while (!hasData(buffer) && !producerCompleted) {
+                        if (producerError) {
+                            break;
+                        }
                         producerIoControl.requestInput();
                         readCondition.await();
                     }
@@ -374,7 +376,7 @@
         }
 
         private boolean isEndOfStream() {
-            return !hasData(buffer, inBufferInputMode) && producerCompleted;
+            return !hasData(buffer) && producerCompleted;
         }
     }
 
@@ -384,10 +386,10 @@
         public void write(int b) throws IOException {
             lock.lock();
             try {
-                setInputMode(outputBuffer, outBufferInputMode);
+                setInputMode(outputBuffer);
                 if (!outputBuffer.hasRemaining()) {
                     flushContent();
-                    setInputMode(outputBuffer, outBufferInputMode);
+                    setInputMode(outputBuffer);
                 }
                 outputBuffer.put((byte) b);
             } finally {
@@ -401,12 +403,16 @@
             }
             lock.lock();
             try {
-                setInputMode(outputBuffer, outBufferInputMode);
+                setInputMode(outputBuffer);
                 int remaining = len;
                 while (remaining > 0) {
                     if (!outputBuffer.hasRemaining()) {
                         flushContent();
-                        setInputMode(outputBuffer, outBufferInputMode);
+                        if (consumerError) {
+                            buffer.clear();
+                            break;
+                        }
+                        setInputMode(outputBuffer);
                     }
                     int chunk = Math.min(remaining, outputBuffer.remaining());
                     outputBuffer.put(b, off, chunk);
@@ -427,7 +433,10 @@
             
             try {
                 try {
-					while (hasData(outputBuffer, outBufferInputMode)) {
+					while (hasData(outputBuffer)) {
+                        if(consumerError) {
+                            break;
+                        }
 						if (consumerIoControl != null && writeCondition != null) {
 							consumerIoControl.requestOutput();
 							writeCondition.await();
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ServerWorker.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ServerWorker.java
index dc74425..ca6dac6 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ServerWorker.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ServerWorker.java
@@ -430,6 +430,7 @@
      * @return the Axis2 message context created
      */
     private MessageContext createMessageContext(SourceRequest request) {
+    	Map excessHeaders = request.getExcessHeaders();
         ConfigurationContext cfgCtx = sourceConfiguration.getConfigurationContext();
         MessageContext msgContext =
                 new MessageContext();
@@ -477,6 +478,12 @@
             headers.put(entry.getKey(), entry.getValue());
         }
         msgContext.setProperty(MessageContext.TRANSPORT_HEADERS, headers);
+        msgContext.setProperty(NhttpConstants.EXCESS_TRANSPORT_HEADERS, excessHeaders);
+        
+        if (headers.get(HTTP.CONTENT_LEN) != null){
+            msgContext.setProperty(PassThroughConstants.ORIGINAL_CONTENT_LENGTH,
+                    headers.get(HTTP.CONTENT_LEN));
+        }
 
         // Following section is required for throttling to work
         
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceContext.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceContext.java
index ff6cb54..b177719 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceContext.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceContext.java
@@ -21,8 +21,7 @@
 
 import org.apache.http.nio.NHttpConnection;
 import org.apache.synapse.transport.passthru.config.SourceConfiguration;
-
-import java.nio.ByteBuffer;
+import org.apache.synapse.transport.passthru.util.ControlledByteBuffer;
 
 /**
  * This class represents the information about a TCP Connection at a given point in time.
@@ -75,7 +74,24 @@
         this.response = response;
     }
 
+    /**
+     * Reset the resources associated with this context
+     */
     public void reset() {
+        reset(false);
+    }
+
+    /**
+     * Reset the resources associated with this context
+     *
+     * @param isError whether an error is causing this shutdown of the connection.
+     *                It is very important to set this flag correctly.
+     *                When an error causing the shutdown of the connections we should not
+     *                release associated writer buffer to the pool as it might lead into
+     *                situations like same buffer is getting released to both source and target
+     *                buffer factories
+     */
+    public void reset(boolean isError) {
         this.request = null;
         this.response = null;
         if (this.state != ProtocolState.CLOSED) {
@@ -84,8 +100,8 @@
             this.state = ProtocolState.REQUEST_READY;
         }
 
-        if (writer != null) {
-            ByteBuffer buffer = writer.getBuffer();
+        if (writer != null && !isError) {    // If there is an error we do not release the buffer to the factory
+            ControlledByteBuffer buffer = writer.getBuffer();
             buffer.clear();
             sourceConfiguration.getBufferFactory().release(buffer);
         }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceHandler.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceHandler.java
index 09d0efd..f0d5071 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceHandler.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceHandler.java
@@ -113,12 +113,12 @@
             log.error("HTTP exception while processing request", e);
             informReaderError(conn);
             SourceContext.updateState(conn, ProtocolState.CLOSED);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         } catch (IOException e) {
             logIOException(e);
             informReaderError(conn);
             SourceContext.updateState(conn, ProtocolState.CLOSED);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         }
     }
 
@@ -143,7 +143,7 @@
             logIOException(e);
             informReaderError(conn);
             SourceContext.updateState(conn, ProtocolState.CLOSED);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         }
     }
 
@@ -174,12 +174,12 @@
             logIOException(e);
             informWriterError(conn);
             SourceContext.updateState(conn, ProtocolState.CLOSING);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         } catch (HttpException e) {
             log.error(e.getMessage(), e);
             informWriterError(conn);
             SourceContext.updateState(conn, ProtocolState.CLOSING);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         }
     }
 
@@ -254,29 +254,33 @@
             logIOException(e);
             informWriterError(conn);
             SourceContext.updateState(conn, ProtocolState.CLOSING);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         } 
     }
 
     public void endOfInput(NHttpServerConnection conn) throws IOException {
         ProtocolState state = SourceContext.getState(conn);
+        boolean isError = false;
 
         if (state == ProtocolState.REQUEST_READY || state == ProtocolState.RESPONSE_DONE) {
             if (log.isDebugEnabled()) {
                 log.debug("Keep-Alive connection was closed by the client: " + conn);
             }
         } else if (state == ProtocolState.REQUEST_BODY || state == ProtocolState.REQUEST_HEAD) {
+            isError = true;
             informReaderError(conn);
             log.warn("Connection closed by the client while reading the request: " + conn);
         } else if (state == ProtocolState.RESPONSE_BODY || state == ProtocolState.RESPONSE_HEAD) {
+            isError = true;
             informWriterError(conn);
             log.warn("Connection closed by the client end while writing the response: " + conn);
         } else if (state == ProtocolState.REQUEST_DONE) {
+            isError = true;
             log.warn("Connection closed by the client after request is read: " + conn);
         }
 
         SourceContext.updateState(conn, ProtocolState.CLOSED);
-        sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+        sourceConfiguration.getSourceConnections().shutDownConnection(conn, isError);
     }
 
     public void exception(NHttpServerConnection conn, Exception e) {
@@ -302,7 +306,7 @@
             }
 
             SourceContext.updateState(conn, ProtocolState.CLOSED);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         }
     }
 
@@ -325,7 +329,7 @@
         }
         
         SourceContext.updateState(conn, ProtocolState.CLOSED);
-        sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+        sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
     }
 
     private void logIOException(IOException e) {
@@ -361,7 +365,7 @@
         }
 
         if (conn.isResponseSubmitted()) {
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
             return;
         }
         HttpContext httpContext = conn.getContext();
@@ -382,7 +386,7 @@
             log.error("Error while handling HttpException", ex);
         } finally {
             SourceContext.updateState(conn, ProtocolState.CLOSED);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
         }
     }
 
@@ -409,30 +413,34 @@
         }
 
         SourceContext.updateState(conn, ProtocolState.CLOSED);
-        sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+        sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
     }
 
     public void closed(NHttpServerConnection conn) {
         ProtocolState state = SourceContext.getState(conn);
+        boolean isFault = false;
 
         if (state == ProtocolState.REQUEST_READY || state == ProtocolState.RESPONSE_DONE) {
             if (log.isDebugEnabled()) {
                 log.debug("Keep-Alive connection was closed: " + conn);
             }
         } else if (state == ProtocolState.REQUEST_BODY || state == ProtocolState.REQUEST_HEAD) {
+            isFault = true;
             informReaderError(conn);
             log.warn("Connection closed while reading the request: " + conn);
         } else if (state == ProtocolState.RESPONSE_BODY || state == ProtocolState.RESPONSE_HEAD) {
+            isFault = true;
             informWriterError(conn);
             log.warn("Connection closed while writing the response: " + conn);
         } else if (state == ProtocolState.REQUEST_DONE) {
+            isFault = true;
             log.warn("Connection closed after request is read: " + conn);
         }
 
         metrics.disconnected();
         if (state != ProtocolState.CLOSED) {
             SourceContext.updateState(conn, ProtocolState.CLOSED);
-            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+            sourceConfiguration.getSourceConnections().shutDownConnection(conn, isFault);
         }
     }
 
@@ -440,7 +448,7 @@
         log.warn(action + " while the handler is in an inconsistent state " +
                 SourceContext.getState(conn));
         SourceContext.updateState(conn, ProtocolState.CLOSED);
-        sourceConfiguration.getSourceConnections().shutDownConnection(conn);
+        sourceConfiguration.getSourceConnections().shutDownConnection(conn, true);
     }
 
     private void informReaderError(NHttpServerConnection conn) {
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java
index 3a8a12a..f6dfc91 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java
@@ -20,6 +20,7 @@
 
 package org.apache.synapse.transport.passthru;
 
+import org.apache.commons.collections.map.MultiValueMap;
 import org.apache.http.*;
 import org.apache.http.message.BasicHttpResponse;
 import org.apache.http.nio.ContentDecoder;
@@ -65,6 +66,9 @@
 
     /** The connection from the client */
     private NHttpServerConnection connection = null;
+    
+	/** Excess headers of the request */
+	private Map excessHeaders = new MultiValueMap();
 
     public SourceRequest(SourceConfiguration sourceConfiguration,
                          HttpRequest request,
@@ -84,12 +88,16 @@
             this.version = HttpVersion.HTTP_1_1;
         }
 
-        Header[] headers = request.getAllHeaders();
-        if (headers != null) {
-            for (Header header : headers) {
-                this.headers.put(header.getName(), header.getValue());
-            }
-        }
+		Header[] headers = request.getAllHeaders();
+		if (headers != null) {
+			for (Header header : headers) {
+				if (this.headers.containsKey(header.getName())) {
+					addExcessHeader(header);
+				} else {
+					this.headers.put(header.getName(), header.getValue());
+				}
+			}
+		}
     }
 
     /**
@@ -181,4 +189,12 @@
     public boolean isEntityEnclosing() {
         return entityEnclosing;
     }
+    
+	public Map getExcessHeaders() {
+		return this.excessHeaders;
+	}
+    
+	public void addExcessHeader(Header h) {
+		this.excessHeaders.put(h.getName(), h.getValue());
+	}
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java
index d749de3..0b8db29 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java
@@ -28,18 +28,26 @@
 import org.apache.http.protocol.HttpCoreContext;
 import org.apache.synapse.transport.passthru.config.SourceConfiguration;
 import org.apache.synapse.transport.passthru.util.PassThroughTransportUtils;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.util.MessageProcessorSelector;
+import org.apache.synapse.transport.passthru.util.RelayUtils;
+import org.apache.commons.io.output.CountingOutputStream;
+import org.apache.commons.io.output.NullOutputStream;
 
 import java.io.IOException;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 
 public class SourceResponse {
 
     private Pipe pipe = null;
 
-    /** Transport headers */
-    private Map<String, String> headers = new HashMap<String, String>();
+	/** Transport headers */
+	private Map<String, TreeSet<String>> headers = new HashMap<String, TreeSet<String>>();
 
     /** Status of the response */
     private int status = HttpStatus.SC_OK;
@@ -58,6 +66,8 @@
 
     private SourceRequest request = null;
 
+    private boolean versionChangeRequired =false;
+
     public SourceResponse(SourceConfiguration config, int status, SourceRequest request) {
         this(config, status, null, request);
     }
@@ -90,7 +100,9 @@
                 request.getVersion(), HttpStatus.SC_OK,
                 request.getConnection().getContext());
 
-        if (statusLine != null) {
+        if (versionChangeRequired) {
+            response.setStatusLine(version, status);
+        } else if (statusLine != null) {
             response.setStatusLine(version, status, statusLine);
         } else {
             response.setStatusCode(status);
@@ -99,7 +111,11 @@
         BasicHttpEntity entity = new BasicHttpEntity();
 
         int contentLength = -1;
-        String contentLengthHeader = headers.get(HTTP.CONTENT_LEN);
+    	String contentLengthHeader = null; 
+        if(headers.get(HTTP.CONTENT_LEN) != null && headers.get(HTTP.CONTENT_LEN).size() > 0) {
+        	contentLengthHeader = headers.get(HTTP.CONTENT_LEN).first();
+        } 
+
         if (contentLengthHeader != null) {
             contentLength = Integer.parseInt(contentLengthHeader);
 
@@ -115,14 +131,18 @@
 
         response.setEntity(entity);
 
-        // set any transport headers
-        Set<Map.Entry<String, String>> entries = headers.entrySet();
+		// set any transport headers
+		Set<Map.Entry<String, TreeSet<String>>> entries = headers.entrySet();
 
-        for (Map.Entry<String, String> entry : entries) {
-            if (entry.getKey() != null) {
-                response.addHeader(entry.getKey(), entry.getValue());
-            }
-        }
+		for (Map.Entry<String, TreeSet<String>> entry : entries) {
+			if (entry.getKey() != null) {
+				Iterator<String> i = entry.getValue().iterator();
+				while (i.hasNext()) {
+					response.addHeader(entry.getKey(), i.next());
+				}
+			}
+		}
+        
 
         SourceContext.updateState(conn, ProtocolState.RESPONSE_HEAD);
 
@@ -163,10 +183,67 @@
     }
 
     public void addHeader(String name, String value) {
-        headers.put(name, value);
+    	if(headers.get(name) == null) {
+    		TreeSet<String> values = new TreeSet<String>(); 
+    		values.add(value);
+    		headers.put(name, values);
+    	} else {
+    		TreeSet<String> values = headers.get(name);
+    		values.add(value);
+    	}
+    }
+
+    /**
+     * Process the disable chunking option in response path.
+     */
+    public void processChunkingOptions(MessageContext responseMsgContext) throws IOException {
+        boolean forceHttp10 = responseMsgContext.isPropertyTrue(
+                PassThroughConstants.FORCE_HTTP_1_0, false);
+        boolean disableChunking = responseMsgContext.isPropertyTrue(
+                PassThroughConstants.DISABLE_CHUNKING, false);
+        if (!forceHttp10 && !disableChunking) {
+            return;
+        }
+        if (!responseMsgContext.isPropertyTrue(PassThroughConstants.MESSAGE_BUILDER_INVOKED, false)) {
+            try {
+                RelayUtils.buildMessage(responseMsgContext, false);
+                responseMsgContext.getEnvelope().buildWithAttachments();
+            } catch (Exception e) {
+                throw new AxisFault(e.getMessage(), e);
+            }
+        }
+        if (forceHttp10) {
+            version = HttpVersion.HTTP_1_0;
+            versionChangeRequired = true;
+        }
+        Boolean noEntityBody =
+                (Boolean) responseMsgContext.getProperty(PassThroughConstants.NO_ENTITY_BODY);
+        if (Boolean.TRUE.equals(noEntityBody)) {
+            headers.remove(HTTP.CONTENT_TYPE);
+            return;
+        }
+        TreeSet<String> contentLength = new TreeSet<String>();
+        contentLength.add(Long.toString(getStreamLength(responseMsgContext)));
+        headers.put(HTTP.CONTENT_LEN, contentLength);
+    }
+
+    /**
+     * Write the stream to a temporary storage and calculate the content length
+     */
+    private long getStreamLength(MessageContext msgContext) throws IOException {
+        CountingOutputStream counter = new CountingOutputStream(
+                NullOutputStream.NULL_OUTPUT_STREAM);
+        try {
+            MessageProcessorSelector.getMessageFormatter(msgContext).writeTo(msgContext,
+                     PassThroughTransportUtils.getOMOutputFormat(msgContext), counter, true);
+        } finally {
+            counter.close();
+        }
+        return counter.getCount();
     }
 
     public void setStatus(int status) {
         this.status = status;
-    }        
+    } 
+
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetContext.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetContext.java
index ef69701..ca6fd01 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetContext.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetContext.java
@@ -22,6 +22,7 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.http.nio.NHttpConnection;
 import org.apache.synapse.transport.passthru.config.TargetConfiguration;
+import org.apache.synapse.transport.passthru.util.ControlledByteBuffer;
 
 import java.nio.ByteBuffer;
 
@@ -105,7 +106,24 @@
         this.writer = writer;
     }
 
+    /**
+     * Reset the resources associated with this context
+     */
     public void reset() {
+        reset(false);
+    }
+
+    /**
+     * Reset the resources associated with this context
+     *
+     * @param isError whether an error is causing this shutdown of the connection.
+     *                It is very important to set this flag correctly.
+     *                When an error causing the shutdown of the connections we should not
+     *                release associated writer buffer to the pool as it might lead into
+     *                situations like same buffer is getting released to both source and target
+     *                buffer factories
+     */
+    public void reset(boolean isError) {
         request = null;
         response = null;
         if (state != ProtocolState.CLOSED) {
@@ -113,14 +131,14 @@
             state = ProtocolState.REQUEST_READY;
         }
 
-        if (writer != null) {
-            ByteBuffer buffer = writer.getBuffer();
+        if (writer != null && !isError) { // If there is an error we do not release the buffer to the factory
+            ControlledByteBuffer buffer = writer.getBuffer();
             buffer.clear();
             targetConfiguration.getBufferFactory().release(buffer);
         }
 
         reader = null;
-        writer = null;       
+        writer = null;
     }
 
     public static void create(NHttpConnection conn, ProtocolState state, 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java
index c37c939..0758c85 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java
@@ -224,8 +224,7 @@
             }
                        
             targetConfiguration.getWorkerPool().execute(
-                    new ClientWorker(targetConfiguration.getConfigurationContext(),
-                            requestMsgContext, targetResponse));
+                    new ClientWorker(targetConfiguration, requestMsgContext, targetResponse));
 
             metrics.incrementMessagesReceived();
             
@@ -478,13 +477,24 @@
     }
 
     public void exception(NHttpClientConnection conn, Exception e) {
+        ProtocolState state = TargetContext.getState(conn);
+
+        if (state == ProtocolState.REQUEST_HEAD || state == ProtocolState.REQUEST_BODY) {
+            informWriterError(conn);
+            log.warn("Exception occurred while writing the request data");
+        } else if (state == ProtocolState.RESPONSE_HEAD || state == ProtocolState.RESPONSE_BODY) {
+            informReaderError(conn);
+            log.warn("Exception occurred while reading the response data");
+        } else if (state == ProtocolState.REQUEST_DONE) {
+            log.warn("Exception occurred after writing the request data but before reading the response data");
+        }
+
         if (e instanceof HttpException) {
             exception(conn, (HttpException) e);
         } else if (e instanceof IOException) {
             exception(conn, (IOException) e);
         } else {
             log.error("Unexpected exception encountered in TargetHandler", e);
-            ProtocolState state = TargetContext.getState(conn);
             MessageContext requestMsgCtx = TargetContext.get(conn).getRequestMsgCtx();
             if (requestMsgCtx != null) {
                 targetErrorHandler.handleError(requestMsgCtx,
@@ -499,6 +509,15 @@
         }
     }
 
+    /**
+     * Get the associated configuration of the {@code TargetHandler}
+     *
+     * @return associated {@code TargetConfiguration}
+     */
+    public TargetConfiguration getTargetConfiguration() {
+        return targetConfiguration;
+    }
+
     private boolean isResponseHaveBodyExpected(
             final String method, final HttpResponse response) {
 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java
index 8fb87fa..5586fa1 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java
@@ -45,8 +45,10 @@
 import java.io.OutputStream;
 import java.net.URL;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 
 import javax.xml.stream.XMLStreamException;
 
@@ -60,8 +62,8 @@
 
     private Pipe pipe = null;
 
-    /** Headers map */
-    private Map<String, String> headers = new HashMap<String, String>();
+	/** Headers map */
+	private Map<String, TreeSet<String>> headers = new HashMap<String, TreeSet<String>>();
 
     /** URL */
     private URL url;
@@ -125,11 +127,17 @@
                     (url.getQuery() != null ? "?" + url.getQuery() : "");
 
         long contentLength = -1;
-        String contentLengthHeader = headers.get(HTTP.CONTENT_LEN);
-        if (contentLengthHeader != null) {
-            contentLength = Integer.parseInt(contentLengthHeader);
-            headers.remove(HTTP.CONTENT_LEN);
-        }
+        String contentLengthHeader = null;
+        
+		if (headers.get(HTTP.CONTENT_LEN) != null && headers.get(HTTP.CONTENT_LEN).size() > 0) {
+			contentLengthHeader = headers.get(HTTP.CONTENT_LEN).first();
+		}
+
+		if (contentLengthHeader != null) {
+			contentLength = Integer.parseInt(contentLengthHeader);
+			headers.remove(HTTP.CONTENT_LEN);
+		}
+  
         
         MessageContext requestMsgCtx = TargetContext.get(conn).getRequestMsgCtx();
         Long lengthValue = (Long) requestMsgCtx.getProperty(
@@ -152,7 +160,7 @@
                     !requestMsgCtx.isPropertyTrue(PassThroughConstants.MESSAGE_BUILDER_INVOKED)) {
                     // If the message is multipart/related but it hasn't been built
                     // we can copy the content-type header of the request
-                    headers.put(HTTP.CONTENT_TYPE, trpContentType);
+                	addHeader(HTTP.CONTENT_TYPE, trpContentType);
                 }
             }
         }
@@ -163,11 +171,19 @@
 
             BasicHttpEntity entity = new BasicHttpEntity();
 
-            if (contentLength != -1) {
+            if (requestMsgCtx.isPropertyTrue(NhttpConstants.FORCE_HTTP_CONTENT_LENGTH)) {
                 entity.setChunked(false);
-                entity.setContentLength(contentLength);
+                if (requestMsgCtx.isPropertyTrue(PassThroughConstants.COPY_CONTENT_LENGTH_FROM_INCOMING)
+                        && contentLength > 0) {
+                    entity.setContentLength(contentLength);
+                }
             } else {
-                entity.setChunked(chunk);
+                if (contentLength != -1) {
+                    entity.setChunked(false);
+                    entity.setContentLength(contentLength);
+                } else {
+                    entity.setChunked(chunk);
+                }
             }
             ((BasicHttpEntityEnclosingRequest) request).setEntity(entity);
            
@@ -176,10 +192,16 @@
                     version != null ? version : HttpVersion.HTTP_1_1);
         }
 
-        Set<Map.Entry<String, String>> entries = headers.entrySet();
-        for (Map.Entry<String, String> entry : entries) {
-            request.setHeader(entry.getKey(), entry.getValue());
-        }
+        
+		Set<Map.Entry<String, TreeSet<String>>> entries = headers.entrySet();
+		for (Map.Entry<String, TreeSet<String>> entry : entries) {
+			if (entry.getKey() != null) {
+				Iterator<String> i = entry.getValue().iterator();
+				while (i.hasNext()) {
+					request.addHeader(entry.getKey(), i.next());
+				}
+			}
+		}
         
         //setup wsa action..
         if (request != null){
@@ -227,6 +249,29 @@
         }
     }
 
+    
+	public void addHeader(String name, String value) {
+		if (headers.get(name) == null) {
+			TreeSet<String> values = new TreeSet<String>();
+			values.add(value);
+			if (HTTP.CONTENT_TYPE.equalsIgnoreCase(name)) {
+				headers.put(HTTP.CONTENT_TYPE, values);
+			} else {
+				headers.put(name, values);
+			}
+		} else {
+			if (HTTP.CONTENT_TYPE.equalsIgnoreCase(name)) {
+				headers.remove(HTTP.CONTENT_TYPE);
+				TreeSet<String> values = new TreeSet<String>();
+				values.add(value);
+				headers.put(HTTP.CONTENT_TYPE, values);
+			} else {
+				TreeSet<String> values = headers.get(name);
+				values.add(value);
+			}
+		}
+	}
+    
 	/**
 	 * Handles the chunking messages in PassThough context, create a temporary buffer and
      * calculate the message size before writing to the external buffer, which is required the
@@ -304,9 +349,6 @@
         return hasEntityBody;
     }
 
-	public void addHeader(String name, String value) {
-        headers.put(name, value);
-    }
 
     public String getMethod() {
         return method;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java
index 0d80944..690cd4a 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java
@@ -29,6 +29,7 @@
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.commons.collections.map.MultiValueMap;
 
 /**
  * This class represents a response coming from the target server.
@@ -40,6 +41,9 @@
 
     /** Headers of the response */
     private Map<String, String> headers = new HashMap<String, String>();
+    
+    /** Excess headers of the response */ 
+    private Map excessHeaders = new MultiValueMap();
 
     /** The status of the response */
     private int status = HttpStatus.SC_OK;
@@ -74,12 +78,16 @@
         this.status = response.getStatusLine().getStatusCode();
         this.statusLine = response.getStatusLine().getReasonPhrase();
 
-        Header[] headers = response.getAllHeaders();
-        if (headers != null) {
-            for (Header header : headers) {
-                this.headers.put(header.getName(), header.getValue());
-            }
-        }
+		Header[] headers = response.getAllHeaders();
+		if (headers != null) {
+			for (Header header : headers) {
+				if (this.headers.containsKey(header.getName())) {
+					addExcessHeader(header);
+				} else {
+					this.headers.put(header.getName(), header.getValue());
+				}
+			}
+		}
 
         this.expectResponseBody = expectResponseBody;
     }    
@@ -140,6 +148,14 @@
         return headers;
     }
 
+    public Map getExcessHeaders() {
+    	return this.excessHeaders;
+    }
+    
+    public void addExcessHeader(Header h) {
+    	this.excessHeaders.put(h.getName(), h.getValue());
+    }
+
     public Pipe getPipe() {
         return pipe;
     }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfigPNames.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfigPNames.java
index b6a97c6..bef9b15 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfigPNames.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfigPNames.java
@@ -66,6 +66,11 @@
     public String SERVER_HEADER_PRESERVE = "http.server.preserve";
 
     /**
+     * Defines whether ESB needs to preserve the original Http header.
+     */
+    public String HTTP_HEADERS_PRESERVE = "http.headers.preserve";
+
+    /**
      * Defines whether HTTP keep-alive is disabled
      */
     public String DISABLE_KEEPALIVE = "http.connection.disable.keepalive";
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfiguration.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfiguration.java
index 8b17bfc..e97f78f 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfiguration.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/PassThroughConfiguration.java
@@ -71,4 +71,8 @@
                 DEFAULT_IO_THREADS_PER_REACTOR);
     }
 
+    public String getPreserveHttpHeaders() {
+        return getStringProperty(PassThroughConfigPNames.HTTP_HEADERS_PRESERVE, "");
+    }
+
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/TargetConfiguration.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/TargetConfiguration.java
index bd896b4..f6ba00d 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/TargetConfiguration.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/config/TargetConfiguration.java
@@ -25,6 +25,10 @@
 import org.apache.http.protocol.*;
 import org.apache.synapse.transport.passthru.connections.TargetConnections;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * This class stores configuration specific to HTTP Connectors (Senders)
  */
@@ -38,6 +42,9 @@
     /** Whether Server header coming from server should be preserved */
     private boolean preserveServerHeader = true;
 
+    /** Http headers which should be preserved */
+    private List<String> preserveHttpHeaders;
+
     private TargetConnections connections = null;
 
     public TargetConfiguration(ConfigurationContext configurationContext,
@@ -51,6 +58,7 @@
                 PassThroughConfigPNames.USER_AGENT_HEADER_PRESERVE, false);
         preserveServerHeader = conf.getBooleanProperty(
                 PassThroughConfigPNames.SERVER_HEADER_PRESERVE, true);
+        populatePreserveHttpHeaders(conf.getPreserveHttpHeaders());
     }
 
     @Override
@@ -70,12 +78,18 @@
         return maxConnections;
     }
 
-    public boolean isPreserveUserAgentHeader() {
-        return preserveUserAgentHeader;
-    }
+    /**
+     * Check preserving status of the given http header name
+     *
+     * @param headerName http header name which need to check preserving status
+     * @return preserving status of the given http header
+     */
+    public boolean isPreserveHttpHeader(String headerName) {
 
-    public boolean isPreserveServerHeader() {
-        return preserveServerHeader;
+        if (preserveHttpHeaders == null || preserveHttpHeaders.isEmpty() || headerName == null) {
+            return false;
+        }
+        return preserveHttpHeaders.contains(headerName.toUpperCase());
     }
 
     public TargetConnections getConnections() {
@@ -85,4 +99,29 @@
     public void setConnections(TargetConnections connections) {
         this.connections = connections;
     }
+
+    /**
+     * Populate preserve http headers from comma separate string
+     *
+     * @param preserveHeaders Comma separated preserve enable http headers
+     */
+    private void populatePreserveHttpHeaders(String preserveHeaders) {
+
+        preserveHttpHeaders = new ArrayList<String>();
+        if (preserveHeaders != null && !preserveHeaders.isEmpty()) {
+            String[] presHeaders = preserveHeaders.trim().toUpperCase().split(",");
+            if (presHeaders != null && presHeaders.length > 0) {
+                preserveHttpHeaders.addAll(Arrays.asList(presHeaders));
+            }
+        }
+
+        if (preserveServerHeader && !preserveHttpHeaders.contains(HTTP.SERVER_HEADER.toUpperCase())) {
+            preserveHttpHeaders.add(HTTP.SERVER_HEADER.toUpperCase());
+        }
+
+        if (preserveUserAgentHeader && !preserveHttpHeaders.contains(HTTP.USER_AGENT.toUpperCase())) {
+            preserveHttpHeaders.add(HTTP.USER_AGENT.toUpperCase());
+        }
+    }
+
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/SourceConnections.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/SourceConnections.java
index 72f1f45..9a4a040 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/SourceConnections.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/SourceConnections.java
@@ -117,12 +117,27 @@
      * @param conn the connection that needs to be shut down
      */
     public void shutDownConnection(NHttpServerConnection conn) {
+        shutDownConnection(conn, false);
+    }
+
+    /**
+     * Shutdown a connection
+     *
+     * @param conn the connection that needs to be shut down
+     * @param isError whether an error is causing this shutdown of the connection
+     *                It is very important to set this flag correctly.
+     *                When an error causing the shutdown of the connections we should not
+     *                release associated writer buffer to the pool as it might lead into
+     *                situations like same buffer is getting released to both source and target
+     *                buffer factories
+     */
+    public void shutDownConnection(NHttpServerConnection conn, boolean isError) {
         if (log.isDebugEnabled()) {
             log.debug("Shutting down connection forcefully " + conn);
         }
         lock.lock();
         try {
-            SourceContext.get(conn).reset();
+            SourceContext.get(conn).reset(isError);
 
             if (!busyConnections.remove(conn)) {
                 freeConnections.remove(conn);
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/TargetConnections.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/TargetConnections.java
index f471e42..3b162b6 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/TargetConnections.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/connections/TargetConnections.java
@@ -150,10 +150,25 @@
      * @param conn connection to shutdownConnection
      */
     public void shutdownConnection(NHttpClientConnection conn) {
+        shutdownConnection(conn, false);
+    }
+
+    /**
+     * This connection is no longer valid. So we need to shutdown connection.
+     *
+     * @param conn connection to shutdownConnection
+     * @param isError whether an error is causing this shutdown of the connection.
+     *                It is very important to set this flag correctly.
+     *                When an error causing the shutdown of the connections we should not
+     *                release associated writer buffer to the pool as it might lead into
+     *                situations like same buffer is getting released to both source and target
+     *                buffer factories
+     */
+    public void shutdownConnection(NHttpClientConnection conn, boolean isError) {
         HostConnections pool = (HostConnections) conn.getContext().getAttribute(
                 PassThroughConstants.CONNECTION_POOL);
 
-        TargetContext.get(conn).reset();
+        TargetContext.get(conn).reset(isError);
 
         if (pool != null) {
             pool.forget(conn);
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/BufferFactory.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/BufferFactory.java
index ade4469..925591f 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/BufferFactory.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/BufferFactory.java
@@ -21,13 +21,12 @@
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 
-import java.nio.ByteBuffer;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
 public class BufferFactory {
 
-    private volatile ByteBuffer [] buffers;
+    private volatile ControlledByteBuffer [] buffers;
 
     private volatile int marker = -1;
 
@@ -45,34 +44,36 @@
             this.allocator = HeapByteBufferAllocator.INSTANCE;
         }
 
-        buffers = new ByteBuffer[size];
+        buffers = new ControlledByteBuffer[size];
     }
 
-    public ByteBuffer getBuffer() {
+    public ControlledByteBuffer getBuffer() {
         if (marker == -1) {
-            return allocator.allocate(bufferSize);
+            return new ControlledByteBuffer(allocator.allocate(bufferSize));
         } else {
             try {
                 lock.lock();
                 if (marker >= 0) {
-                    ByteBuffer b = buffers[marker];
-                    b.clear();
+                    ControlledByteBuffer controlledByteBuffer = buffers[marker];
+                    controlledByteBuffer.clear();
+                    controlledByteBuffer.forceSetInputMode();
                     buffers[marker] = null;
                     marker--;
-                    return b;
+                    return controlledByteBuffer;
                 }
             } finally {
                 lock.unlock();
             }
         }
-        return allocator.allocate(bufferSize);
+        return new ControlledByteBuffer(allocator.allocate(bufferSize));
     }
 
-    public void release(ByteBuffer buffer) {
+    public void release(ControlledByteBuffer buffer) {
         try {
             lock.lock();
             if (marker < buffers.length - 1) {
                 buffer.clear();
+                buffer.forceSetInputMode();
                 buffers[++marker] = buffer;
             }
         } finally {
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/ControlledByteBuffer.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/ControlledByteBuffer.java
new file mode 100644
index 0000000..5303ddd
--- /dev/null
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/ControlledByteBuffer.java
@@ -0,0 +1,93 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.synapse.transport.passthru.util;
+
+import java.nio.ByteBuffer;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class ControlledByteBuffer {
+    private ByteBuffer byteBuffer;
+
+    private AtomicBoolean inputMode = new AtomicBoolean(true);
+
+    public ControlledByteBuffer(ByteBuffer byteBuffer) {
+        this.byteBuffer = byteBuffer;
+    }
+
+    public ByteBuffer getByteBuffer() {
+        return this.byteBuffer;
+    }
+
+    public boolean setInputMode() {
+        return this.inputMode.compareAndSet(false, true);
+    }
+
+    public boolean setOutputMode() {
+        return this.inputMode.compareAndSet(true, false);
+    }
+
+    public void forceSetInputMode() {
+        this.inputMode = new AtomicBoolean(true);
+    }
+
+    public void flip() {
+        this.byteBuffer.flip();
+    }
+
+    public void clear() {
+        this.byteBuffer.clear();
+    }
+
+    public void compact() {
+        this.byteBuffer.compact();
+    }
+
+    public int position() {
+        return this.byteBuffer.position();
+    }
+
+    public void put(byte b) {
+        this.byteBuffer.put(b);
+    }
+
+    public void putInt(int value) {
+        this.byteBuffer.putInt(value);
+    }
+
+    public ByteBuffer put(byte[] src, int offset, int length) {
+        return this.byteBuffer.put(src, offset, length);
+    }
+
+    public boolean hasRemaining() {
+        return this.byteBuffer.hasRemaining();
+    }
+
+    public byte get() {
+        return this.byteBuffer.get();
+    }
+
+    public ByteBuffer get(byte[] dst, int offset, int length) {
+        return this.byteBuffer.get(dst, offset, length);
+    }
+
+    public int remaining() {
+        return this.byteBuffer.remaining();
+    }
+}
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java
index a40b63f..c711ae5 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java
@@ -33,12 +33,15 @@
 import org.apache.http.HttpStatus;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.transport.nhttp.NhttpConstants;
 import org.apache.synapse.transport.passthru.PassThroughConstants;
 import org.apache.synapse.transport.passthru.ProtocolState;
 import org.apache.synapse.transport.passthru.SourceContext;
 import org.apache.synapse.transport.passthru.TargetContext;
+import org.apache.synapse.transport.passthru.config.TargetConfiguration;
 import org.apache.synapse.transport.passthru.connections.SourceConnections;
 import org.apache.synapse.transport.passthru.connections.TargetConnections;
+import org.apache.synapse.transport.utils.conn.SynapseNHttpClientConnection;
 
 import java.net.InetAddress;
 import java.util.Map;
@@ -110,13 +113,11 @@
      * copied from the request messages
      * 
      * @param msgContext the Axis2 Message context from which these headers should be removed
-     * @param preserveServerHeader if true preserve the original server header
-     * @param preserveUserAgentHeader if true preserve the original user-agent header
+     * @param targetConfiguration configuration for the passThrough handler
      */
-    public static void removeUnwantedHeaders(MessageContext msgContext,
-                                             boolean preserveServerHeader,
-                                             boolean preserveUserAgentHeader) {
+    public static void removeUnwantedHeaders(MessageContext msgContext, TargetConfiguration targetConfiguration) {
         Map headers = (Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
+		Map excessHeaders = (Map) msgContext.getProperty(NhttpConstants.EXCESS_TRANSPORT_HEADERS);
 
         if (headers == null || headers.isEmpty()) {
             return;
@@ -126,21 +127,36 @@
         while (iter.hasNext()) {
             String headerName = (String) iter.next();
             if (HTTP.CONN_DIRECTIVE.equalsIgnoreCase(headerName) ||
-                HTTP.TRANSFER_ENCODING.equalsIgnoreCase(headerName) ||
-                HTTP.DATE_HEADER.equalsIgnoreCase(headerName) ||
-                HTTP.CONTENT_LEN.equalsIgnoreCase(headerName) ||
-                HTTP.CONN_KEEP_ALIVE.equalsIgnoreCase(headerName)) {
+                HTTP.TRANSFER_ENCODING.equalsIgnoreCase(headerName)) {
                 iter.remove();
             }
 
-            if (!preserveServerHeader && HTTP.SERVER_HEADER.equalsIgnoreCase(headerName)) {
+            if (HTTP.DATE_HEADER.equalsIgnoreCase(headerName)
+                && !targetConfiguration.isPreserveHttpHeader(HTTP.DATE_HEADER)) {
                 iter.remove();
             }
 
-            if (!preserveUserAgentHeader && HTTP.USER_AGENT.equalsIgnoreCase(headerName)) {
+            if (HTTP.CONTENT_LEN.equalsIgnoreCase(headerName)
+                && !targetConfiguration.isPreserveHttpHeader(HTTP.CONTENT_LEN)) {
+                iter.remove();
+            }
+
+            if (HTTP.CONN_KEEP_ALIVE.equalsIgnoreCase(headerName)
+                && !targetConfiguration.isPreserveHttpHeader(HTTP.CONN_KEEP_ALIVE)) {
+                iter.remove();
+            }
+
+            if (HTTP.SERVER_HEADER.equalsIgnoreCase(headerName)
+                && !targetConfiguration.isPreserveHttpHeader(HTTP.SERVER_HEADER)) {
+                iter.remove();
+            }
+
+            if (HTTP.USER_AGENT.equalsIgnoreCase(headerName)
+                && !targetConfiguration.isPreserveHttpHeader(HTTP.USER_AGENT)) {
                 iter.remove();
             }
         }
+
     }
 
     /**
@@ -247,7 +263,11 @@
             TargetContext.updateState(conn, ProtocolState.CLOSING);
             connections.closeConnection(conn);
         } else {
-            connections.releaseConnection(conn);
+            if (conn instanceof SynapseNHttpClientConnection) {
+                ((SynapseNHttpClientConnection) conn).markForRelease();
+            } else {
+                connections.releaseConnection(conn);
+            }
         }
     }
 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/RelayUtils.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/RelayUtils.java
index 122992a..21c9462 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/RelayUtils.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/RelayUtils.java
@@ -34,6 +34,8 @@
 import org.apache.axis2.engine.Phase;
 import org.apache.axis2.transport.RequestResponseTransport;
 import org.apache.axis2.transport.TransportUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.output.NullOutputStream;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.transport.passthru.PassThroughConstants;
@@ -42,6 +44,7 @@
 
 import javax.activation.DataHandler;
 import javax.activation.DataSource;
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
 import java.io.BufferedInputStream;
@@ -88,10 +91,20 @@
         }
 
         SOAPEnvelope envelope = messageContext.getEnvelope();
-        OMElement contentEle = envelope.getBody().getFirstChildWithName(
-                RelayConstants.BINARY_CONTENT_QNAME);
 
-        if (contentEle != null) {
+        QName firstElementQName;
+        if (envelope.getSOAPBodyFirstElementNS() != null) {
+            firstElementQName = new QName(
+                    envelope.getSOAPBodyFirstElementNS().getNamespaceURI(),
+                    envelope.getSOAPBodyFirstElementLocalName());
+        } else if (envelope.getSOAPBodyFirstElementLocalName() != null){
+            firstElementQName = new QName(envelope.getSOAPBodyFirstElementLocalName());
+        } else {
+            firstElementQName = null;
+        }
+
+        if (RelayConstants.BINARY_CONTENT_QNAME.equals(firstElementQName)) {
+            OMElement contentEle = envelope.getBody().getFirstElement();
             OMNode node = contentEle.getFirstOMChild();
             if (node != null && (node instanceof OMText)) {
                 OMText binaryDataNode = (OMText) node;
@@ -142,11 +155,14 @@
 		}
 	   
 	    OMElement element = null;
-	    try{
-	        element = messageBuilder.getDocument(messageContext, bufferedInputStream);
-	    }catch (Exception e) {
-	    	log.error("Error while building PassThrough stream",e);
-	    }
+        try {
+            element = messageBuilder.getDocument(messageContext, bufferedInputStream);
+        } catch (Exception e) {
+            //Clearing the buffer when there is an exception occurred.
+            consumeAndDiscardMessage(messageContext);
+            messageContext.setProperty(PassThroughConstants.MESSAGE_BUILDER_INVOKED, Boolean.TRUE);
+            handleException("Error while building Passthrough stream", e);
+        }
 
 	    if (element != null) {
 	        messageContext.setEnvelope(TransportUtils.createSOAPEnvelope(element));
@@ -262,4 +278,36 @@
     private static boolean isOneWay(String mepString) {
         return WSDL2Constants.MEP_URI_IN_ONLY.equals(mepString);
     }
+
+    /**
+     * Consumes the data in pipe completely in the given message context and discard it
+     *
+     * @param msgContext Axis2 Message context which contains the data
+     * @throws AxisFault
+     */
+    private static void consumeAndDiscardMessage(MessageContext msgContext) throws AxisFault {
+        final Pipe pipe = (Pipe) msgContext.getProperty(PassThroughConstants.PASS_THROUGH_PIPE);
+        if (pipe != null) {
+            InputStream in = pipe.getInputStream();
+            if (in != null) {
+                try {
+                    IOUtils.copy(in, new NullOutputStream());
+                } catch (IOException exception) {
+                    handleException("Error when consuming the input stream to discard ", exception);
+                }
+            }
+        }
+    }
+
+    /**
+     * Perform an error log message to all logs @ ERROR and throws a AxisFault
+     *
+     * @param msg the log message
+     * @param e   an Exception encountered
+     * @throws AxisFault
+     */
+    private static void handleException(String msg, Exception e) throws AxisFault {
+        log.error(msg, e);
+        throw new AxisFault(msg, e);
+    }
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/SourceResponseFactory.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/SourceResponseFactory.java
index bdfb0a0..0738a49 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/SourceResponseFactory.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/SourceResponseFactory.java
@@ -26,11 +26,15 @@
 import org.apache.synapse.transport.nhttp.NhttpConstants;
 import org.apache.synapse.transport.nhttp.util.MessageFormatterDecoratorFactory;
 import org.apache.synapse.transport.nhttp.util.NhttpUtil;
+import org.apache.synapse.transport.passthru.Pipe;
 import org.apache.synapse.transport.passthru.SourceRequest;
 import org.apache.synapse.transport.passthru.SourceResponse;
 import org.apache.synapse.transport.passthru.config.SourceConfiguration;
+import org.apache.synapse.transport.passthru.PassThroughConstants;
 
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 
 public class SourceResponseFactory {
@@ -46,6 +50,13 @@
 
         // set any transport headers
         Map transportHeaders = (Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
+
+        if (msgContext.isPropertyTrue(NhttpConstants.FORCE_HTTP_CONTENT_LENGTH) &&
+                msgContext.isPropertyTrue(PassThroughConstants.COPY_CONTENT_LENGTH_FROM_INCOMING) &&
+                msgContext.getProperty(PassThroughConstants.ORIGINAL_CONTENT_LENGTH) != null) {
+            sourceResponse.addHeader(HTTP.CONTENT_LEN,
+                    (String) msgContext.getProperty(PassThroughConstants.ORIGINAL_CONTENT_LENGTH));
+        }
         if (transportHeaders != null) {
             addResponseHeader(sourceResponse, transportHeaders);
         } else {
@@ -61,8 +72,21 @@
              }
         	 
         }
-        return sourceResponse;
-    }
+
+		// Add excess response header.
+		String excessProp = NhttpConstants.EXCESS_TRANSPORT_HEADERS;
+		Map excessHeaders = (Map) msgContext.getProperty(excessProp);
+		if (excessHeaders != null) {
+			for (Iterator iterator = excessHeaders.keySet().iterator(); iterator.hasNext();) {
+				String key = (String) iterator.next();
+				for (String excessVal : (Collection<String>) excessHeaders.get(key)) {
+					sourceResponse.addHeader(key, (String) excessVal);
+				}
+			}
+		}
+		
+		return sourceResponse;
+	}
 
 	private static void addResponseHeader(SourceResponse sourceResponse, Map transportHeaders) {
 	    for (Object entryObj : transportHeaders.entrySet()) {
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java
index d27ce80..4b88020 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java
@@ -39,6 +39,8 @@
 
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Collection;
+import java.util.Iterator;
 import java.util.Map;
 
 public class TargetRequestFactory {
@@ -67,9 +69,7 @@
                     noEntityBody == null || !noEntityBody);
 
             // headers
-            PassThroughTransportUtils.removeUnwantedHeaders(msgContext,
-                    configuration.isPreserveServerHeader(),
-                    configuration.isPreserveUserAgentHeader());
+            PassThroughTransportUtils.removeUnwantedHeaders(msgContext, configuration);
 
             Object o = msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
             if (o != null && o instanceof Map) {
@@ -79,14 +79,14 @@
                     Map.Entry entry = (Map.Entry) entryObj;
                     if (entry.getValue() != null && entry.getKey() instanceof String &&
                             entry.getValue() instanceof String) {
-                        if (!HTTPConstants.HEADER_HOST.equalsIgnoreCase((String) entry.getKey())) {
-                            request.addHeader((String) entry.getKey(), (String) entry.getValue());
-                        } else {
+                        if (HTTPConstants.HEADER_HOST.equalsIgnoreCase((String) entry.getKey())
+                            && !configuration.isPreserveHttpHeader(HTTPConstants.HEADER_HOST)) {
                             if (msgContext.getProperty(NhttpConstants.REQUEST_HOST_HEADER) != null) {
-                            	request.addHeader((String) entry.getKey(),
-                                        (String) msgContext.getProperty(
-                                                NhttpConstants.REQUEST_HOST_HEADER));
+                                request.addHeader((String) entry.getKey(),
+                                                  (String) msgContext.getProperty(NhttpConstants.REQUEST_HOST_HEADER));
                             }
+                        } else {
+                            request.addHeader((String) entry.getKey(), (String) entry.getValue());
                         }
                     }
                 }
@@ -126,6 +126,18 @@
             if ("true".equals(fullUrl)) {
                 request.setFullUrl(true);                
             }
+            
+			// Add excess respsonse header.
+			String excessProp = NhttpConstants.EXCESS_TRANSPORT_HEADERS;
+			Map excessHeaders = (Map) msgContext.getProperty(excessProp);
+			if (excessHeaders != null) {
+				for (Iterator iterator = excessHeaders.keySet().iterator(); iterator.hasNext();) {
+					String key = (String) iterator.next();
+					for (String excessVal : (Collection<String>) excessHeaders.get(key)) {
+						request.addHeader(key, (String) excessVal);
+					}
+				}
+			}
 
             return request;
         } catch (MalformedURLException e) {
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnection.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpClientConnection.java
similarity index 71%
copy from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnection.java
copy to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpClientConnection.java
index 8e4c411..e008353 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnection.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpClientConnection.java
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn;
 
-import org.apache.commons.logging.Log;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
@@ -31,21 +30,21 @@
 import org.apache.http.nio.NHttpMessageWriterFactory;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.util.ByteBufferAllocator;
+import org.apache.synapse.transport.passthru.TargetHandler;
 
 import java.io.IOException;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 
 /**
- * An extension of the DefaultNHttpClientConnection class, that provides some
- * additional logging features. This implementation enhances the default connection
- * class by logging all the major events that occur on the connection instance.
+ * An extension of the DefaultNHttpClientConnection class, that has some
+ * additional stuff related to synapse NHttp transport implementation
  */
-public class LoggingNHttpClientConnection extends DefaultNHttpClientConnection {
+public class SynapseNHttpClientConnection extends DefaultNHttpClientConnection {
 
-    private final Log log;
+    private boolean markedForRelease = false;
 
-    public LoggingNHttpClientConnection(IOSession session,
+    public SynapseNHttpClientConnection(IOSession session,
                                         int bufferSize,
                                         int fragmentSizeHint,
                                         ByteBufferAllocator allocator,
@@ -55,43 +54,54 @@
                                         ContentLengthStrategy incomingContentStrategy,
                                         ContentLengthStrategy outgoingContentStrategy,
                                         NHttpMessageWriterFactory<HttpRequest> requestWriterFactory,
-                                        NHttpMessageParserFactory<HttpResponse> responseParserFactory,
-                                        Log log) {
+                                        NHttpMessageParserFactory<HttpResponse> responseParserFactory) {
         super(session, bufferSize, fragmentSizeHint, allocator,
-                charDecoder, charEncoder, constraints, incomingContentStrategy,
-                outgoingContentStrategy, requestWriterFactory, responseParserFactory);
-        this.log = log;
+              charDecoder, charEncoder, constraints, incomingContentStrategy,
+              outgoingContentStrategy, requestWriterFactory, responseParserFactory);
     }
 
     @Override
     public void close() throws IOException {
-        this.log.debug("Close connection");
         super.close();
     }
 
     @Override
     public void shutdown() throws IOException {
-        this.log.debug("Shutdown connection");
         super.shutdown();
     }
 
     @Override
     public void submitRequest(final HttpRequest request) throws IOException, HttpException {
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("HTTP connection " + this + ": "  + request.getRequestLine().toString());
-        }
         super.submitRequest(request);
     }
 
     @Override
     public void consumeInput(final NHttpClientEventHandler handler) {
-        this.log.debug("Consume input");
         super.consumeInput(handler);
+        if (markedForRelease) {
+            if (handler instanceof TargetHandler) {
+                resetState();
+                ((TargetHandler) handler).getTargetConfiguration().getConnections().releaseConnection(this);
+            }
+        }
     }
 
     @Override
     public void produceOutput(final NHttpClientEventHandler handler) {
-        this.log.debug("Produce output");
         super.produceOutput(handler);
     }
+
+    /**
+     * Mark this connection to be released to the pool.
+     * <p>
+     * This needs to be called after finishing work related to a particular request/response,
+     * and only when keep-alive is enabled
+     */
+    public void markForRelease() {
+        this.markedForRelease = true;
+    }
+
+    private void resetState() {
+        markedForRelease = false;
+    }
 }
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnectionFactory.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpClientConnectionFactory.java
similarity index 76%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnectionFactory.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpClientConnectionFactory.java
index eca0742..16a2722 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnectionFactory.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpClientConnectionFactory.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -37,17 +37,22 @@
 import org.apache.http.nio.reactor.SessionInputBuffer;
 import org.apache.http.nio.reactor.SessionOutputBuffer;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
+import org.apache.synapse.transport.nhttp.AccessHandler;
+import org.apache.synapse.transport.utils.conn.SynapseNHttpClientConnection;
+import org.apache.synapse.transport.utils.conn.logging.LoggingConstants;
+import org.apache.synapse.transport.utils.conn.logging.LoggingIOSession;
+import org.apache.synapse.transport.utils.conn.logging.LoggingNHttpClientConnection;
 
 import java.io.IOException;
 
 /**
  * A connection factory implementation for DefaultNHttpClientConnection instances.
  * Based on the current logging configuration, this factory decides whether to create
- * regular DefaultNHttpClientConnection objects or to create LoggingNHttpClientConnection
+ * regular SynapseNHttpClientConnection objects or to create LoggingNHttpClientConnection
  * objects. Also, depending on the logging configuration, this factory may choose to
  * wrap IOSession instances in LoggingIOSession objects.
  */
-public class LoggingNHttpClientConnectionFactory implements NHttpConnectionFactory<DefaultNHttpClientConnection> {
+public class SynapseNHttpClientConnectionFactory implements NHttpConnectionFactory<DefaultNHttpClientConnection> {
 
     private static final Log targetConnLog = LogFactory.getLog(
             LoggingConstants.TARGET_CONNECTION_LOG_ID);
@@ -65,14 +70,14 @@
 
     private final ConnectionConfig config;
 
-    public LoggingNHttpClientConnectionFactory(ConnectionConfig config) {
+    public SynapseNHttpClientConnectionFactory(ConnectionConfig config) {
         this.config = config;
     }
 
     public DefaultNHttpClientConnection createConnection(IOSession session) {
         if (targetSessionLog.isDebugEnabled() || targetWireLog.isDebugEnabled()) {
             session = new LoggingIOSession(targetSessionLog, targetWireLog,
-                    session, "http-sender");
+                                           session, "http-sender");
         }
 
         if (targetConnLog.isDebugEnabled() || targetHeaderLog.isDebugEnabled()) {
@@ -90,7 +95,7 @@
                     responseParserFactory,
                     targetConnLog);
         } else {
-            return new DefaultNHttpClientConnection(
+            return new SynapseNHttpClientConnection(
                     session,
                     config.getBufferSize(),
                     config.getFragmentSizeHint(),
@@ -125,11 +130,17 @@
         }
 
         public void write(final HttpRequest request) throws IOException, HttpException {
-            if (request != null && targetHeaderLog.isDebugEnabled()) {
-                targetHeaderLog.debug(">> " + request.getRequestLine().toString());
-                Header[] headers = request.getAllHeaders();
-                for (Header header : headers) {
-                    targetHeaderLog.debug(">> " + header.toString());
+            if (request != null) {
+                if (targetHeaderLog.isDebugEnabled()) {
+                    targetHeaderLog.debug(">> " + request.getRequestLine().toString());
+                    Header[] headers = request.getAllHeaders();
+                    for (Header header : headers) {
+                        targetHeaderLog.debug(">> " + header.toString());
+                    }
+                }
+
+                if (AccessHandler.getAccessLog().isInfoEnabled()) {
+                    AccessHandler.getAccess().addAccessToQueue(request);
                 }
             }
             super.write(request);
@@ -145,11 +156,17 @@
 
         public HttpResponse parse() throws IOException, HttpException {
             HttpResponse response = super.parse();
-            if (response != null && targetHeaderLog.isDebugEnabled()) {
-                targetHeaderLog.debug("<< " + response.getStatusLine().toString());
-                Header[] headers = response.getAllHeaders();
-                for (Header header : headers) {
-                    targetHeaderLog.debug("<< " + header.toString());
+            if (response != null) {
+                if (targetHeaderLog.isDebugEnabled()) {
+                    targetHeaderLog.debug("<< " + response.getStatusLine().toString());
+                    Header[] headers = response.getAllHeaders();
+                    for (Header header : headers) {
+                        targetHeaderLog.debug("<< " + header.toString());
+                    }
+                }
+
+                if (AccessHandler.getAccessLog().isInfoEnabled()) {
+                    AccessHandler.getAccess().addAccessToQueue(response);
                 }
             }
             return response;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpSSLClientConnectionFactory.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpSSLClientConnectionFactory.java
similarity index 91%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpSSLClientConnectionFactory.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpSSLClientConnectionFactory.java
index c78504a..a7cbe77 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpSSLClientConnectionFactory.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpSSLClientConnectionFactory.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn;
 
 import org.apache.http.config.ConnectionConfig;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
@@ -31,18 +31,18 @@
 import java.util.Map;
 
 /**
- * The SSL-enabled version of the LoggingNHttpClientConnectionFactory. Identical in behavior
+ * The SSL-enabled version of the SynapseNHttpClientConnectionFactory. Identical in behavior
  * to the parent class, but wraps IOSession instances with SSLIOSession instances. This
  * implementation also supports using different SSLContext instances for different target
  * I/O sessions.
  */
-public class LoggingNHttpSSLClientConnectionFactory extends LoggingNHttpClientConnectionFactory {
+public class SynapseNHttpSSLClientConnectionFactory extends SynapseNHttpClientConnectionFactory {
 
     private SSLContext sslContext;
     private SSLSetupHandler sslSetupHandler;
     private Map<String,SSLContext> customContexts;
 
-    public LoggingNHttpSSLClientConnectionFactory(ConnectionConfig config,
+    public SynapseNHttpSSLClientConnectionFactory(ConnectionConfig config,
                                                   SSLContext sslContext,
                                                   SSLSetupHandler sslSetupHandler,
                                                   Map<String, SSLContext> customContexts) {
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpSSLServerConnectionFactory.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpSSLServerConnectionFactory.java
similarity index 87%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpSSLServerConnectionFactory.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpSSLServerConnectionFactory.java
index 0452938..673f979 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpSSLServerConnectionFactory.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpSSLServerConnectionFactory.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn;
 
 import org.apache.http.config.ConnectionConfig;
 import org.apache.http.impl.nio.DefaultNHttpServerConnection;
@@ -29,15 +29,15 @@
 import javax.net.ssl.SSLContext;
 
 /**
- * The SSL-enabled version of the LoggingNHttpServerConnectionFactory. Identical in behavior
+ * The SSL-enabled version of the SynapseNHttpServerConnectionFactory. Identical in behavior
  * to the parent class, but wraps IOSession instances with SSLIOSession instances.
  */
-public class LoggingNHttpSSLServerConnectionFactory extends LoggingNHttpServerConnectionFactory {
+public class SynapseNHttpSSLServerConnectionFactory extends SynapseNHttpServerConnectionFactory {
 
     private SSLContext sslContext;
     private SSLSetupHandler sslSetupHandler;
 
-    public LoggingNHttpSSLServerConnectionFactory(ConnectionConfig config, SSLContext sslContext,
+    public SynapseNHttpSSLServerConnectionFactory(ConnectionConfig config, SSLContext sslContext,
                                                   SSLSetupHandler sslSetupHandler) {
         super(config);
         this.sslContext = sslContext;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpServerConnectionFactory.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpServerConnectionFactory.java
similarity index 78%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpServerConnectionFactory.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpServerConnectionFactory.java
index c527984..f83cba1 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpServerConnectionFactory.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/SynapseNHttpServerConnectionFactory.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -37,6 +37,10 @@
 import org.apache.http.nio.reactor.SessionInputBuffer;
 import org.apache.http.nio.reactor.SessionOutputBuffer;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
+import org.apache.synapse.transport.nhttp.AccessHandler;
+import org.apache.synapse.transport.utils.conn.logging.LoggingConstants;
+import org.apache.synapse.transport.utils.conn.logging.LoggingIOSession;
+import org.apache.synapse.transport.utils.conn.logging.LoggingNHttpServerConnection;
 
 import java.io.IOException;
 
@@ -47,7 +51,7 @@
  * objects. Also, depending on the logging configuration, this factory may choose to
  * wrap IOSession instances in LoggingIOSession objects.
  */
-public class LoggingNHttpServerConnectionFactory implements NHttpConnectionFactory<DefaultNHttpServerConnection> {
+public class SynapseNHttpServerConnectionFactory implements NHttpConnectionFactory<DefaultNHttpServerConnection> {
 
     private static final Log sourceConnLog = LogFactory.getLog(
             LoggingConstants.SOURCE_CONNECTION_LOG_ID);
@@ -65,14 +69,14 @@
 
     private final ConnectionConfig config;
 
-    public LoggingNHttpServerConnectionFactory(ConnectionConfig config) {
+    public SynapseNHttpServerConnectionFactory(ConnectionConfig config) {
         this.config = config;
     }
 
     public DefaultNHttpServerConnection createConnection(IOSession session) {
         if (sourceSessionLog.isDebugEnabled() || sourceWireLog.isDebugEnabled()) {
             session = new LoggingIOSession(sourceSessionLog, sourceWireLog,
-                    session, "http-listener");
+                                           session, "http-listener");
         }
 
         if (sourceConnLog.isDebugEnabled()) {
@@ -126,11 +130,17 @@
 
         public HttpRequest parse() throws IOException, HttpException {
             HttpRequest request = super.parse();
-            if (request != null && sourceHeaderLog.isDebugEnabled()) {
-                sourceHeaderLog.debug(">> " + request.getRequestLine().toString());
-                Header[] headers = request.getAllHeaders();
-                for (Header header : headers) {
-                    sourceHeaderLog.debug(">> " + header.toString());
+            if (request != null) {
+                if (sourceHeaderLog.isDebugEnabled()) {
+                    sourceHeaderLog.debug(">> " + request.getRequestLine().toString());
+                    Header[] headers = request.getAllHeaders();
+                    for (Header header : headers) {
+                        sourceHeaderLog.debug(">> " + header.toString());
+                    }
+                }
+
+                if (AccessHandler.getAccessLog().isInfoEnabled()) {
+                    AccessHandler.getAccess().addAccessToQueue(request);
                 }
             }
             return request;
@@ -144,11 +154,17 @@
         }
 
         public void write(final HttpResponse response) throws IOException, HttpException {
-            if (response != null && sourceHeaderLog.isDebugEnabled()) {
-                sourceHeaderLog.debug("<< " + response.getStatusLine().toString());
-                Header[] headers = response.getAllHeaders();
-                for (Header header : headers) {
-                    sourceHeaderLog.debug("<< " + header.toString());
+            if (response != null) {
+                if (response != null && sourceHeaderLog.isDebugEnabled()) {
+                    sourceHeaderLog.debug("<< " + response.getStatusLine().toString());
+                    Header[] headers = response.getAllHeaders();
+                    for (Header header : headers) {
+                        sourceHeaderLog.debug("<< " + header.toString());
+                    }
+                }
+
+                if (AccessHandler.getAccessLog().isInfoEnabled()) {
+                    AccessHandler.getAccess().addAccessToQueue(response);
                 }
             }
             super.write(response);
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingClientEventHandler.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingClientEventHandler.java
similarity index 98%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingClientEventHandler.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingClientEventHandler.java
index c4188f6..2e88ab8 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingClientEventHandler.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingClientEventHandler.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingConstants.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingConstants.java
similarity index 96%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingConstants.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingConstants.java
index a912922..62df795 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingConstants.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingConstants.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 public class LoggingConstants {
 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingIOSession.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingIOSession.java
similarity index 99%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingIOSession.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingIOSession.java
index d5d66b2..1b6808e 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingIOSession.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingIOSession.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 import org.apache.commons.logging.Log;
 import org.apache.http.nio.reactor.IOSession;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnection.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingNHttpClientConnection.java
similarity index 94%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnection.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingNHttpClientConnection.java
index 8e4c411..685b24f 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpClientConnection.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingNHttpClientConnection.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 import org.apache.commons.logging.Log;
 import org.apache.http.HttpException;
@@ -25,12 +25,12 @@
 import org.apache.http.HttpResponse;
 import org.apache.http.config.MessageConstraints;
 import org.apache.http.entity.ContentLengthStrategy;
-import org.apache.http.impl.nio.DefaultNHttpClientConnection;
 import org.apache.http.nio.NHttpClientEventHandler;
 import org.apache.http.nio.NHttpMessageParserFactory;
 import org.apache.http.nio.NHttpMessageWriterFactory;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.util.ByteBufferAllocator;
+import org.apache.synapse.transport.utils.conn.SynapseNHttpClientConnection;
 
 import java.io.IOException;
 import java.nio.charset.CharsetDecoder;
@@ -41,7 +41,7 @@
  * additional logging features. This implementation enhances the default connection
  * class by logging all the major events that occur on the connection instance.
  */
-public class LoggingNHttpClientConnection extends DefaultNHttpClientConnection {
+public class LoggingNHttpClientConnection extends SynapseNHttpClientConnection {
 
     private final Log log;
 
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpServerConnection.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingNHttpServerConnection.java
similarity index 98%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpServerConnection.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingNHttpServerConnection.java
index de42d33..cd23c77 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingNHttpServerConnection.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingNHttpServerConnection.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 import org.apache.commons.logging.Log;
 import org.apache.http.HttpException;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingServerEventHandler.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingServerEventHandler.java
similarity index 98%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingServerEventHandler.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingServerEventHandler.java
index ee50c39..3e94355 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingServerEventHandler.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingServerEventHandler.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingUtils.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingUtils.java
similarity index 89%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingUtils.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingUtils.java
index deaa726..73561d3 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/LoggingUtils.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/LoggingUtils.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -27,6 +27,10 @@
 import org.apache.http.nio.NHttpClientEventHandler;
 import org.apache.http.nio.NHttpServerEventHandler;
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
+import org.apache.synapse.transport.utils.conn.SynapseNHttpClientConnectionFactory;
+import org.apache.synapse.transport.utils.conn.SynapseNHttpSSLClientConnectionFactory;
+import org.apache.synapse.transport.utils.conn.SynapseNHttpSSLServerConnectionFactory;
+import org.apache.synapse.transport.utils.conn.SynapseNHttpServerConnectionFactory;
 
 import javax.net.ssl.SSLContext;
 import java.util.Map;
@@ -45,7 +49,7 @@
     public static DefaultHttpServerIODispatch getServerIODispatch(final NHttpServerEventHandler handler,
                                                                   final ConnectionConfig config) {
         return new DefaultHttpServerIODispatch(decorate(handler),
-                new LoggingNHttpServerConnectionFactory(config));
+                new SynapseNHttpServerConnectionFactory(config));
     }
 
     /**
@@ -64,7 +68,7 @@
                                                                   final SSLContext sslContext,
                                                                   final SSLSetupHandler sslSetupHandler) {
         return new DefaultHttpServerIODispatch(decorate(handler),
-                new LoggingNHttpSSLServerConnectionFactory(config, sslContext, sslSetupHandler));
+                new SynapseNHttpSSLServerConnectionFactory(config, sslContext, sslSetupHandler));
     }
 
     /**
@@ -79,7 +83,7 @@
     public static DefaultHttpClientIODispatch getClientIODispatch(final NHttpClientEventHandler handler,
                                                                   final ConnectionConfig config) {
         return new DefaultHttpClientIODispatch(decorate(handler),
-                new LoggingNHttpClientConnectionFactory(config));
+                new SynapseNHttpClientConnectionFactory(config));
     }
 
     /**
@@ -100,7 +104,7 @@
                                                                   final SSLSetupHandler sslSetupHandler,
                                                                   Map<String, SSLContext> customContexts) {
         return new DefaultHttpClientIODispatch(decorate(handler),
-                new LoggingNHttpSSLClientConnectionFactory(config, sslContext, sslSetupHandler, customContexts));
+                new SynapseNHttpSSLClientConnectionFactory(config, sslContext, sslSetupHandler, customContexts));
     }
 
     private static NHttpClientEventHandler decorate(NHttpClientEventHandler handler) {
diff --git a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/Wire.java b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/Wire.java
similarity index 98%
rename from java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/Wire.java
rename to java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/Wire.java
index b5b46c6..56ec396 100644
--- a/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/logging/Wire.java
+++ b/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/utils/conn/logging/Wire.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.synapse.transport.utils.logging;
+package org.apache.synapse.transport.utils.conn.logging;
 
 import org.apache.commons.logging.Log;
 
diff --git a/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java b/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java
index 1a1abbc..cb66341 100644
--- a/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java
+++ b/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java
@@ -23,7 +23,6 @@
 import junit.framework.TestSuite;
 
 import org.apache.axis2.transport.testkit.ManagedTestSuite;
-import org.apache.axis2.transport.testkit.axis2.TransportDescriptionFactory;
 import org.apache.axis2.transport.testkit.http.HttpTransportTestSuiteBuilder;
 
 public class HttpCoreNIOListenerTest extends TestCase {
@@ -33,7 +32,7 @@
         // These tests don't work because of a problem similar to SYNAPSE-418
         suite.addExclude("(test=EchoXML)");
         
-        TransportDescriptionFactory tdfNIO = new HttpTransportDescriptionFactory();
+        HttpTransportDescriptionFactory tdfNIO = new HttpTransportDescriptionFactory();
         
         HttpTransportTestSuiteBuilder builder = new HttpTransportTestSuiteBuilder(suite, tdfNIO);
         
diff --git a/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/passthru/util/RelayUtilsTest.java b/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/passthru/util/RelayUtilsTest.java
new file mode 100644
index 0000000..85e6c8e
--- /dev/null
+++ b/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/passthru/util/RelayUtilsTest.java
@@ -0,0 +1,102 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.synapse.transport.passthru.util;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.nio.charset.Charset;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.commons.io.input.ReaderInputStream;
+import org.junit.Before;
+import org.junit.Test;
+
+public class RelayUtilsTest {
+
+    private static final Charset UTF8 = Charset.forName("UTF-8");
+
+    private final String xml =
+            "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>"
+            + "<s:Body><payload><data>value</data></payload></s:Body>"
+            + "</s:Envelope>";
+
+    private final QName payloadQName = new QName("payload");
+
+    MessageContext msgCtx;
+
+    @Before
+    public void setUp() throws Exception {
+        msgCtx = new MessageContext();
+
+        AxisConfiguration configuration = new AxisConfiguration();
+        ConfigurationContext context = new ConfigurationContext(configuration);
+        msgCtx.setConfigurationContext(context);
+    }
+
+    @Test
+    public void testSOAPBodyIsntFullyReadWhenNotUsingBinaryRelayBuilder()
+            throws IOException, XMLStreamException {
+
+        SOAPEnvelope envelope = OMXMLBuilderFactory
+                .createSOAPModelBuilder(new StringReader(xml)).getSOAPEnvelope();
+
+        msgCtx.setEnvelope(envelope);
+
+        // Build message when using pass through pipe or binary relay builder
+        RelayUtils.buildMessage(msgCtx);
+
+        // Ensure that the payload element is accessible
+        assertEquals(payloadQName, msgCtx.getEnvelope().getBody().getFirstElement().getQName());
+
+        // Ensure that the body isn't fully build to support the use of deferred building
+        assertFalse(msgCtx.getEnvelope().getBody().isComplete());
+    }
+
+    @Test
+    public void testBinaryRelayPayloadExpandsToOriginalPayload()
+            throws IOException, XMLStreamException {
+
+        // Transform request soap message into a binary payload
+        BinaryRelayBuilder builder = new BinaryRelayBuilder();
+        InputStream stream = new ReaderInputStream(new StringReader(xml), UTF8);
+        OMElement element = builder.processDocument(stream, "text/xml", msgCtx);
+        msgCtx.setEnvelope((SOAPEnvelope)element);
+
+        // Build message when using pass through pipe or binary relay builder
+        RelayUtils.buildMessage(msgCtx);
+
+        // Ensure that the binary payload is transformed to the appropriate element
+        assertEquals(payloadQName, msgCtx.getEnvelope().getBody().getFirstElement().getQName());
+
+        // Ensure that the body isn't fully build to support the use of deferred building
+        assertFalse(msgCtx.getEnvelope().getBody().isComplete());
+    }
+
+}
diff --git a/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/utils/sslcert/RevocationVerificationTest.java b/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/utils/sslcert/RevocationVerificationTest.java
index ed154bb..4949c6f 100644
--- a/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/utils/sslcert/RevocationVerificationTest.java
+++ b/java/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/utils/sslcert/RevocationVerificationTest.java
@@ -18,17 +18,19 @@
  */
 package org.apache.synapse.transport.utils.sslcert;
 
-import junit.framework.TestCase;
 import org.apache.synapse.transport.utils.sslcert.crl.CRLCache;
 import org.apache.synapse.transport.utils.sslcert.crl.CRLVerifier;
 import org.apache.synapse.transport.utils.sslcert.ocsp.OCSPCache;
 import org.apache.synapse.transport.utils.sslcert.ocsp.OCSPVerifier;
 import org.apache.synapse.transport.utils.sslcert.pathvalidation.CertificatePathValidator;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
 
 import java.security.Security;
 import java.security.cert.X509Certificate;
 
-public class RevocationVerificationTest extends TestCase {
+public class RevocationVerificationTest extends Assert {
 
     /**
      * Tests CRL Path Validation with the use of a real certificate chain. The verification process
@@ -40,6 +42,8 @@
      *
      * @throws Exception
      */
+    @Test
+    @Ignore("Unit tests with builtin expiration date are bad")
     public void testCRLPathValidation() throws Exception {
         //Add BouncyCastle as Security Provider.
         Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
@@ -54,6 +58,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testCRLPathValidationWithFakeCerts() throws Exception {
         //Add BouncyCastle as Security Provider.
         Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
@@ -76,6 +81,8 @@
      *
      * @throws Exception
      */
+    @Test
+    @Ignore("Unit tests with builtin expiration date are bad")
     public void testOCSPPathValidation() throws Exception {
         //Add BouncyCastle as Security Provider.
         Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
@@ -91,6 +98,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testOCSPPathValidationWithFakeCerts() throws Exception {
 
         Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
diff --git a/java/modules/transports/core/nhttp/src/test/resources/nhttp.properties b/java/modules/transports/core/nhttp/src/test/resources/nhttp.properties
index 249e88f..ceb3a49 100644
--- a/java/modules/transports/core/nhttp/src/test/resources/nhttp.properties
+++ b/java/modules/transports/core/nhttp/src/test/resources/nhttp.properties
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 http.socket.timeout=60000
 http.connection.timeout=0
 http.socket.buffer-size=8192
@@ -10,4 +27,4 @@
 # Used by HttpTransportConfiguration tests
 test.foo=1000
 test.bar=Testing
-test.baz=true
\ No newline at end of file
+test.baz=true
diff --git a/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVCA-1 b/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVCA-1
index ac1730f..dbbfc70 100644
--- a/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVCA-1
+++ b/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVCA-1
@@ -1,39 +1,28 @@
 -----BEGIN CERTIFICATE-----

-MIIG5jCCBc6gAwIBAgIQAze5KDR8YKauxa2xIX84YDANBgkqhkiG9w0BAQUFADBs

+MIIEtjCCA56gAwIBAgIQDHmpRLCMEZUgkmFf4msdgzANBgkqhkiG9w0BAQsFADBs

 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3

 d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j

-ZSBFViBSb290IENBMB4XDTA3MTEwOTEyMDAwMFoXDTIxMTExMDAwMDAwMFowaTEL

+ZSBFViBSb290IENBMB4XDTEzMTAyMjEyMDAwMFoXDTI4MTAyMjEyMDAwMFowdTEL

 MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3

-LmRpZ2ljZXJ0LmNvbTEoMCYGA1UEAxMfRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug

-RVYgQ0EtMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPOWYth1bhn/

-PzR8SU8xfg0ETpmB4rOFVZEwscCvcLssqOcYqj9495BoUoYBiJfiOwZlkKq9ZXbC

-7L4QWzd4g2B1Rca9dKq2n6Q6AVAXxDlpufFP74LByvNK28yeUE9NQKM6kOeGZrzw

-PnYoTNF1gJ5qNRQ1A57bDIzCKK1Qss72kaPDpQpYSfZ1RGy6+c7pqzoC4E3zrOJ6

-4GAiBTyC01Li85xH+DvYskuTVkq/cKs+6WjIHY9YHSpNXic9rQpZL1oRIEDZaARo

-LfTAhAsKG3jf7RpY3PtBWm1r8u0c7lwytlzs16YDMqbo3rcoJ1mIgP97rYlY1R4U

-pPKwcNSgPqcCAwEAAaOCA4UwggOBMA4GA1UdDwEB/wQEAwIBhjA7BgNVHSUENDAy

-BggrBgEFBQcDAQYIKwYBBQUHAwIGCCsGAQUFBwMDBggrBgEFBQcDBAYIKwYBBQUH

-AwgwggHEBgNVHSAEggG7MIIBtzCCAbMGCWCGSAGG/WwCATCCAaQwOgYIKwYBBQUH

-AgEWLmh0dHA6Ly93d3cuZGlnaWNlcnQuY29tL3NzbC1jcHMtcmVwb3NpdG9yeS5o

-dG0wggFkBggrBgEFBQcCAjCCAVYeggFSAEEAbgB5ACAAdQBzAGUAIABvAGYAIAB0

-AGgAaQBzACAAQwBlAHIAdABpAGYAaQBjAGEAdABlACAAYwBvAG4AcwB0AGkAdAB1

-AHQAZQBzACAAYQBjAGMAZQBwAHQAYQBuAGMAZQAgAG8AZgAgAHQAaABlACAARABp

-AGcAaQBDAGUAcgB0ACAARQBWACAAQwBQAFMAIABhAG4AZAAgAHQAaABlACAAUgBl

-AGwAeQBpAG4AZwAgAFAAYQByAHQAeQAgAEEAZwByAGUAZQBtAGUAbgB0ACAAdwBo

-AGkAYwBoACAAbABpAG0AaQB0ACAAbABpAGEAYgBpAGwAaQB0AHkAIABhAG4AZAAg

-AGEAcgBlACAAaQBuAGMAbwByAHAAbwByAGEAdABlAGQAIABoAGUAcgBlAGkAbgAg

-AGIAeQAgAHIAZQBmAGUAcgBlAG4AYwBlAC4wEgYDVR0TAQH/BAgwBgEB/wIBADCB

-gwYIKwYBBQUHAQEEdzB1MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2Vy

-dC5jb20wTQYIKwYBBQUHMAKGQWh0dHA6Ly93d3cuZGlnaWNlcnQuY29tL0NBQ2Vy

-dHMvRGlnaUNlcnRIaWdoQXNzdXJhbmNlRVZSb290Q0EuY3J0MIGPBgNVHR8EgYcw

-gYQwQKA+oDyGOmh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEhpZ2hB

-c3N1cmFuY2VFVlJvb3RDQS5jcmwwQKA+oDyGOmh0dHA6Ly9jcmw0LmRpZ2ljZXJ0

-LmNvbS9EaWdpQ2VydEhpZ2hBc3N1cmFuY2VFVlJvb3RDQS5jcmwwHQYDVR0OBBYE

-FExYyyXwQU9S9CjIgUObpqig5pLlMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSYJhoI

-Au9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQBMeheHKF0XvLIyc7/NLvVYMR3wsXFU

-nNabZ5PbLwM+Fm8eA8lThKNWYB54lBuiqG+jpItSkdfdXJW777UWSemlQk808kf/

-roF/E1S3IMRwFcuBCoHLdFfcnN8kpCkMGPAc5K4HM+zxST5Vz25PDVR708noFUjU

-xbvcNRx3RQdIRYW9135TuMAW2ZXNi419yWBP0aKb49Aw1rRzNubS+QOy46T15bg+

-BEkAui6mSnKDcp33C4ypieez12Qf1uNgywPE3IjpnSUBAHHLA7QpYCWP+UbRe3Gu

-zVMSW4SOwg/H7ZMZ2cn6j1g0djIvruFQFGHUqFijyDATI+/GJYw2jxyA

------END CERTIFICATE-----

+LmRpZ2ljZXJ0LmNvbTE0MDIGA1UEAxMrRGlnaUNlcnQgU0hBMiBFeHRlbmRlZCBW

+YWxpZGF0aW9uIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC

+ggEBANdTpARR+JmmFkhLZyeqk0nQOe0MsLAAh/FnKIaFjI5j2ryxQDji0/XspQUY

+uD0+xZkXMuwYjPrxDKZkIYXLBxA0sFKIKx9om9KxjxKws9LniB8f7zh3VFNfgHk/

+LhqqqB5LKw2rt2O5Nbd9FLxZS99RStKh4gzikIKHaq7q12TWmFXo/a8aUGxUvBHy

+/Urynbt/DvTVvo4WiRJV2MBxNO723C3sxIclho3YIeSwTQyJ3DkmF93215SF2AQh

+cJ1vb/9cuhnhRctWVyh+HA1BV6q3uCe7seT6Ku8hI3UarS2bhjWMnHe1c63YlC3k

+8wyd7sFOYn4XwHGeLN7x+RAoGTMCAwEAAaOCAUkwggFFMBIGA1UdEwEB/wQIMAYB

+Af8CAQAwDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF

+BQcDAjA0BggrBgEFBQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRp

+Z2ljZXJ0LmNvbTBLBgNVHR8ERDBCMECgPqA8hjpodHRwOi8vY3JsNC5kaWdpY2Vy

+dC5jb20vRGlnaUNlcnRIaWdoQXNzdXJhbmNlRVZSb290Q0EuY3JsMD0GA1UdIAQ2

+MDQwMgYEVR0gADAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5j

+b20vQ1BTMB0GA1UdDgQWBBQ901Cl1qCt7vNKYApl0yHU+PjWDzAfBgNVHSMEGDAW

+gBSxPsNpA/i/RwHUmCYaCALvY2QrwzANBgkqhkiG9w0BAQsFAAOCAQEAnbbQkIbh

+hgLtxaDwNBx0wY12zIYKqPBKikLWP8ipTa18CK3mtlC4ohpNiAexKSHc59rGPCHg

+4xFJcKx6HQGkyhE6V6t9VypAdP3THYUYUN9XR3WhfVUgLkc3UHKMf4Ib0mKPLQNa

+2sPIoc4sUqIAY+tzunHISScjl2SFnjgOrWNoPLpSgVh5oywM395t6zHyuqB8bPEs

+1OG9d4Q3A84ytciagRpKkk47RpqF/oOi+Z6Mo8wNXrM9zwR4jxQUezKcxwCmXMS1

+oVWNWlZopCJwqjyBcdmdqEU79OX2olHdx3ti6G8MdOu42vi/hw15UJGQmxg7kVkn

+8TUoE6smftX3eg==

+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVRootCA b/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVRootCA
index 4b1bc66..9b79226 100644
--- a/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVRootCA
+++ b/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/DigiCertHighAssuranceEVRootCA
@@ -20,4 +20,4 @@
 Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe

 vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep

 +OkuE6N36B9K

------END CERTIFICATE-----

+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/github.com b/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/github.com
index c01b122..192db84 100644
--- a/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/github.com
+++ b/java/modules/transports/core/nhttp/src/test/resources/org/apache/synapse/transport/utils/sslcert/certificates/github/github.com
@@ -1,41 +1,34 @@
 -----BEGIN CERTIFICATE-----

-MIIHOjCCBiKgAwIBAgIQBH++LkveAITSyvjj7P5wWDANBgkqhkiG9w0BAQUFADBp

+MIIF4DCCBMigAwIBAgIQDACTENIG2+M3VTWAEY3chzANBgkqhkiG9w0BAQsFADB1

 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3

-d3cuZGlnaWNlcnQuY29tMSgwJgYDVQQDEx9EaWdpQ2VydCBIaWdoIEFzc3VyYW5j

-ZSBFViBDQS0xMB4XDTEzMDYxMDAwMDAwMFoXDTE1MDkwMjEyMDAwMFowgfAxHTAb

-BgNVBA8MFFByaXZhdGUgT3JnYW5pemF0aW9uMRMwEQYLKwYBBAGCNzwCAQMTAlVT

-MRkwFwYLKwYBBAGCNzwCAQITCERlbGF3YXJlMRAwDgYDVQQFEwc1MTU3NTUwMRcw

-FQYDVQQJEw41NDggNHRoIFN0cmVldDEOMAwGA1UEERMFOTQxMDcxCzAJBgNVBAYT

-AlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2Nv

-MRUwEwYDVQQKEwxHaXRIdWIsIEluYy4xEzARBgNVBAMTCmdpdGh1Yi5jb20wggEi

-MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDt04nDXXByCfMzTxpydNm2WpVQ

-u2hhn/f7Hxnh2gQxrxV8Gn/5c68d5UMrVgkARWlK6MRb38J3UlEZW9Er2TllNqAy

-GRxBc/sysj2fmOyCWws3ZDkstxCDcs3w6iRL+tmULsOFFTmpOvaI2vQniaaVT4Si

-N058JXg6yYNtAheVeH1HqFWD7hPIGRqzPPFf/jsC4YX7EWarCV2fTEPwxyReKXIo

-ztR1aE8kcimuOSj8341PTYNzdAxvEZun3WLe/+LrF+b/DL/ALTE71lmi8t2HSkh7

-bTMRFE00nzI49sgZnfG2PcVG71ELisYz7UhhxB0XG718tmfpOc+lUoAK9OrNAgMB

-AAGjggNUMIIDUDAfBgNVHSMEGDAWgBRMWMsl8EFPUvQoyIFDm6aooOaS5TAdBgNV

-HQ4EFgQUh9GPGW7kh29TjHeRB1Dfo79VRyAwJQYDVR0RBB4wHIIKZ2l0aHViLmNv

-bYIOd3d3LmdpdGh1Yi5jb20wDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsG

-AQUFBwMBBggrBgEFBQcDAjBjBgNVHR8EXDBaMCugKaAnhiVodHRwOi8vY3JsMy5k

-aWdpY2VydC5jb20vZXZjYTEtZzIuY3JsMCugKaAnhiVodHRwOi8vY3JsNC5kaWdp

-Y2VydC5jb20vZXZjYTEtZzIuY3JsMIIBxAYDVR0gBIIBuzCCAbcwggGzBglghkgB

-hv1sAgEwggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3LmRpZ2ljZXJ0LmNvbS9z

-c2wtY3BzLXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUHAgIwggFWHoIBUgBBAG4A

-eQAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQByAHQAaQBmAGkAYwBhAHQA

-ZQAgAGMAbwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBjAGUAcAB0AGEAbgBjAGUA

-IABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAgAEMAUAAvAEMAUABTACAA

-YQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQAGEAcgB0AHkAIABBAGcA

-cgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBtAGkAdAAgAGwAaQBhAGIA

-aQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBjAG8AcgBwAG8AcgBhAHQA

-ZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBlAHIAZQBuAGMAZQAuMH0G

-CCsGAQUFBwEBBHEwbzAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQu

-Y29tMEcGCCsGAQUFBzAChjtodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGln

-aUNlcnRIaWdoQXNzdXJhbmNlRVZDQS0xLmNydDAMBgNVHRMBAf8EAjAAMA0GCSqG

-SIb3DQEBBQUAA4IBAQBfFW1nwzrVo94WnEUzJtU9yRZ0NMqHSBsUkG31q0eGufW4

-4wFFZWjuqRJ1n3Ym7xF8fTjP3fdKGQnxIHKSsE0nuuh/XbQX5DpBJknHdGFoLwY8

-xZ9JPI57vgvzLo8+fwHyZp3Vm/o5IYLEQViSo+nlOSUQ8YAVqu6KcsP/e612UiqS

-+UMBmgdx9KPDDzZy4MJZC2hbfUoXj9A54mJN8cuEOPyw3c3yKOcq/h48KzVguQXi

-SdJbwfqNIbQ9oJM+YzDjzS62+TCtNSNWzWbwABZCmuQxK0oEOSbTmbhxUF7rND3/

-+mx9u8cY//7uAxLWYS5gIZlCbxcf0lkiKSHJB319

------END CERTIFICATE-----

+d3cuZGlnaWNlcnQuY29tMTQwMgYDVQQDEytEaWdpQ2VydCBTSEEyIEV4dGVuZGVk

+IFZhbGlkYXRpb24gU2VydmVyIENBMB4XDTE0MDQwODAwMDAwMFoXDTE2MDQxMjEy

+MDAwMFowgfAxHTAbBgNVBA8MFFByaXZhdGUgT3JnYW5pemF0aW9uMRMwEQYLKwYB

+BAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQITCERlbGF3YXJlMRAwDgYDVQQF

+Ewc1MTU3NTUwMRcwFQYDVQQJEw41NDggNHRoIFN0cmVldDEOMAwGA1UEERMFOTQx

+MDcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T

+YW4gRnJhbmNpc2NvMRUwEwYDVQQKEwxHaXRIdWIsIEluYy4xEzARBgNVBAMTCmdp

+dGh1Yi5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx1Nw8r/3z

+Tu3BZ63myyLot+KrKPL33GJwCNEMr9YWaiGwNksXDTZjBK6/6iBRlWVm8r+5TaQM

+Kev1FbHoNbNwEJTVG1m0Jg/Wg1dZneF8Cd3gE8pNb0Obzc+HOhWnhd1mg+2TDP4r

+bTgceYiQz61YGC1R0cKj8keMbzgJubjvTJMLy4OUh+rgo7XZe5trD0P5yu6ADSin

+dvEl9ME1PPZ0rd5qM4J73P1LdqfC7vJqv6kkpl/nLnwO28N0c/p+xtjPYOs2ViG2

+wYq4JIJNeCS66R2hiqeHvmYlab++O3JuT+DkhSUIsZGJuNZ0ZXabLE9iH6H6Or6c

+JL+fyrDFwGeNAgMBAAGjggHuMIIB6jAfBgNVHSMEGDAWgBQ901Cl1qCt7vNKYApl

+0yHU+PjWDzAdBgNVHQ4EFgQUakOQfTuYFHJSlTqqKApD+FF+06YwJQYDVR0RBB4w

+HIIKZ2l0aHViLmNvbYIOd3d3LmdpdGh1Yi5jb20wDgYDVR0PAQH/BAQDAgWgMB0G

+A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjB1BgNVHR8EbjBsMDSgMqAwhi5o

+dHRwOi8vY3JsMy5kaWdpY2VydC5jb20vc2hhMi1ldi1zZXJ2ZXItZzEuY3JsMDSg

+MqAwhi5odHRwOi8vY3JsNC5kaWdpY2VydC5jb20vc2hhMi1ldi1zZXJ2ZXItZzEu

+Y3JsMEIGA1UdIAQ7MDkwNwYJYIZIAYb9bAIBMCowKAYIKwYBBQUHAgEWHGh0dHBz

+Oi8vd3d3LmRpZ2ljZXJ0LmNvbS9DUFMwgYgGCCsGAQUFBwEBBHwwejAkBggrBgEF

+BQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMFIGCCsGAQUFBzAChkZodHRw

+Oi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRTSEEyRXh0ZW5kZWRWYWxp

+ZGF0aW9uU2VydmVyQ0EuY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQAD

+ggEBAG/nbcuC8++QhwnXDxUiLIz+06scipbbXRJd0XjAMbD/RciJ9wiYUhcfTEsg

+ZGpt21DXEL5+q/4vgNipSlhBaYFyGQiDm5IQTmIte0ZwQ26jUxMf4pOmI1v3kj43

+FHU7uUskQS6lPUgND5nqHkKXxv6V2qtHmssrA9YNQMEK93ga2rWDpK21mUkgLviT

+PB5sPdE7IzprOCp+Ynpf3RcFddAkXb6NqJoQRPrStMrv19C1dqUmJRwIQdhkkqev

+ff6IQDlhC8BIMKmCNK33cEYDfDWROtW7JNgBvBTwww8jO1gyug8SbGZ6bZ3k8OV8

+XX4C2NesiZcLYbc2n7B9O+63M2k=

+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/java/modules/transports/core/nhttp/src/test/resources/test-http.properties b/java/modules/transports/core/nhttp/src/test/resources/test-http.properties
index b39f5e8..5bd2fd8 100644
--- a/java/modules/transports/core/nhttp/src/test/resources/test-http.properties
+++ b/java/modules/transports/core/nhttp/src/test/resources/test-http.properties
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 # Used in HttpTransportConfigurationTest
 
 http.socket.timeout=60000
diff --git a/java/modules/transports/core/pipe/pom.xml b/java/modules/transports/core/pipe/pom.xml
index 1007b33..8354ebd 100644
--- a/java/modules/transports/core/pipe/pom.xml
+++ b/java/modules/transports/core/pipe/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>synapse-transports</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -63,4 +60,4 @@
         </plugins>
     </build>
 
-</project>
\ No newline at end of file
+</project>
diff --git a/java/modules/transports/core/pipe/src/test/java/org/apache/synapse/transport/pipe/EndDelimitedProtocolTest.java b/java/modules/transports/core/pipe/src/test/java/org/apache/synapse/transport/pipe/EndDelimitedProtocolTest.java
index 965ac45..88fa748 100644
--- a/java/modules/transports/core/pipe/src/test/java/org/apache/synapse/transport/pipe/EndDelimitedProtocolTest.java
+++ b/java/modules/transports/core/pipe/src/test/java/org/apache/synapse/transport/pipe/EndDelimitedProtocolTest.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.transport.pipe;
 
 import java.io.ByteArrayInputStream;
diff --git a/java/modules/transports/core/vfs/pom.xml b/java/modules/transports/core/vfs/pom.xml
index 59a47d1..4891c7a 100644
--- a/java/modules/transports/core/vfs/pom.xml
+++ b/java/modules/transports/core/vfs/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>synapse-transports</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/java/modules/transports/core/vfs/src/main/assembly/testkit-logs.xml b/java/modules/transports/core/vfs/src/main/assembly/testkit-logs.xml
index 7eae7ff..2df5925 100644
--- a/java/modules/transports/core/vfs/src/main/assembly/testkit-logs.xml
+++ b/java/modules/transports/core/vfs/src/main/assembly/testkit-logs.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <assembly>
     <id>testkit-logs</id>
     <formats>
diff --git a/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportListener.java b/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportListener.java
index 32383f2..7306fd9 100644
--- a/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportListener.java
+++ b/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportListener.java
@@ -234,8 +234,8 @@
                                 metrics.incrementMessagesReceived();
 
                             } catch (AxisFault e) {
-                                logException("Error processing File URI : "
-                                        + fileObject.getName(), e);
+                                logException("Error processing File URI : " +
+                                             VFSUtils.maskURLPassword(fileObject.getName().getURI()), e);
                                 entry.setLastPollState(PollTableEntry.FAILED);
                                 metrics.incrementFaultsReceiving();
                             }
@@ -259,8 +259,8 @@
                               }
                             }
                         } else if (log.isDebugEnabled()) {
-                            log.debug("Couldn't get the lock for processing the file : "
-                                    + fileObject.getName());
+                            log.debug("Couldn't get the lock for processing the file : " +
+                                      VFSUtils.maskURLPassword(fileObject.getName().getURI()));
                         } else if (isFailedRecord) {
                             if (entry.isFileLockingEnabled()) {
                                 VFSUtils.releaseLock(fsManager, fileObject);
@@ -313,7 +313,8 @@
                                     metrics.incrementMessagesReceived();
 
                                 } catch (Exception e) {
-                                    logException("Error processing File URI : " + child.getName(), e);
+                                    logException("Error processing File URI : " +
+                                                 VFSUtils.maskURLPassword(child.getName().getURI()), e);
                                     failCount++;
                                     // tell moveOrDeleteAfterProcessing() file failed
                                     entry.setLastPollState(PollTableEntry.FAILED);
@@ -424,7 +425,7 @@
                 FileObject dest = moveToDirectory.resolveFile(
                         prefix + fileObject.getName().getBaseName());
                 if (log.isDebugEnabled()) {
-                    log.debug("Moving to file :" + dest.getName().getURI());
+                    log.debug("Moving to file :" + VFSUtils.maskURLPassword(dest.getName().getURI()));
                 }
                 try {
                     fileObject.moveTo(dest);
@@ -511,6 +512,10 @@
                 }
             }
 
+            // remove CLIENT_API_NON_BLOCKING to avoid Thread switching at the Sender level and allow
+            // same Thread to be used till the message is delivered through the endpoint
+            msgContext.removeProperty(msgContext.CLIENT_API_NON_BLOCKING);
+
             // does the service specify a default reply file URI ?
             String replyFileURI = entry.getReplyFileURI();
             if (replyFileURI != null) {
@@ -709,7 +714,7 @@
                 FileObject dest = moveToDirectory.resolveFile(
                         prefix + fileObject.getName().getBaseName());
                 if (log.isDebugEnabled()) {
-                    log.debug("The failed file is moving to :" + dest.getName().getURI());
+                    log.debug("The failed file is moving to :" + VFSUtils.maskURLPassword(dest.getName().getURI()));
                 }
                 try {
                     fileObject.moveTo(dest);
diff --git a/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportSender.java b/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportSender.java
index fad84fd..5b44a62 100644
--- a/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportSender.java
+++ b/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportSender.java
@@ -239,6 +239,12 @@
             } finally {
                 if (replyFile != null) {
                     try {
+                        if (fsManager!= null &&
+                            replyFile.getName() != null && replyFile.getName().getScheme() != null &&
+                            replyFile.getName().getScheme().startsWith("file") &&
+                            replyFile.getParent() != null && replyFile.getParent().getFileSystem() != null) {
+                            fsManager.closeFileSystem(replyFile.getParent().getFileSystem());
+                        }
                         replyFile.close();
                     } catch (FileSystemException ignore) {}
                 }
@@ -272,13 +278,15 @@
                 VFSUtils.releaseLock(fsManager, responseFile);
             }
             metrics.incrementFaultsSending();
-            handleException("IO Error while creating response file : " + responseFile.getName(), e);
+            handleException("IO Error while creating response file : " +
+                            VFSUtils.maskURLPassword(responseFile.getName().getURI()), e);
         } catch (IOException e) {
             if (lockingEnabled) {
                 VFSUtils.releaseLock(fsManager, responseFile);
             }
             metrics.incrementFaultsSending();
-            handleException("IO Error while creating response file : " + responseFile.getName(), e);
+            handleException("IO Error while creating response file : " +
+                            VFSUtils.maskURLPassword(responseFile.getName().getURI()), e);
         }
     }
 
@@ -289,9 +297,9 @@
         // wait till we get the lock
         while (!VFSUtils.acquireLock(fsManager, responseFile)) {
             if (vfsOutInfo.getMaxRetryCount() == tryNum++) {
-                handleException("Couldn't send the message to file : "
-                        + responseFile.getName() + ", unable to acquire the " +
-                        "lock even after " + tryNum + " retries");
+                handleException("Couldn't send the message to file : " +
+                                VFSUtils.maskURLPassword(responseFile.getName().getURI()) +
+                                ", unable to acquire the lock even after " + tryNum + " retries");
             } else {
                 
                 log.warn("Couldn't get the lock for the file : "
diff --git a/java/modules/transports/optional/amqp/pom.xml b/java/modules/transports/optional/amqp/pom.xml
index 2aaf996..1253774 100644
--- a/java/modules/transports/optional/amqp/pom.xml
+++ b/java/modules/transports/optional/amqp/pom.xml
@@ -1,12 +1,30 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
 	<parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>synapse-transports</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -49,7 +67,7 @@
                     <instructions>
                         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                         <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Private-Package></Private-Package>
+                        <Private-Package />
                         <Export-Package>org.apache.synapse.transport.amqp.*</Export-Package>
                         <Import-Package>
                             *;resolution:=optional
diff --git a/java/modules/transports/optional/amqp/src/main/java/org/apache/synapse/transport/amqp/AMQPTransportSender.java b/java/modules/transports/optional/amqp/src/main/java/org/apache/synapse/transport/amqp/AMQPTransportSender.java
index 4676dde..e58852a 100644
--- a/java/modules/transports/optional/amqp/src/main/java/org/apache/synapse/transport/amqp/AMQPTransportSender.java
+++ b/java/modules/transports/optional/amqp/src/main/java/org/apache/synapse/transport/amqp/AMQPTransportSender.java
@@ -27,7 +27,6 @@
 import org.apache.axis2.transport.OutTransportInfo;
 import org.apache.axis2.transport.base.AbstractTransportSender;
 import org.apache.axis2.util.MessageContextBuilder;
-import org.apache.http.protocol.HTTP;
 import org.apache.synapse.transport.amqp.connectionfactory.AMQPTransportConnectionFactoryManager;
 import org.apache.synapse.transport.amqp.pollingtask.AMQPSimpleConsumerTask;
 import org.apache.synapse.transport.amqp.sendertask.AMQPSender;
@@ -291,7 +290,7 @@
             }
             responseMsgCtx.setProperty(
                     Constants.Configuration.CHARACTER_SET_ENCODING,
-                    contentType.indexOf(HTTP.CHARSET_PARAM) > 0
+                    contentType.indexOf("; charset=") > 0
                             ? charSetEnc : MessageContext.DEFAULT_CHAR_SET_ENCODING);
             responseMsgCtx.setProperty(
                     MessageContext.TRANSPORT_HEADERS, message.getHeaders());
diff --git a/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPConsumerClient.java b/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPConsumerClient.java
index c13ea72..72246df 100644
--- a/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPConsumerClient.java
+++ b/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPConsumerClient.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.tranport.amqp;
 
 import com.rabbitmq.client.Channel;
diff --git a/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPProducerClient.java b/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPProducerClient.java
index 1620d1e..f378bf3 100644
--- a/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPProducerClient.java
+++ b/java/modules/transports/optional/amqp/src/test/java/org/apache/synapse/tranport/amqp/AMQPProducerClient.java
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.synapse.tranport.amqp;
 
 import com.rabbitmq.client.Channel;
diff --git a/java/modules/transports/optional/amqp/src/test/resources/amqp-transport.properties b/java/modules/transports/optional/amqp/src/test/resources/amqp-transport.properties
index b2e973e..e5b60b0 100644
--- a/java/modules/transports/optional/amqp/src/test/resources/amqp-transport.properties
+++ b/java/modules/transports/optional/amqp/src/test/resources/amqp-transport.properties
@@ -1,7 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 # Do not edit. This is for JUnit tests.
 string=username@domain.com
 int=10
 long=13
 double=14.4
 boolean1=true
-boolean2=false
\ No newline at end of file
+boolean2=false
diff --git a/java/modules/transports/optional/fix/pom.xml b/java/modules/transports/optional/fix/pom.xml
index 8c2a1fc..8ddabd4 100644
--- a/java/modules/transports/optional/fix/pom.xml
+++ b/java/modules/transports/optional/fix/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>synapse-transports</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -110,8 +107,12 @@
 
     <dependencies>
         <dependency>
-            <groupId>quickfixj</groupId>
-            <artifactId>quickfixj-all</artifactId>
+            <groupId>org.quickfixj</groupId>
+            <artifactId>quickfixj-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.quickfixj</groupId>
+            <artifactId>quickfixj-messages-all</artifactId>
         </dependency>
         <dependency>
             <groupId>xmlunit</groupId>
diff --git a/java/modules/transports/pom.xml b/java/modules/transports/pom.xml
index b1fcb79..7f570ab 100644
--- a/java/modules/transports/pom.xml
+++ b/java/modules/transports/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/java/modules/war/pom.xml b/java/modules/war/pom.xml
index bb910b5..bdad13a 100644
--- a/java/modules/war/pom.xml
+++ b/java/modules/war/pom.xml
@@ -18,15 +18,12 @@
   ~  under the License.
   -->
 
-<project
-        xmlns="http://maven.apache.org/POM/4.0.0"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/java/modules/xar-maven-plugin/pom.xml b/java/modules/xar-maven-plugin/pom.xml
index beff204..f5bc41f 100644
--- a/java/modules/xar-maven-plugin/pom.xml
+++ b/java/modules/xar-maven-plugin/pom.xml
@@ -17,14 +17,12 @@
   ~  specific language governing permissions and limitations
   ~  under the License.
   -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>3.0.2-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -46,7 +44,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.maven</groupId>
-            <artifactId>maven-project</artifactId>
+            <artifactId>maven-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.maven</groupId>
@@ -54,6 +52,10 @@
         </dependency>
         <dependency>
             <groupId>org.apache.maven</groupId>
+            <artifactId>maven-compat</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
             <artifactId>maven-archiver</artifactId>
         </dependency>
         <dependency>
diff --git a/java/modules/xar-maven-plugin/src/main/java/org/apache/synapse/maven/xar/AbstractXarMojo.java b/java/modules/xar-maven-plugin/src/main/java/org/apache/synapse/maven/xar/AbstractXarMojo.java
index b6b416e..4d55161 100644
--- a/java/modules/xar-maven-plugin/src/main/java/org/apache/synapse/maven/xar/AbstractXarMojo.java
+++ b/java/modules/xar-maven-plugin/src/main/java/org/apache/synapse/maven/xar/AbstractXarMojo.java
@@ -43,6 +43,7 @@
 import org.apache.maven.artifact.resolver.ArtifactCollector;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.DebugResolutionListener;
+import org.apache.maven.artifact.resolver.ResolutionListener;
 import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
@@ -358,15 +359,10 @@
         logArtifacts(synapseRuntimeDeps);
         
         log.debug("Resolving transitive dependencies for " + synapseCore + " ...");
-        try {
-            synapseRuntimeDeps = artifactCollector.collect(synapseRuntimeDeps,
-                    synapseCoreProject.getArtifact(), synapseCoreProject.getManagedVersionMap(),
-                    localRepository, remoteArtifactRepositories, artifactMetadataSource, null,
-                    Collections.singletonList(new DebugResolutionListener(logger))).getArtifacts();
-        } catch (ArtifactResolutionException e) {
-            throw new MojoExecutionException("Unable to resolve transitive dependencies for "
-                    + synapseCore);
-        }
+        synapseRuntimeDeps = artifactCollector.collect(synapseRuntimeDeps,
+                synapseCoreProject.getArtifact(), synapseCoreProject.getManagedVersionMap(),
+                localRepository, remoteArtifactRepositories, artifactMetadataSource, null,
+                Collections.<ResolutionListener>singletonList(new DebugResolutionListener(logger))).getArtifacts();
         log.debug("All runtime dependencies for " + synapseCore + " :");
         logArtifacts(synapseRuntimeDeps);
         
diff --git a/java/pom.xml b/java/pom.xml
index 94612b8..d4fbae7 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -18,21 +18,18 @@
   ~  under the License.
   -->
 
-<project
-        xmlns="http://maven.apache.org/POM/4.0.0"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache</groupId>
         <artifactId>apache</artifactId>
-        <version>9</version>
+        <version>18</version>
     </parent>
 
     <groupId>org.apache.synapse</groupId>
     <artifactId>Apache-Synapse</artifactId>
-    <version>2.2.0-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
 
     <name>Apache Synapse</name>
     <description>Apache Synapse</description>
@@ -126,7 +123,7 @@
                 <repository>
                     <id>wso2-m2</id>
                     <name>WSO2 Maven 2 Repository</name>
-                    <url>http://dist.wso2.org/maven2/</url>
+                    <url>https://maven.wso2.org/nexus/content/groups/wso2-public/</url>
                     <releases>
                         <updatePolicy>never</updatePolicy>
                     </releases>
@@ -134,7 +131,7 @@
                         <enabled>false</enabled>
                     </snapshots>
                 </repository>
-                <repository>
+                <!--repository>
                     <id>wso2-m2-snapshots</id>
                     <name>WSO2 Maven 2 SNAPSHOTS Repository</name>
                     <url>http://dist.wso2.org/snapshots/maven2/</url>
@@ -145,7 +142,7 @@
                         <enabled>true</enabled>
                         <updatePolicy>interval:60</updatePolicy>
                     </snapshots>
-                </repository>
+                </repository-->
             </repositories>
         </profile>
         <profile>
@@ -174,7 +171,7 @@
             </build>
         </profile>
     </profiles>
-    
+
     <build>
         <pluginManagement>
             <plugins>
@@ -191,12 +188,12 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-site-plugin</artifactId>
-                    <version>3.0</version>
+                    <version>3.6</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
-                    <version>2.3.2</version>
+                    <version>3.5.1</version>
                     <configuration>
                         <source>${java.version}</source>
                         <target>${java.version}</target>
@@ -252,8 +249,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-assembly-plugin</artifactId>
-                    <!-- The latest version (2.2.2) has a problem with file permissions -->
-                    <version>2.2-beta-2</version>
+                    <version>2.6</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -280,6 +276,19 @@
                     <artifactId>maven-project-info-reports-plugin</artifactId>
                     <version>2.2</version>
                 </plugin>
+                <plugin>
+                    <artifactId>maven-remote-resources-plugin</artifactId>
+                    <version>1.5</version>
+                    <dependencies>
+                        <dependency>
+                            <!-- Workaround for MSHARED-319; remove when upgrading to
+                                 plugin version > 1.5. -->
+                            <groupId>org.apache.maven.shared</groupId>
+                            <artifactId>maven-filtering</artifactId>
+                            <version>1.3</version>
+                        </dependency>
+                    </dependencies>
+                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>
@@ -417,17 +426,27 @@
             <dependency>
                 <groupId>org.apache.axis2</groupId>
                 <artifactId>axis2-transport-base</artifactId>
-                <version>${axis2.transport.version}</version>
+                <version>${axis2.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.axis2</groupId>
                 <artifactId>axis2-transport-jms</artifactId>
-                <version>${axis2.transport.version}</version>
+                <version>${axis2.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.axis2</groupId>
                 <artifactId>axis2-transport-mail</artifactId>
-                <version>${axis2.transport.version}</version>
+                <version>${axis2.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.axis2</groupId>
+                <artifactId>axis2-json</artifactId>
+                <version>${axis2.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.jettison</groupId>
+                <artifactId>jettison</artifactId>
+                <version>${jettison.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.axis2</groupId>
@@ -519,10 +538,6 @@
                         <artifactId>log4j-over-slf4j</artifactId>
                     </exclusion>
                     <exclusion>
-                        <groupId>org.apache.woden</groupId>
-                        <artifactId>woden-core</artifactId>
-                    </exclusion>
-                    <exclusion>
                         <groupId>org.apache.xmlbeans</groupId>
                         <artifactId>xmlbeans</artifactId>
                     </exclusion>
@@ -532,34 +547,16 @@
                 <groupId>org.apache.rampart</groupId>
                 <artifactId>rampart-trust</artifactId>
                 <version>${rampart.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>org.apache.woden</groupId>
-                        <artifactId>woden-core</artifactId>
-                    </exclusion>
-                </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.apache.rampart</groupId>
                 <artifactId>rampart-core</artifactId>
                 <version>${rampart.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>org.apache.woden</groupId>
-                        <artifactId>woden-core</artifactId>
-                    </exclusion>
-                </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.apache.rampart</groupId>
                 <artifactId>rampart</artifactId>
                 <version>${rampart.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>org.apache.woden</groupId>
-                        <artifactId>woden-core</artifactId>
-                    </exclusion>
-                </exclusions>
                 <type>mar</type>
             </dependency>
             <dependency>
@@ -650,10 +647,37 @@
                 <version>${wso2caching.version}</version>
                 <type>jar</type>
                 <exclusions>
+                    <!-- Don't let wso2caching impose a logging implementation -->
                     <exclusion>
                         <groupId>log4j</groupId>
                         <artifactId>log4j</artifactId>
                     </exclusion>
+                    <!-- The wso2caching POM declares a snapshot repository that is now dead
+                         (snapshots.maven.codehaus.org). If we use snapshot versions of
+                         Axis2/Axiom/Neethi, then Maven will start attempting to download them
+                         from the dead repository, causing the build to get stuck. To work
+                         around this, exclude dependencies that we might want to switch to
+                         snapshot versions. -->
+                    <exclusion>
+                        <groupId>org.apache.axis2</groupId>
+                        <artifactId>axis2-kernel</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.axis2</groupId>
+                        <artifactId>axis2-saaj</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.axis2</groupId>
+                        <artifactId>axis2-clustering</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.ws.commons.axiom</groupId>
+                        <artifactId>axiom-api</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.ws.commons.axiom</groupId>
+                        <artifactId>axiom-impl</artifactId>
+                    </exclusion>
                     <exclusion>
                         <groupId>org.apache.neethi</groupId>
                         <artifactId>neethi</artifactId>
@@ -691,6 +715,28 @@
                         <groupId>org.apache.ant</groupId>
                         <artifactId>ant-nodeps</artifactId>
                     </exclusion>
+                    <!-- Work around issues with snapshot dependencies
+                         (see the entry for wso2caching for more details). -->
+                    <exclusion>
+                        <groupId>org.apache.axis2</groupId>
+                        <artifactId>axis2-kernel</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.axis2</groupId>
+                        <artifactId>axis2-clustering</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.ws.commons.axiom</groupId>
+                        <artifactId>axiom-api</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.ws.commons.axiom</groupId>
+                        <artifactId>axiom-impl</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.neethi</groupId>
+                        <artifactId>neethi</artifactId>
+                    </exclusion>
                 </exclusions>
             </dependency>
 
@@ -729,7 +775,7 @@
             <dependency>
                 <groupId>org.apache.axis2</groupId>
                 <artifactId>axis2-transport-testkit</artifactId>
-                <version>${axis2.transport.version}</version>
+                <version>${axis2.version}</version>
                 <scope>test</scope>
             </dependency>
             <dependency>
@@ -790,19 +836,19 @@
 
             <!-- Saxon -->
             <dependency>
-                 <groupId>net.sf.saxon</groupId>
-                 <artifactId>saxon</artifactId>
-                 <version>${saxon.version}</version>
+                <groupId>net.sf.saxon</groupId>
+                <artifactId>saxon</artifactId>
+                <version>${saxon.version}</version>
             </dependency>
             <dependency>
-                 <groupId>net.sf.saxon</groupId>
-                 <artifactId>saxon-dom</artifactId>
-                 <version>${saxon.version}</version>
+                <groupId>net.sf.saxon</groupId>
+                <artifactId>saxon-dom</artifactId>
+                <version>${saxon.version}</version>
             </dependency>
             <dependency>
-                 <groupId>net.sf.saxon</groupId>
-                 <artifactId>saxon-xqj</artifactId>
-                 <version>${saxon.version}</version>
+                <groupId>net.sf.saxon</groupId>
+                <artifactId>saxon-xqj</artifactId>
+                <version>${saxon.version}</version>
             </dependency>
 
             <!-- Spring Framework -->
@@ -834,8 +880,8 @@
                 <version>${bsf.version}</version>
             </dependency>
             <dependency>
-                <groupId>rhino</groupId>
-                <artifactId>js</artifactId>
+                <groupId>org.mozilla</groupId>
+                <artifactId>rhino</artifactId>
                 <version>${rhino.version}</version>
             </dependency>
 
@@ -847,13 +893,18 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.maven</groupId>
-                <artifactId>maven-project</artifactId>
+                <artifactId>maven-core</artifactId>
                 <version>${maven.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.maven</groupId>
                 <artifactId>maven-artifact</artifactId>
-                <version>${maven.artifact.version}</version>
+                <version>${maven.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.maven</groupId>
+                <artifactId>maven-compat</artifactId>
+                <version>${maven.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.maven</groupId>
@@ -868,8 +919,13 @@
 
             <!-- Quickfix/J (FIX Transport) -->
             <dependency>
-                <groupId>quickfixj</groupId>
-                <artifactId>quickfixj-all</artifactId>
+                <groupId>org.quickfixj</groupId>
+                <artifactId>quickfixj-core</artifactId>
+                <version>${qfj.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.quickfixj</groupId>
+                <artifactId>quickfixj-messages-all</artifactId>
                 <version>${qfj.version}</version>
             </dependency>
 
@@ -914,11 +970,6 @@
                 <version>${jsch.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.apache.woden</groupId>
-                <artifactId>woden-core</artifactId>
-                <version>${woden.version}</version>
-            </dependency>
-            <dependency>
                 <groupId>wsdl4j</groupId>
                 <artifactId>wsdl4j</artifactId>
                 <version>${wsdl4j.version}</version>
@@ -966,7 +1017,7 @@
         <plugins>
             <plugin>
                 <artifactId>maven-site-plugin</artifactId>
-                <version>3.0</version>
+                <version>3.3</version>
                 <inherited>false</inherited>
             </plugin>
             <plugin>
@@ -985,7 +1036,7 @@
         <repository>
             <id>wso2-m2</id>
             <name>WSO2 Maven 2 Repository</name>
-            <url>http://dist.wso2.org/maven2/</url>
+            <url>https://maven.wso2.org/nexus/content/groups/wso2-public/</url>
             <releases>
                 <updatePolicy>never</updatePolicy>
             </releases>
@@ -993,7 +1044,7 @@
                 <enabled>false</enabled>
             </snapshots>
         </repository>
-        <repository>
+        <!--repository>
             <id>wso2-m2-snapshots</id>
             <name>WSO2 Maven 2 SNAPSHOTS Repository</name>
             <url>http://dist.wso2.org/snapshots/maven2/</url>
@@ -1004,18 +1055,7 @@
                 <enabled>true</enabled>
                 <updatePolicy>interval:10080</updatePolicy>
             </snapshots>
-        </repository>
-        <repository>
-            <id>snmp4j-repo</id>
-            <name>SNMP4J Repository</name>
-            <url>https://oosnmp.net/dist/release/</url>
-            <releases>
-                <updatePolicy>never</updatePolicy>
-            </releases>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
+        </repository-->
     </repositories>
 
     <modules>
@@ -1042,35 +1082,35 @@
     <properties>
         <!-- Sets the source encoding to UTF-8 -->
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        
+
         <!-- The Java version used to build Synapse. This property is used in the configuration
              of the maven-compiler-plugin as well as certain ant tasks executed using
              maven-antrun-plugin. -->
         <java.version>1.6</java.version>
 
-        <synapse.version>2.2.0-SNAPSHOT</synapse.version>
+	<synapse.version>${project.version}</synapse.version>
 
         <!-- Apache Commons -->
         <commons.dbcp.version>1.3</commons.dbcp.version> <!-- We need this version to support JDK 5 -->
         <commons.pool.version>1.5.7</commons.pool.version>
         <commons.vfs.version>2.0</commons.vfs.version>
         <commons.net.version>3.0.1</commons.net.version>
-        <commons.collections.version>3.2.1</commons.collections.version>
+        <commons.collections.version>3.2.2</commons.collections.version>
         <commons.io.version>2.1</commons.io.version>
         <commons.cli.version>1.2</commons.cli.version>
         <commons.lang.version>2.6</commons.lang.version>
         <commons.codec.version>1.6</commons.codec.version>
 
         <!-- Axis2 and its dependencies -->
-        <axis2.version>1.7.0-SNAPSHOT</axis2.version>
-        <axis2.transport.version>1.7.0-SNAPSHOT</axis2.transport.version>
-        <axiom.version>1.2.16-SNAPSHOT</axiom.version>
+        <axis2.version>1.7.7</axis2.version>
+        <axiom.version>1.2.20</axiom.version>
         <wsdl4j.version>1.6.2</wsdl4j.version>
+        <jettison.version>1.3.8</jettison.version>
 
         <!-- addressing, rampart, neethi -->
         <addressing.version>${axis2.version}</addressing.version>
-        <rampart.version>1.7.0-SNAPSHOT</rampart.version>
-        <neethi.version>3.0.4-SNAPSHOT</neethi.version>
+        <rampart.version>1.7.1</rampart.version>
+        <neethi.version>3.0.3</neethi.version>
         <jruby.version>1.3.0</jruby.version>
         <bcprov.jdk15.version>140</bcprov.jdk15.version>
 
@@ -1079,7 +1119,7 @@
         <geronimo-spec.version>1.1</geronimo-spec.version>
 
         <!-- misc -->
-        <junit.version>3.8.2</junit.version>
+        <junit.version>4.12</junit.version>
         <!-- Warning: log4j versions above 1.2.14 introduce additional transitive dependencies,
              some of which are not available from the Maven central repository. -->
         <log4j.version>1.2.14</log4j.version>
@@ -1093,15 +1133,14 @@
         <truezip.version>6.6</truezip.version>
         <jsch.version>0.1.31</jsch.version>
         <jms-1.1-spec.version>1.1</jms-1.1-spec.version>
-        <httpcore.nio.version>4.3</httpcore.nio.version>
-        <http.client.version>4.3.1</http.client.version>
+        <httpcore.nio.version>4.3.3</httpcore.nio.version>
+        <http.client.version>4.3.6</http.client.version>
         <aspectj.version>1.8.2</aspectj.version>
-        <qfj.version>1.4.0</qfj.version>
+        <qfj.version>1.6.2</qfj.version>
         <wso2uri-template.version>1.0.0</wso2uri-template.version>
-        <woden.version>1.0M11-SNAPSHOT</woden.version>
         <activemq.version>5.2.0</activemq.version>
-        <snmp4j.version>2.0.3</snmp4j.version>
-        <snmp4j.agent.version>2.0.5</snmp4j.agent.version>
+        <snmp4j.version>2.5.4</snmp4j.version>
+        <snmp4j.agent.version>2.5.3</snmp4j.agent.version>
         <rabbitmq.version>3.1.2</rabbitmq.version>
         <bcprov.nhttp.version>1.49</bcprov.nhttp.version>
 
@@ -1114,12 +1153,11 @@
         <bsf.version>3.0</bsf.version>
         <groovy.version>1.1-rc-1</groovy.version>
         <spring.version>1.2.8</spring.version>
-        <rhino.version>1.6R5</rhino.version>
+        <rhino.version>1.7R5</rhino.version>
         <activation.version>1.1</activation.version>
 
         <!-- Maven Tools -->
-        <maven.version>2.0.7</maven.version>
-        <maven.artifact.version>2.0.8</maven.artifact.version>
+        <maven.version>3.0</maven.version>
         <maven.archiver.version>2.2</maven.archiver.version>
         <plexus.utils.version>1.5.4</plexus.utils.version>
     </properties>
@@ -1176,7 +1214,7 @@
             <name>Davanum Srinivas</name>
             <id>dims</id>
             <email>davanum@gmail.com</email>
-            <organization></organization>
+            <organization />
         </developer>
         <developer>
             <name>Sanjiva Weerawarana</name>
@@ -1285,7 +1323,7 @@
             <id>kasun</id>
             <email>kasun AT apache.org</email>
             <organization>WSO2</organization>
-        </developer> 
+        </developer>
         <developer>
             <name>Udayanga Wickramasinghe</name>
             <id>uswick</id>
@@ -1310,12 +1348,32 @@
             <email>isudana AT apache.org</email>
             <organization>WSO2</organization>
         </developer>
-	<developer>
+        <developer>
             <name>Dushan Abeyruwan</name>
             <id>dushan</id>
             <email>dushan AT apache.org</email>
             <organization>WSO2</organization>
         </developer>
+        <developer>
+            <name>Ravi Undupitiya</name>
+            <id>ravi</id>
+            <email>ravi AT apache.org</email>
+	    <organization>WSO2</organization>
+	    <url>https://linkedin.com/in/rundupitiya</url>
+        </developer>
+        <developer>
+            <name>Vanjikumaran Sivajothy</name>
+            <id>vanji</id>
+            <email>vanji AT apache.org</email>
+            <organization>WSO2</organization>
+            <url>https://www.linkedin.com/in/vanjikumaran</url>
+        </developer>
+        <developer>
+            <name>Prabath Ariyarathna</name>
+            <id>prabathar</id>
+            <email>prabathar AT apache.org</email>
+            <organization>Apache</organization>
+        </developer>
     </developers>
 
     <contributors>
@@ -1331,5 +1389,17 @@
         <contributor>
             <name>Dave Irving</name>
         </contributor>
+        <contributor>
+            <name>Senduran Balasubramaniyam</name>
+        </contributor>
+        <contributor>
+            <name>Chanaka Fernando</name>
+        </contributor>
+        <contributor>
+            <name>Isuru Ranawaka</name>
+        </contributor>
+        <contributor>
+            <name>Buddhima Wijeweera</name>
+        </contributor>
     </contributors>
 </project>
diff --git a/java/repository/conf/axis2.xml b/java/repository/conf/axis2.xml
index 536be49..d1209ed 100644
--- a/java/repository/conf/axis2.xml
+++ b/java/repository/conf/axis2.xml
@@ -148,8 +148,8 @@
                          class="org.apache.synapse.format.hessian.HessianMessageFormatter"/>-->
         <!--<messageFormatter contentType=""
                          class="org.apache.synapse.format.hessian.HessianMessageFormatter"/>-->
-        <!--<messageFormatter contentType="application/json"
-                         class="org.apache.axis2.json.JSONMessageFormatter"/>-->
+        <messageFormatter contentType="application/json"
+                         class="org.apache.axis2.json.JSONMessageFormatter"/>
 
     </messageFormatters>
 
@@ -178,8 +178,8 @@
                          class="org.apache.synapse.format.hessian.HessianMessageBuilder"/>-->
         <!--<messageBuilder contentType=""
                          class="org.apache.synapse.format.hessian.HessianMessageBuilder"/>-->
-        <!--<messageBuilder contentType="application/json"
-                         class="org.apache.axis2.json.JSONOMBuilder"/>-->
+        <messageBuilder contentType="application/json"
+                         class="org.apache.axis2.json.JSONOMBuilder"/>
     </messageBuilders>
 
     <!-- ================================================= -->
@@ -349,9 +349,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender>-->
 
     <!--Uncomment this for FIX transport support
diff --git a/java/repository/conf/axis2_blocking_client.xml b/java/repository/conf/axis2_blocking_client.xml
index 20761c0..5594c28 100644
--- a/java/repository/conf/axis2_blocking_client.xml
+++ b/java/repository/conf/axis2_blocking_client.xml
@@ -250,9 +250,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender>
 
     <!-- ================================================= -->
diff --git a/java/repository/conf/axis2_server.xml b/java/repository/conf/axis2_server.xml
index beea0df..d73a74e 100644
--- a/java/repository/conf/axis2_server.xml
+++ b/java/repository/conf/axis2_server.xml
@@ -315,9 +315,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender>-->
 
     <!--Uncomment this for FIX transport support
diff --git a/java/repository/conf/cipher-text.properties b/java/repository/conf/cipher-text.properties
index 4d0b01a..983ecd6 100644
--- a/java/repository/conf/cipher-text.properties
+++ b/java/repository/conf/cipher-text.properties
@@ -1,2 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 ## configuration  per each plaintext
 #synapse=P6myYYDEmiILYid7Du1GGCHJMbdehU5SAEYHtE1ArBeJnLo+72+evwAA80+D3RcNRukqvKzlkiKBAdOtU3ppujHhi5UndGhzubjrYhU7YvnhqCK+ulaW78KaQqTlFoM26v+Oa/jgzdJ5ucXhe6SWJxPM7LlAVAE+jFNHFxNgHmo=
diff --git a/java/repository/conf/nhttp.properties b/java/repository/conf/nhttp.properties
index c9d6935..98dd877 100644
--- a/java/repository/conf/nhttp.properties
+++ b/java/repository/conf/nhttp.properties
@@ -43,3 +43,5 @@
 #lst_t_max=100
 #lst_alive_sec=5
 #lst_qlen=-1
+
+#http.headers.preserve=Serer,User-Agent,Date
diff --git a/java/repository/conf/passthru-http.properties b/java/repository/conf/passthru-http.properties
new file mode 100644
index 0000000..7192a1b
--- /dev/null
+++ b/java/repository/conf/passthru-http.properties
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+## This file contains the configuration parameters used by the Pass-through HTTP transport
+
+http.socket.timeout=180000
+worker_pool_size_core=400
+worker_pool_size_max=500
+#worker_thread_keepalive_sec=60
+#worker_pool_queue_length=-1
+#io_threads_per_reactor=2
+io_buffer_size=16384
+http.socket.reuseaddr=true
+#http.headers.preserve=Location,Serer,User-Agent,Host,Date
diff --git a/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml b/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
index 22ed9b3..39d16f5 100644
--- a/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
+++ b/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <endpoint xmlns="http://ws.apache.org/ns/synapse">
     <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
 </endpoint>
diff --git a/java/repository/conf/sample/resources/fix/FIX40-synapse.xml b/java/repository/conf/sample/resources/fix/FIX40-synapse.xml
index 4585972..1fa2eeb 100644
--- a/java/repository/conf/sample/resources/fix/FIX40-synapse.xml
+++ b/java/repository/conf/sample/resources/fix/FIX40-synapse.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <fix major="4" minor="0">
   <header>
     <field name="BeginString" required="Y"/>
diff --git a/java/repository/conf/sample/resources/fix/conn.properties b/java/repository/conf/sample/resources/fix/conn.properties
index 63a4520..7843abd 100644
--- a/java/repository/conf/sample/resources/fix/conn.properties
+++ b/java/repository/conf/sample/resources/fix/conn.properties
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 #initial context factory
 
 #java.naming.factory.initial =org.apache.qpid.jndi.PropertiesFileInitialContextFactory
diff --git a/java/repository/conf/sample/resources/fix/direct.properties b/java/repository/conf/sample/resources/fix/direct.properties
index 759d08b..19604e2 100644
--- a/java/repository/conf/sample/resources/fix/direct.properties
+++ b/java/repository/conf/sample/resources/fix/direct.properties
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
 
 # register some connection factories
diff --git a/java/repository/conf/sample/resources/misc/client/axis2.xml b/java/repository/conf/sample/resources/misc/client/axis2.xml
index 6e0a7d9..e5b73d6 100644
--- a/java/repository/conf/sample/resources/misc/client/axis2.xml
+++ b/java/repository/conf/sample/resources/misc/client/axis2.xml
@@ -233,9 +233,9 @@
         <parameter name="mail.smtp.port">587</parameter>
         <parameter name="mail.smtp.starttls.enable">true</parameter>
         <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.mail1</parameter>
         <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.mail1@gmail.com</parameter>
     </transportSender>
 
     <!-- ================================================= -->
diff --git a/java/repository/conf/sample/resources/misc/commission.xml b/java/repository/conf/sample/resources/misc/commission.xml
index fda19ea..aec56b5 100644
--- a/java/repository/conf/sample/resources/misc/commission.xml
+++ b/java/repository/conf/sample/resources/misc/commission.xml
@@ -1,5 +1,25 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <commission>
     <vendor symbol="IBM">21.334534</vendor>
     <vendor symbol="MSFT">45.433545</vendor>
     <vendor symbol="SUN">56.657737</vendor>
-</commission>
\ No newline at end of file
+</commission>
diff --git a/java/repository/conf/sample/resources/policy/throttle_policy.xml b/java/repository/conf/sample/resources/policy/throttle_policy.xml
index 1d3f747..0c35732 100644
--- a/java/repository/conf/sample/resources/policy/throttle_policy.xml
+++ b/java/repository/conf/sample/resources/policy/throttle_policy.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
             xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
     <throttle:ThrottleAssertion>
@@ -47,4 +67,4 @@
             </wsp:ExactlyOne>
         </wsp:All>
     </throttle:ThrottleAssertion>
-</wsp:Policy>
\ No newline at end of file
+</wsp:Policy>
diff --git a/java/repository/conf/sample/resources/script/stockquoteTransformRequest.py b/java/repository/conf/sample/resources/script/stockquoteTransformRequest.py
new file mode 100644
index 0000000..c38f7c6
--- /dev/null
+++ b/java/repository/conf/sample/resources/script/stockquoteTransformRequest.py
@@ -0,0 +1,32 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License. 
+# 
+
+from org.apache.synapse.util.xpath import SynapseXPath
+
+def transformRequest(mc):
+    symbolXPath = SynapseXPath("//*[local-name()='Code']/text()")
+    symbol = symbolXPath.stringValueOf(mc)
+    mc.setPayloadXML('''
+	<m:getQuote xmlns:m="http://services.samples">
+		<m:request>
+			<m:symbol>''' + symbol + '''</m:symbol>
+		</m:request>
+	</m:getQuote>''')
+
+
diff --git a/java/repository/conf/sample/resources/script/stockquoteTransformResponse.py b/java/repository/conf/sample/resources/script/stockquoteTransformResponse.py
new file mode 100644
index 0000000..2324c7a
--- /dev/null
+++ b/java/repository/conf/sample/resources/script/stockquoteTransformResponse.py
@@ -0,0 +1,32 @@
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements.  See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership.  The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License.  You may obtain a copy of the License at
+#  
+#     http://www.apache.org/licenses/LICENSE-2.0
+#  
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied.  See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+# 
+
+from org.apache.synapse.util.xpath import SynapseXPath
+
+def transformResponse(mc):
+    symbolXPath = SynapseXPath("//*[local-name()='symbol']/text()")
+    symbol = symbolXPath.stringValueOf(mc)
+    lastXPath = SynapseXPath("//*[local-name()='last']/text()")
+    price = lastXPath.stringValueOf(mc)
+    mc.setPayloadXML('''
+       <m:CheckPriceResponse xmlns:m="http://services.samples/xsd">
+	  <m:Code>''' + symbol + '''</m:Code>
+	  <m:Price>''' + price + '''</m:Price>
+       </m:CheckPriceResponse>
+   ''')
diff --git a/java/repository/conf/sample/resources/security/store.jks b/java/repository/conf/sample/resources/security/store.jks
index 02d7c4e..fe3c5f8 100644
--- a/java/repository/conf/sample/resources/security/store.jks
+++ b/java/repository/conf/sample/resources/security/store.jks
Binary files differ
diff --git a/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml b/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml
index 71e65ee..afbf590 100644
--- a/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml
+++ b/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <sequence name="dynamic_sequence" xmlns="http://ws.apache.org/ns/synapse">
 	<in>
 		<log level="custom">
@@ -5,4 +25,4 @@
 		</log>
 	</in>
 	<send/>
-</sequence>
\ No newline at end of file
+</sequence>
diff --git a/java/repository/conf/sample/resources/spring/springCustomLogger.xml b/java/repository/conf/sample/resources/spring/springCustomLogger.xml
index 39a0fd1..8d49e7e 100644
--- a/java/repository/conf/sample/resources/spring/springCustomLogger.xml
+++ b/java/repository/conf/sample/resources/spring/springCustomLogger.xml
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <!DOCTYPE beans PUBLIC  "-//SPRING//DTD BEAN//EN"
     "http://www.springframework.org/dtd/spring-beans.dtd">
 
diff --git a/java/repository/conf/sample/resources/transform/encoding_test.xml b/java/repository/conf/sample/resources/transform/encoding_test.xml
index c1142d7..509e8ea 100644
--- a/java/repository/conf/sample/resources/transform/encoding_test.xml
+++ b/java/repository/conf/sample/resources/transform/encoding_test.xml
@@ -1,6 +1,26 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
     <test>à peine arrivés nous entrâmes dans sa chambre</test>
   </s:Body>
-</s:Envelope>
\ No newline at end of file
+</s:Envelope>
diff --git a/java/repository/conf/sample/resources/transform/med_message.xml b/java/repository/conf/sample/resources/transform/med_message.xml
index 7b04342..879cf1c 100755
--- a/java/repository/conf/sample/resources/transform/med_message.xml
+++ b/java/repository/conf/sample/resources/transform/med_message.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <ns:getMarketActivityResponse xmlns:ns="http://services.samples/xsd">
     <ns:quotes type="samples.services.GetQuoteResponse">
         <ns:change>-2.3331712765191983</ns:change>
diff --git a/java/repository/conf/sample/resources/transform/message.xml b/java/repository/conf/sample/resources/transform/message.xml
index bf34fe5..bec1ee2 100755
--- a/java/repository/conf/sample/resources/transform/message.xml
+++ b/java/repository/conf/sample/resources/transform/message.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <ns:getMarketActivityResponse xmlns:ns="http://services.samples/xsd">
     <ns:quotes type="samples.services.GetQuoteResponse">
         <ns:change>-2.3331712765191983</ns:change>
diff --git a/java/repository/conf/sample/resources/transform/small_message.xml b/java/repository/conf/sample/resources/transform/small_message.xml
index ee02e13..e270de0 100755
--- a/java/repository/conf/sample/resources/transform/small_message.xml
+++ b/java/repository/conf/sample/resources/transform/small_message.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <ns:getMarketActivityResponse xmlns:ns="http://services.samples/xsd">
     <ns:quotes type="samples.services.GetQuoteResponse">
         <ns:change>-2.3331712765191983</ns:change>
diff --git a/java/repository/conf/sample/resources/transform/transform_load.xml b/java/repository/conf/sample/resources/transform/transform_load.xml
index 15dd19d..e3ae235 100755
--- a/java/repository/conf/sample/resources/transform/transform_load.xml
+++ b/java/repository/conf/sample/resources/transform/transform_load.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:output method="text"/>
     <xsl:template match="ns:getMarketActivityResponse" xmlns:ns="http://services.samples/xsd">
diff --git a/java/repository/conf/sample/resources/transform/transform_load_2.xml b/java/repository/conf/sample/resources/transform/transform_load_2.xml
index 71ecdd9..c0a3c2c 100755
--- a/java/repository/conf/sample/resources/transform/transform_load_2.xml
+++ b/java/repository/conf/sample/resources/transform/transform_load_2.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:output method="text"/>
     <xsl:template match="ns:getMarketActivityResponse" xmlns:ns="http://services.samples/xsd">
diff --git a/java/repository/conf/sample/resources/transform/transform_load_3.xml b/java/repository/conf/sample/resources/transform/transform_load_3.xml
index 6f6418e..b9baac3 100755
--- a/java/repository/conf/sample/resources/transform/transform_load_3.xml
+++ b/java/repository/conf/sample/resources/transform/transform_load_3.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:output omit-xml-declaration="yes"/>
     <xsl:template match="ns:getMarketActivityResponse" xmlns:ns="http://services.samples/xsd">
diff --git a/java/repository/conf/sample/resources/vfs/test.xml b/java/repository/conf/sample/resources/vfs/test.xml
index 8666c74..982c0a0 100644
--- a/java/repository/conf/sample/resources/vfs/test.xml
+++ b/java/repository/conf/sample/resources/vfs/test.xml
@@ -1,4 +1,24 @@
 <?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
 	<soapenv:Body>
 		<getQuote xmlns="http://services.samples">
diff --git a/java/repository/conf/sample/synapse_sample_256.xml b/java/repository/conf/sample/synapse_sample_256.xml
index e831515..d90c6ba 100644
--- a/java/repository/conf/sample/synapse_sample_256.xml
+++ b/java/repository/conf/sample/synapse_sample_256.xml
@@ -45,20 +45,19 @@
                 <send/>
             </outSequence>
         </target>
-        <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
 
-        <parameter name="transport.mail.Address">synapse.demo.1@gmail.com</parameter>
+        <parameter name="transport.mail.Address">synapse.demo.mail1@gmail.com</parameter>
         <parameter name="transport.mail.Protocol">pop3</parameter>
         <parameter name="transport.PollInterval">5</parameter>
         <parameter name="mail.pop3.host">pop.gmail.com</parameter>
         <parameter name="mail.pop3.port">995</parameter>
-        <parameter name="mail.pop3.user">synapse.demo.1</parameter>
+        <parameter name="mail.pop3.user">synapse.demo.mail1</parameter>
         <parameter name="mail.pop3.password">mailpassword</parameter>
         <parameter name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
         <parameter name="mail.pop3.socketFactory.fallback">false</parameter>
         <parameter name="mail.pop3.socketFactory.port">995</parameter>
         <parameter name="transport.mail.ContentType">application/xml</parameter>
-        
+
     </proxy>
 
 </definitions>
diff --git a/java/repository/conf/sample/synapse_sample_355.xml b/java/repository/conf/sample/synapse_sample_355.xml
new file mode 100644
index 0000000..d6bf2b8
--- /dev/null
+++ b/java/repository/conf/sample/synapse_sample_355.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!-- Using Python scripts for mediation -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+
+    <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+        <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
+        <parameter name="root">file:repository/conf/sample/resources/</parameter>
+        <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
+        <parameter name="cachableDuration">15000</parameter>
+    </registry>
+
+    <localEntry key="stockquoteScript"
+                src="file:repository/conf/sample/resources/script/stockquoteTransformRequest.py"/>
+
+    <sequence name="main">
+        <in>
+            <!-- transform the custom quote request into a standard quote request expected by the service -->
+            <script language="py" key="stockquoteScript" function="transformRequest"/>
+            <send>
+                <endpoint>
+                    <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+                </endpoint>
+            </send>
+        </in>
+        <out>
+            <!-- transform the standard response back into the custom format the client expects -->
+            <script language="py" key="script/stockquoteTransformResponse.py"
+                    function="transformResponse"/>
+            <send/>
+        </out>
+    </sequence>
+
+</definitions>
+
+
diff --git a/java/repository/conf/sample/synapse_sample_430.xml b/java/repository/conf/sample/synapse_sample_430.xml
index d557203..f1c4e20 100644
--- a/java/repository/conf/sample/synapse_sample_430.xml
+++ b/java/repository/conf/sample/synapse_sample_430.xml
@@ -31,10 +31,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+	<respond/>
     </sequence>
 
 </definitions>
diff --git a/java/repository/conf/sample/synapse_sample_431.xml b/java/repository/conf/sample/synapse_sample_431.xml
index dd00d8a..89a9b4c 100644
--- a/java/repository/conf/sample/synapse_sample_431.xml
+++ b/java/repository/conf/sample/synapse_sample_431.xml
@@ -34,10 +34,7 @@
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
             <enableSec policy="sec_policy"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+	<respond/>
     </sequence>
 
 </definitions>
diff --git a/java/repository/conf/sample/synapse_sample_432.xml b/java/repository/conf/sample/synapse_sample_432.xml
index 8f4b07d..201a027 100644
--- a/java/repository/conf/sample/synapse_sample_432.xml
+++ b/java/repository/conf/sample/synapse_sample_432.xml
@@ -35,10 +35,7 @@
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
             <enableSec outboundPolicy="sec_policy_outbound" inboundPolicy="sec_policy_inbound"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+	<respond/>
     </sequence>
 
 </definitions>
diff --git a/java/repository/conf/sample/synapse_sample_433.xml b/java/repository/conf/sample/synapse_sample_433.xml
index 69d562c..ffa145c 100644
--- a/java/repository/conf/sample/synapse_sample_433.xml
+++ b/java/repository/conf/sample/synapse_sample_433.xml
@@ -31,10 +31,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+        <respond/>
     </sequence>
 
     <endpoint name="StockQuoteServiceEndpoint">
diff --git a/java/repository/conf/sample/synapse_sample_434.xml b/java/repository/conf/sample/synapse_sample_434.xml
index 95d080e..c4afedc 100644
--- a/java/repository/conf/sample/synapse_sample_434.xml
+++ b/java/repository/conf/sample/synapse_sample_434.xml
@@ -33,10 +33,7 @@
                     xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                     xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
         </callout>
-        <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+	<respond/>
     </sequence>
 
 </definitions>
diff --git a/java/repository/conf/sample/synapse_sample_440.xml b/java/repository/conf/sample/synapse_sample_440.xml
new file mode 100644
index 0000000..4ed1035
--- /dev/null
+++ b/java/repository/conf/sample/synapse_sample_440.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!-- Respond Mediator with proxy services -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+    <proxy name="EchoService">
+        <target>
+            <inSequence>
+                <respond/>
+            </inSequence>
+        </target>
+    </proxy>
+</definitions>
diff --git a/java/repository/conf/sample/synapse_sample_441.xml b/java/repository/conf/sample/synapse_sample_441.xml
new file mode 100644
index 0000000..1dcebdb
--- /dev/null
+++ b/java/repository/conf/sample/synapse_sample_441.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!-- Mock Service using Respond Mediator with proxy services -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+    <proxy name="MockService">
+        <target>
+            <inSequence>
+                <log level="full"/>
+                <payloadFactory>
+                    <format>
+                        <m:Sample xmlns:m="http://services.samples">
+                            <m:Response>
+                                <m:value>foo</m:value>
+                            </m:Response>
+                        </m:Sample>
+                    </format>
+                    <args>
+                    </args>
+                </payloadFactory>
+                <respond/>
+            </inSequence>
+        </target>
+    </proxy>
+</definitions>
diff --git a/java/repository/conf/sample/synapse_sample_470.xml b/java/repository/conf/sample/synapse_sample_470.xml
index 896b9cd..3fbe4d5 100644
--- a/java/repository/conf/sample/synapse_sample_470.xml
+++ b/java/repository/conf/sample/synapse_sample_470.xml
@@ -55,9 +55,7 @@
                 <bean action="GET_PROPERTY" var="store" property="name" target="{//store/name/text()}"/>
                 <bean action="GET_PROPERTY" var="store" property="address" target="{//store/address/text()}"/>
                 <bean action="GET_PROPERTY" var="store" property="phoneNo" target="{//store/phone/text()}"/>
-                <header name="To" action="remove"/>
-                <property name="RESPONSE" value="true"/>
-                <send/>
+		<respond/>
             </inSequence>
         </target>
     </proxy>
diff --git a/java/repository/conf/sample/synapse_sample_471.xml b/java/repository/conf/sample/synapse_sample_471.xml
index 69d40c4..a85876e 100644
--- a/java/repository/conf/sample/synapse_sample_471.xml
+++ b/java/repository/conf/sample/synapse_sample_471.xml
@@ -65,9 +65,7 @@
                         <arg expression="get-property('TOTAL')"/>
                     </args>
                 </payloadFactory>
-                <property name="RESPONSE" value="true"/>
-                <header name="To" action="remove"/>
-                <send/>
+                <respond/>
             </onComplete>
         </aggregate>
     </sequence>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/endpoints/foo.xml b/java/repository/conf/sample/synapse_sample_600.xml/endpoints/foo.xml
index af98e46..53e83ce 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/endpoints/foo.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/endpoints/foo.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <endpoint name="foo" xmlns="http://ws.apache.org/ns/synapse">
 	<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
 </endpoint>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/events/event1.xml b/java/repository/conf/sample/synapse_sample_600.xml/events/event1.xml
index 2dc2a25..eed2702 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/events/event1.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/events/event1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <eventSource name="SampleEventSource" xmlns="http://ws.apache.org/ns/synapse">
      <subscriptionManager class="org.apache.synapse.eventing.managers.DefaultInMemorySubscriptionManager">
           <property name="topicHeaderName" value="Topic"/>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/local-entries/bar.xml b/java/repository/conf/sample/synapse_sample_600.xml/local-entries/bar.xml
index 223e57e..0cf03f5 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/local-entries/bar.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/local-entries/bar.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <localEntry key="bar" xmlns="http://ws.apache.org/ns/synapse">
 	<endpoint>
 		<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy1.xml b/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy1.xml
index e7f974e..c270c2b 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy1.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <proxy name="StockQuoteProxy" xmlns="http://ws.apache.org/ns/synapse" transports="http">
     <target>
         <endpoint>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy2.xml b/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy2.xml
index f7d418c..5865d69 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy2.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy2.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <proxy name="CustomStockQuoteProxy1" xmlns="http://ws.apache.org/ns/synapse" transports="http">
     <target inSequence="customSeq">
         <endpoint key="foo"/>            
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy3.xml b/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy3.xml
index 7bf5e67..fd507a6 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy3.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/proxy-services/proxy3.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <proxy name="CustomStockQuoteProxy2" xmlns="http://ws.apache.org/ns/synapse" transports="http">
     <target inSequence="customSeq">
         <endpoint key="bar"/>            
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/registry.xml b/java/repository/conf/sample/synapse_sample_600.xml/registry.xml
index 00ad973..e81ffa4 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/registry.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/registry.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry" xmlns="http://ws.apache.org/ns/synapse">
     <parameter name="root">file:./repository/conf/sample/resources/</parameter>
     <parameter name="cachableDuration">15000</parameter>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/sequences/custom-logger.xml b/java/repository/conf/sample/synapse_sample_600.xml/sequences/custom-logger.xml
index 73f9b7f..aa65773 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/sequences/custom-logger.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/sequences/custom-logger.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <sequence name="customSeq" xmlns="http://ws.apache.org/ns/synapse">
     <log level="custom">
        <property name="symbol" expression="get-property('symbol')"/>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/sequences/fault.xml b/java/repository/conf/sample/synapse_sample_600.xml/sequences/fault.xml
index d924e52..b05a628 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/sequences/fault.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/sequences/fault.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <sequence name="fault" xmlns="http://ws.apache.org/ns/synapse">
     <log/>
 </sequence>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/sequences/main.xml b/java/repository/conf/sample/synapse_sample_600.xml/sequences/main.xml
index 5697ba3..50902b4 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/sequences/main.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/sequences/main.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <sequence name="main" xmlns="http://ws.apache.org/ns/synapse">
     <in>
         <send/>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/synapse.xml b/java/repository/conf/sample/synapse_sample_600.xml/synapse.xml
index c5f74ca..3c978ac 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/synapse.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/synapse.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <definitions xmlns="http://ws.apache.org/ns/synapse">
     <proxy name="MainStockQuoteProxy" transports="http https">
         <target>
diff --git a/java/repository/conf/sample/synapse_sample_600.xml/tasks/task1.xml b/java/repository/conf/sample/synapse_sample_600.xml/tasks/task1.xml
index 94c81a1..76923ad 100644
--- a/java/repository/conf/sample/synapse_sample_600.xml/tasks/task1.xml
+++ b/java/repository/conf/sample/synapse_sample_600.xml/tasks/task1.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <task class="org.apache.synapse.startup.tasks.MessageInjector" name="CheckPrice" xmlns="http://ws.apache.org/ns/synapse">
       <property name="to" value="http://localhost:9000/services/SimpleStockQuoteService"/>
       <property name="soapAction" value="urn:getQuote"/>
diff --git a/java/repository/conf/sample/synapse_sample_705.xml b/java/repository/conf/sample/synapse_sample_705.xml
new file mode 100644
index 0000000..e6d8c8c
--- /dev/null
+++ b/java/repository/conf/sample/synapse_sample_705.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+        <!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!-- Introduction to Synapse Scheduled Message Forwarding Processor with max deliver attempt and drop the message after max deliver attempt -->
+
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+
+    <endpoint name="StockQuoteServiceEp">
+        <address uri="http://localhost:9000/services/SimpleStockQuoteService">
+            <suspendOnFailure>
+                <errorCodes>-1</errorCodes>
+                <progressionFactor>1.0</progressionFactor>
+            </suspendOnFailure>
+        </address>
+    </endpoint>
+    <sequence name="fault">
+        <log level="full">
+            <property name="MESSAGE" value="Executing default 'fault' sequence"/>
+            <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
+            <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
+        </log>
+        <drop/>
+    </sequence>
+    <sequence name="main">
+        <in>
+            <log level="full"/>
+            <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
+            <property name="OUT_ONLY" value="true"/>
+            <property name="target.endpoint" value="StockQuoteServiceEp"/>
+            <store messageStore="MyStore"/>
+        </in>
+        <description>The main sequence for the message mediation</description>
+    </sequence>
+    <messageStore name="MyStore"/>
+    <messageProcessor class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" name="ScheduledProcessor" messageStore="MyStore">
+        <parameter name="interval">10000</parameter>
+        <parameter name="max.deliver.attempts">3</parameter>
+        <parameter name="max.deliver.drop">true</parameter>
+    </messageProcessor>
+</definitions>
\ No newline at end of file
diff --git a/java/repository/conf/sample/synapse_sample_800.xml b/java/repository/conf/sample/synapse_sample_800.xml
index 7e7cf66..524e05a 100644
--- a/java/repository/conf/sample/synapse_sample_800.xml
+++ b/java/repository/conf/sample/synapse_sample_800.xml
@@ -1,3 +1,23 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <definitions xmlns="http://ws.apache.org/ns/synapse">
     <api name="StockQuoteAPI" context="/stockquote">
         <resource uri-template="/view/{symbol}" methods="GET">
@@ -38,4 +58,4 @@
             </inSequence>
         </resource>
     </api>
-</definitions>
\ No newline at end of file
+</definitions>
diff --git a/java/repository/conf/sample/synapse_sample_850.xml b/java/repository/conf/sample/synapse_sample_850.xml
index 54fc352..deaef56 100644
--- a/java/repository/conf/sample/synapse_sample_850.xml
+++ b/java/repository/conf/sample/synapse_sample_850.xml
@@ -28,9 +28,6 @@
         <with-param xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" name="source_xpath" value="{{s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]}}"/>
         <with-param xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" name="target_xpath" value="{{s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]}}"/>
     </call-template>
-     <property name="RESPONSE" value="true"/>
-        <header name="To" action="remove"/>
-        <send/>
-        <drop/>
+    <respond/>
 </sequence>
 </definitions>
diff --git a/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample53.xml b/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample53.xml
index f415dcc..0f65159 100644
--- a/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample53.xml
+++ b/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample53.xml
@@ -124,7 +124,7 @@
 [java] Request: 130 ==&gt; Response from server: MyServer2
 ...</div>
                 <p>
-                    You can keep on shutting servers down like this. Client will get a response untill
+                    You can keep on shutting servers down like this. Client will get a response until
                     you shutdown all listed servers. Once all servers are shutdown, the error sequence
                     is triggered and a fault message is sent to the client as follows.
                 </p>
diff --git a/scratch/synapse-2.1-versioned/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java b/scratch/synapse-2.1-versioned/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java
index 958c84a..714d533 100644
--- a/scratch/synapse-2.1-versioned/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java
+++ b/scratch/synapse-2.1-versioned/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorPropertySerializer.java
@@ -36,7 +36,7 @@
 
     /**
      * Serialize all the properties to the given paren element. For each and every
-     * property ther will be a seperate property element created inside the parent element.
+     * property ther will be a separate property element created inside the parent element.
      * 
      * @param parent element to which property elements should be added
      * @param props <code>Collection</code> of propertis
diff --git a/scratch/synapse-2.1-versioned/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml b/scratch/synapse-2.1-versioned/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml
index f415dcc..0f65159 100644
--- a/scratch/synapse-2.1-versioned/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml
+++ b/scratch/synapse-2.1-versioned/java/modules/documentation/src/site/xdoc/userguide/samples/sample53.xml
@@ -124,7 +124,7 @@
 [java] Request: 130 ==&gt; Response from server: MyServer2
 ...</div>
                 <p>
-                    You can keep on shutting servers down like this. Client will get a response untill
+                    You can keep on shutting servers down like this. Client will get a response until
                     you shutdown all listed servers. Once all servers are shutdown, the error sequence
                     is triggered and a fault message is sent to the client as follows.
                 </p>