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><validate> + <schema key="schema\sample.xsd"/> + <on-fail> + <makefault> + <code value="tns:Receiver" + xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/> + <reason value="Invalid Request!!!"/> + </makefault> + <property name="RESPONSE" value="true"/> + <header name="To" expression="get-property('ReplyTo')"/> + </on-fail> +</validate> + </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
