Index: java/modules/extensions/src/org/apache/synapse/config/xml/ValidateMediatorFactory.java
===================================================================
--- java/modules/extensions/src/org/apache/synapse/config/xml/ValidateMediatorFactory.java	(revision 417504)
+++ java/modules/extensions/src/org/apache/synapse/config/xml/ValidateMediatorFactory.java	(working copy)
@@ -26,27 +26,36 @@
 import org.apache.synapse.mediators.ValidateMediator;
 import org.jaxen.JaxenException;
 
+import java.util.Iterator;
 import javax.xml.namespace.QName;
 
 /**
  * Creates a validation mediator from the XML configuration
  * <p/>
- * <validate schema="url" [source="xpath"]>
- * <on-fail>
- * mediator+
- * </on-fail>
+ * <validate schema="url">
+ *   <property name="schema-full-checking" value="true|false"/>
+ *   <property name="honour-all-schemaLocations" value="true|false"/>
+ *   <on-fail>
+ *     mediator+
+ *   </on-fail>
  * </validate>
  */
-public class ValidateMediatorFactory extends AbstractListMediatorFactory {
+public class ValidateMediatorFactory extends AbstractListMediatorFactory 
+{
 
     private static final Log log = LogFactory.getLog(TransformMediatorFactory.class);
+
     private static final QName VALIDATE_Q = new QName(Constants.SYNAPSE_NAMESPACE, "validate");
+    private static final QName ON_FAIL_Q = new QName(Constants.SYNAPSE_NAMESPACE, "on-fail");
+    private static final QName SCHEMA_Q = new QName(Constants.NULL_NAMESPACE, "schema");
+    private static final QName SOURCE_Q = new QName(Constants.NULL_NAMESPACE, "source");
 
-    public Mediator createMediator(OMElement elem) {
+    public Mediator createMediator(OMElement elem) 
+    {
 
         ValidateMediator validateMediator = new ValidateMediator();
-        OMAttribute attSchema = elem.getAttribute(new QName(Constants.NULL_NAMESPACE, "schema"));
-        OMAttribute attSource = elem.getAttribute(new QName(Constants.NULL_NAMESPACE, "source"));
+        OMAttribute attSchema = elem.getAttribute(SCHEMA_Q);
+        OMAttribute attSource = elem.getAttribute(SOURCE_Q);
 
         if (attSchema != null) {
             validateMediator.setSchemaUrl(attSchema.getAttributeValue());
@@ -61,7 +70,6 @@
                 AXIOMXPath xp = new AXIOMXPath(attSource.getAttributeValue());
                 validateMediator.setSource(xp);
                 Util.addNameSpaces(xp, elem, log);
-
             } catch (JaxenException e) {
                 String msg = "Invalid XPath expression specified for attribute 'source'";
                 log.error(msg);
@@ -69,17 +77,22 @@
             }
         }
 
-        OMElement onFail = elem.getFirstElement();
-        if (new QName(Constants.SYNAPSE_NAMESPACE, "on-fail").equals(onFail.getQName()) &&
-            onFail.getChildElements().hasNext()) {
+        OMElement onFail = null;
+        Iterator iter = elem.getChildrenWithName(ON_FAIL_Q);
+        if (iter.hasNext()) {
+            onFail = (OMElement)iter.next();
+        }
+
+        if (onFail != null && onFail.getChildElements().hasNext()) {
             super.addChildren(onFail, validateMediator);
-
         } else {
-            String msg = "A non-empty on-fail element is required for the validate mediator";
+            String msg = "A non-empty <on-fail> childe element is required for the <validate> mediator";
             log.error(msg);
             throw new SynapseException(msg);
         }
 
+        validateMediator.addAllProperties(MediatorPropertyFactory.getMediatorProperties(elem));
+
         return validateMediator;
     }
 
Index: java/modules/extensions/src/org/apache/synapse/mediators/ValidateMediator.java
===================================================================
--- java/modules/extensions/src/org/apache/synapse/mediators/ValidateMediator.java	(revision 417504)
+++ java/modules/extensions/src/org/apache/synapse/mediators/ValidateMediator.java	(working copy)
@@ -44,18 +44,37 @@
 import javax.xml.validation.Validator;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.util.Iterator;
 import java.util.List;
+import java.util.ArrayList;
 import java.util.StringTokenizer;
 
 /**
  * Validate a message or an element against a schema
  */
-public class ValidateMediator extends AbstractListMediator {
+public class ValidateMediator extends AbstractListMediator 
+{
+    /**
+     * Default validation schema language (http://www.w3.org/2001/XMLSchema) and validator feature ids.
+     */
+    private static final String DEFAULT_SCHEMA_LANGUAGE = "http://www.w3.org/2001/XMLSchema";
+    private static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
+    private static final String HONOUR_ALL_SCHEMA_LOCATIONS_FEATURE_ID = "http://apache.org/xml/features/honour-all-schemaLocations";
 
+    /**
+     * Validation property names.
+     */
+    private static final String ATT_SCHEMA_FULL_CHECKING = "schema-full-checking";
+    private static final String ATT_HONOUR_ALL_SCHEMA_LOCATIONS = "honour-all-schemaLocations";
+    private static final String XML_VALUE_TRUE = "true";
+
     private static final Log log = LogFactory.getLog(ValidateMediator.class);
 
-    /** A space or comma delimitered list of schemas to validate the source element against */
+    /** 
+     * A space or comma delimitered list of schemas to validate the source element against 
+     */
     private String schemaUrl = null;
+
     /**
      * An XPath expression to be evaluated against the message to find the element to be validated.
      * If this is not specified, the validation will occur against the first child element of the SOAP body
@@ -63,21 +82,11 @@
     private AXIOMXPath source = null;
 
     /**
-     * Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).
+     * Properties that enable/disable validator features
      */
-    private static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
+    private boolean schemaFullChecking = true;
+    private boolean honourAllSchemaLocations = true;
 
-    /**
-     * Honour all schema locations feature id (http://apache.org/xml/features/honour-all-schemaLocations).
-     */
-    private static final String HONOUR_ALL_SCHEMA_LOCATIONS_ID = "http://apache.org/xml/features/honour-all-schemaLocations";
-
-    /**
-     * Default schema language (http://www.w3.org/2001/XMLSchema).
-     */
-    private static final String DEFAULT_SCHEMA_LANGUAGE = "http://www.w3.org/2001/XMLSchema";
-
-
     public String getSchemaUrl() {
         return schemaUrl;
     }
@@ -94,13 +103,30 @@
         this.source = source;
     }
 
+    public boolean getSchemaFullChecking() {
+        return schemaFullChecking;
+    }
+
+    public void setSchemaFullChecking(boolean enable) {
+        schemaFullChecking = enable;
+    }
+
+    public boolean getHonourAllSchemaLocations() {
+        return honourAllSchemaLocations;
+    }
+
+    public void setHonourAllSchemaLocations(boolean enable) {
+        honourAllSchemaLocations = enable;
+    }
+
     /**
      * Return the node to be validated. If a source XPath is not specified, this will
      * default to the first child of the SOAP body
      * @param synCtx the message context
      * @return the OMNode against which validation should be performed
      */
-    private OMNode getValidateSource(MessageContext synCtx) {
+    private OMNode getValidateSource(MessageContext synCtx) 
+    {
 
         AXIOMXPath sourceXPath = source;
         // do not change the source XPath if not specified, as it is shared..
@@ -164,8 +190,8 @@
             // Create SchemaFactory and configure
             SchemaFactory factory = SchemaFactory.newInstance(DEFAULT_SCHEMA_LANGUAGE);
             factory.setErrorHandler(handler);
-            factory.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);
-            factory.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID, true);
+            factory.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, schemaFullChecking);
+            factory.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_FEATURE_ID, honourAllSchemaLocations);
 
             // Build Schema from schemaUrl
             Schema schema = null;
@@ -191,8 +217,8 @@
             // Setup validator and input source.
             Validator validator = schema.newValidator();
             validator.setErrorHandler(handler);
-            validator.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);
-            validator.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID, true);
+            validator.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, schemaFullChecking);
+            validator.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_FEATURE_ID, honourAllSchemaLocations);
 
             XMLReader reader = XMLReaderFactory.createXMLReader();
             SAXSource source = new SAXSource(reader, new InputSource(baisFromSource));
@@ -216,6 +242,26 @@
         return true;
     }
 
+    public void addProperty(MediatorProperty p) {
+
+        if (p != null) {
+            boolean enable = XML_VALUE_TRUE.equals(p.getValue());
+            if (ATT_SCHEMA_FULL_CHECKING.equals(p.getName())) {
+                setSchemaFullChecking(enable);
+            } else if (ATT_HONOUR_ALL_SCHEMA_LOCATIONS.equals(p.getName())) {
+                setHonourAllSchemaLocations(enable);
+            }
+        }
+    }
+
+    public void addAllProperties(List properties) {
+
+        Iterator iter = properties.iterator();
+        while (iter.hasNext()) {
+            addProperty((MediatorProperty)iter.next());
+        }
+    }
+
     /**
      * This class handles validation errors to be used for error reporting
      */
Index: java/modules/extensions/test/org/apache/synapse/ValidateMediatorTest.java
===================================================================
--- java/modules/extensions/test/org/apache/synapse/ValidateMediatorTest.java	(revision 417504)
+++ java/modules/extensions/test/org/apache/synapse/ValidateMediatorTest.java	(working copy)
@@ -15,15 +15,21 @@
 */
 package org.apache.synapse;
 
+import java.io.ByteArrayInputStream;
+import javax.xml.stream.XMLStreamException;
 import junit.framework.TestCase;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.TestMediateHandler;
 import org.apache.synapse.TestMediator;
 import org.apache.synapse.mediators.TestUtils;
 import org.apache.synapse.mediators.ValidateMediator;
+import org.apache.synapse.config.xml.ValidateMediatorFactory;
 
-public class ValidateMediatorTest extends TestCase {
+public class ValidateMediatorTest extends TestCase 
+{
 
     private static final String VALID_ENVELOPE_TWO_SCHEMAS =
             "<Outer xmlns=\"http://www.apache-synapse.org/test2\">" +
@@ -65,6 +71,30 @@
             "<Codes>String</Codes>\n" +
             "</CheckPriceRequest>\n";
 
+    private static final String DEFAULT_FEATURES_MEDIATOR_CONFIG = 
+            "<validate xmlns=\"http://ws.apache.org/ns/synapse\" " +
+            "       schema=\"file:synapse_repository/conf/sample/validate.xsd\">" + 
+            "   <on-fail>" +
+            "       <makefault>" +
+            "           <code value=\"tns:Receiver\" xmlns:tns=\"http://www.w3.org/2003/05/soap-envelope\"/>" +
+            "           <reason value=\"Invalid request\"/>" +
+            "       </makefault>" +
+            "   </on-fail>" +
+            "</validate>";
+
+    private static final String CUSTOM_FEATURES_MEDIATOR_CONFIG = 
+            "<validate xmlns=\"http://ws.apache.org/ns/synapse\" " +
+            "       schema=\"file:synapse_repository/conf/sample/validate.xsd\">" + 
+            "   <property name=\"schema-full-checking\" value=\"false\"/>" +
+            "   <property name=\"honour-all-schemaLocations\" value=\"false\"/>" +
+            "   <on-fail>" +
+            "       <makefault>" +
+            "           <code value=\"tns:Receiver\" xmlns:tns=\"http://www.w3.org/2003/05/soap-envelope\"/>" +
+            "           <reason value=\"Invalid request\"/>" +
+            "       </makefault>" +
+            "   </on-fail>" +
+            "</validate>";
+
     private boolean onFailInvoked = false;
     private TestMediator testMediator = null;
 
@@ -82,7 +112,7 @@
         this.onFailInvoked = onFailInvoked;
     }
 
-    public void testValidateMedaitorValidCase() throws Exception {
+    public void testValidateMediatorValidCase() throws Exception {
         setOnFailInvoked(false);
 
         // create a validate mediator
@@ -100,10 +130,10 @@
         // test validate mediator, with static enveope
         validate.mediate(TestUtils.getTestContext(VALID_ENVELOPE));
 
-        assertTrue(!onFailInvoked);
+        assertFalse(onFailInvoked);
     }
 
-    public void testValidateMedaitorValidCaseTwoSchemas() throws Exception {
+    public void testValidateMediatorValidCaseTwoSchemas() throws Exception {
         setOnFailInvoked(false);
 
         // create a validate mediator
@@ -121,10 +151,10 @@
         // test validate mediator, with static enveope
         validate.mediate(TestUtils.getTestContext(VALID_ENVELOPE_TWO_SCHEMAS));
 
-        assertTrue(!onFailInvoked);
+        assertFalse(onFailInvoked);
     }
 
-    public void testValidateMedaitorInvalidCaseTwoSchemas() throws Exception {
+    public void testValidateMediatorInvalidCaseTwoSchemas() throws Exception {
         setOnFailInvoked(false);
 
         // create a validate mediator
@@ -145,7 +175,7 @@
         assertTrue(onFailInvoked);
     }
 
-    public void testValidateMedaitorInvalidCase() throws Exception {
+    public void testValidateMediatorInvalidCase() throws Exception {
         setOnFailInvoked(false);
 
         // create a validate mediator
@@ -166,7 +196,7 @@
         assertTrue(onFailInvoked);
     }
 
-    public void testValidateMedaitorValidCaseNoNS() throws Exception {
+    public void testValidateMediatorValidCaseNoNS() throws Exception {
         setOnFailInvoked(false);
 
         // create a validate mediator
@@ -184,10 +214,10 @@
         // test validate mediator, with static enveope
         validate.mediate(TestUtils.getTestContext(VALID_ENVELOPE_NO_NS));
 
-        assertTrue(!onFailInvoked);
+        assertFalse(onFailInvoked);
     }
 
-    public void testValidateMedaitorInvalidCaseNoNS() throws Exception {
+    public void testValidateMediatorInvalidCaseNoNS() throws Exception {
         setOnFailInvoked(false);
 
         // create a validate mediator
@@ -207,4 +237,41 @@
 
         assertTrue(onFailInvoked);
     }
+
+    public void testValidateMediatorDefaultFeatures() throws Exception {
+        setOnFailInvoked(false);
+
+        ValidateMediatorFactory mf = new ValidateMediatorFactory();
+        ValidateMediator mediator = (ValidateMediator)mf.createMediator(
+            createOMElement(DEFAULT_FEATURES_MEDIATOR_CONFIG));
+
+        assertTrue(mediator.getSchemaFullChecking());
+        assertTrue(mediator.getHonourAllSchemaLocations());
+        assertFalse(onFailInvoked);
+    }
+
+    public void testValidateMediatorCustomFeatures() throws Exception 
+    {
+        setOnFailInvoked(false);
+
+        ValidateMediatorFactory mf = new ValidateMediatorFactory();
+        ValidateMediator mediator = (ValidateMediator)mf.createMediator(
+            createOMElement(CUSTOM_FEATURES_MEDIATOR_CONFIG));
+
+        assertFalse(mediator.getSchemaFullChecking());
+        assertFalse(mediator.getHonourAllSchemaLocations());
+        assertFalse(onFailInvoked);
+    }
+
+    private static OMElement createOMElement(String xml) 
+    {
+
+        try {
+            StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(xml.getBytes()));
+            OMElement omElement = builder.getDocumentElement();
+            return omElement;
+        } catch (XMLStreamException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }
