Author: indika
Date: Tue Jun 30 22:58:32 2009
New Revision: 40472
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=40472

Log:
add example to validate mediator guide 

Modified:
   trunk/esb/java/docs/xdoc/mediators/validate.xml

Modified: trunk/esb/java/docs/xdoc/mediators/validate.xml
URL: 
http://wso2.org/svn/browse/wso2/trunk/esb/java/docs/xdoc/mediators/validate.xml?rev=40472&r1=40471&r2=40472&view=diff
==============================================================================
--- trunk/esb/java/docs/xdoc/mediators/validate.xml     (original)
+++ trunk/esb/java/docs/xdoc/mediators/validate.xml     Tue Jun 30 22:58:32 2009
@@ -42,7 +42,8 @@
 
 <h3>UI Configuration</h3>
 
-<p><img alt="Validate Mediator" 
src="../validate-mediator/docs/images/validate.png" /> </p>
+<p><img alt="Validate Mediator"
+src="../validate-mediator/docs/images/validate.png" /> </p>
 
 <h4>Key</h4>
 
@@ -63,5 +64,29 @@
 <p>Please refer the Target documentation</p>
 
 <h3>Example</h3>
+<ol>
+  <li><pre>&lt;validate&gt;
+    &lt;schema key="schema\sample.xsd"/&gt;
+         &lt;on-fail&gt;
+                &lt;makefault&gt;
+                    &lt;code value="tns:Receiver"
+                            
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/&gt;
+                    &lt;reason value="Invalid Request!!!"/&gt;
+                &lt;/makefault&gt;
+                &lt;property name="RESPONSE" value="true"/&gt;
+                &lt;header name="To" expression="get-property('ReplyTo')"/&gt;
+         &lt;/on-fail&gt;
+&lt;/validate&gt;
+    </pre>
+    In the above validate mediator configuration, the required schema for
+    validating message going through the validate mediator has been given as a
+    registry key, <strong>schema\sample.xsd</strong>. In this sample
+    configuration, there is no <strong>source</strong> attribute. Therefore, in
+    this case, validate mediator takes source as the first child of SOAP Body.
+    Within <strong>on-fail</strong>, it is possible to specify mediation logic
+    that should to be happened if the validation is failed. In the above
+    configuration, it creates a SOAP fault using <strong>makefault</strong>
+    mediator and send back that to requested party. </li>
+</ol>
 </body>
 </html>

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

Reply via email to