You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ru...@apache.org on 2010/12/03 05:07:30 UTC

svn commit: r1041684 [3/3] - in /synapse/branches/2.0: modules/core/src/test/resources/synapse-config/ modules/packaging/package-archetype/src/main/resources/archetype-resources/repository/conf/ repository/conf/sample/ repository/conf/sample/resources/...

Modified: synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml?rev=1041684&r1=1041683&r2=1041684&view=diff
==============================================================================
--- synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml Fri Dec  3 04:07:27 2010
@@ -76,7 +76,9 @@
 <li>
 <a href="#Sample12">Sample 12: One way messaging / fireAndForget through Synapse</a></li>
 <li>
-<a href="#Sample13">Sample 13: Dual channel invocation through Synapse</a></li></ul></li>
+<a href="#Sample13">Sample 13: Dual channel invocation through Synapse</a></li>
+<li>
+<a href="#Sample13">Sample 14: Sequences and Endpoints as local registry items</a></li></ul></li>
 <li>
 <a href="#Endpoints">Advanced mediations with endpoints</a>
 <ul>
@@ -104,7 +106,9 @@
 <li>
 <a href="#Sample100">Sample 100: Using WS-Security for outgoing messages</a></li>
 <li>
-<a href="#Sample101">Sample 101: Reliable message exchange between Synapse and the back-end server using WS-ReliableMessaging</a></li></ul></li>
+<a href="#Sample101">Sample 101: Reliable message exchange between Synapse and the back-end server using WS-ReliableMessaging 1.0</a></li>
+<li>
+<a href="#Sample101">Sample 102: Reliable message exchange between Synapse and the back-end server using WS-ReliableMessaging 1.1</a></li></ul></li>
 <li>
 <a href="#ProxyServices">Synapse Proxy service samples</a>
 <ul>
@@ -303,17 +307,19 @@
 <a name="MediationSamples" id="MediationSamples">Message Mediation Samples</a> </h1>
 <div class="section"><h2>
 <a name="Sample0" id="Sample0">Sample 0: Introduction to Synapse</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;!-- log all attributes of messages passing through -->
+        &lt;log level="full"/>
+
+        &lt;!-- Send the message to implicit destination -->
+        &lt;send/>
+    &lt;/sequence>
 
-    &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;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to Synapse. Shows how a message could be made to pass through Synapse </strong>
 <strong>and logged before it is delivered to its ultimate receiver.</strong> </p>
@@ -340,18 +346,26 @@
 <p>You will see the exact same behaviour as per the previous example when you run this scenario. However this time the difference is at the client, as it sends the message to the WS-Addressing 'To' address http://localhost:9000/services/SimpleStockQuoteService, but the transport specifies Synapse as the HTTP proxy. </p>
 <div class="section"><h2>
 <a name="Sample1" id="Sample1">Sample 1: Simple content based routing (CBR) of messages</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;!-- filtering of messages with XPath and regex matches --&gt;
-    &lt;filter source=&quot;get-property('To')&quot; regex=&quot;.*/StockQuote.*&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;drop/&gt;
-    &lt;/filter&gt;
-    &lt;send/&gt;
-&lt;/definitions&gt; </pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;!-- filtering of messages with XPath and regex matches -->
+        &lt;filter source="get-property('To')" regex=".*/StockQuote.*">
+            &lt;then>
+                &lt;send>
+                    &lt;endpoint>
+                        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+                    &lt;/endpoint>
+                &lt;/send>
+                &lt;drop/>
+            &lt;/then>
+        &lt;/filter>
+        &lt;send/>
+    &lt;/sequence>
+
+&lt;/definitions> </pre>
 <p>
 <strong>Objective: Introduction to simple content based routing. Shows how a message could be made to pass through Synapse using the Dumb Client mode, where Synapse acts as a gateway to accept all messages and then perform mediation and routing based on message properties or content.</strong> </p>
 <p>
@@ -371,34 +385,36 @@ mediator forwards the response back to t
     
 <div class="section"><h2>
 <a name="Sample2" id="Sample2">Sample 2: CBR with the Switch-case mediator, using message properties</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;switch source=&quot;//m0:getQuote/m0:request/m0:symbol&quot; xmlns:m0=&quot;http://services.samples&quot;&gt;
-        &lt;case regex=&quot;IBM&quot;&gt;
-            &lt;!-- the property mediator sets a local property on the *current* message --&gt;
-            &lt;property name=&quot;symbol&quot; value=&quot;Great stock - IBM&quot;/&gt;
-        &lt;/case&gt;
-        &lt;case regex=&quot;MSFT&quot;&gt;
-            &lt;property name=&quot;symbol&quot; value=&quot;Are you sure? - MSFT&quot;/&gt;
-        &lt;/case&gt;
-        &lt;default&gt;
-            &lt;!-- it is possible to assign the result of an XPath expression as well --&gt;
-            &lt;property name=&quot;symbol&quot;
-                  expression=&quot;fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)&quot;
-                  xmlns:m0=&quot;http://services.samples&quot;/&gt;
-        &lt;/default&gt;
-    &lt;/switch&gt;
-
-    &lt;log level=&quot;custom&quot;&gt;
-        &lt;!-- the get-property() XPath extension function allows the lookup of local message properties
-            as well as properties from the Axis2 or Transport contexts (i.e. transport headers) --&gt;
-        &lt;property name=&quot;symbol&quot; expression=&quot;get-property('symbol')&quot;/&gt;
-        &lt;!-- the get-property() function supports the implicit message headers To/From/Action/FaultTo/ReplyTo --&gt;
-        &lt;property name=&quot;epr&quot; expression=&quot;get-property('To')&quot;/&gt;
-    &lt;/log&gt;
-
-    &lt;!-- Send the messages where they are destined to (i.e. the 'To' EPR of the message) --&gt;
-    &lt;send/&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="http://services.samples">
+            &lt;case regex="IBM">
+                &lt;!-- the property mediator sets a local property on the *current* message -->
+                &lt;property name="symbol" value="Great stock - IBM"/>
+            &lt;/case>
+            &lt;case regex="MSFT">
+                &lt;property name="symbol" value="Are you sure? - MSFT"/>
+            &lt;/case>
+            &lt;default>
+                &lt;!-- it is possible to assign the result of an XPath expression as well -->
+                &lt;property name="symbol" expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)"/>
+            &lt;/default>
+        &lt;/switch>
+        &lt;log level="custom">
+            &lt;!-- the get-property() XPath extension function allows the lookup of local message properties
+                        as well as properties from the Axis2 or Transport contexts (i.e. transport headers) -->
+            &lt;property name="symbol" expression="get-property('symbol')"/>
+            &lt;!-- the get-property() function supports the implicit message headers To/From/Action/FaultTo/ReplyTo -->
+            &lt;property name="epr" expression="get-property('To')"/>
+        &lt;/log>
+        &lt;!-- Send the messages where they are destined to (i.e. the 'To' EPR of the message) -->
+        &lt;send/>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduce switch-case mediator and writing and reading of local properties set on a message instance</strong> </p>
 <p>
@@ -412,38 +428,40 @@ mediator forwards the response back to t
 <pre xml:space="preserve">      INFO LogMediator - symbol = Are you sure? - MSFT, epr = http://localhost:9000/axis2/services/SimpleStockQuoteService</pre>
 <div class="section"><h2>
 <a name="Sample3" id="Sample3">Sample 3: Local Registry entry definitions, reusable endpoints and sequences</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;!-- define a string resource entry to the local registry --&gt;
-    &lt;localEntry key=&quot;version&quot;&gt;0.1&lt;/localEntry&gt;
-    &lt;!-- define a reuseable endpoint definition --&gt;
-    &lt;endpoint name=&quot;simple&quot;&gt;
-        &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
-    &lt;/endpoint&gt;
-
-    &lt;!-- define a reusable sequence --&gt;
-    &lt;sequence name=&quot;stockquote&quot;&gt;
-        &lt;!-- log the message using the custom log level. illustrates custom properties for log --&gt;
-        &lt;log level=&quot;custom&quot;&gt;
-            &lt;property name=&quot;Text&quot; value=&quot;Sending quote request&quot;/&gt;
-            &lt;property name=&quot;version&quot; expression=&quot;get-property('version')&quot;/&gt;
-            &lt;property name=&quot;direction&quot; expression=&quot;get-property('direction')&quot;/&gt;
-        &lt;/log&gt;
-        &lt;!-- send message to real endpoint referenced by key &quot;simple&quot; endpoint definition --&gt;
-        &lt;send&gt;
-            &lt;endpoint key=&quot;simple&quot;/&gt;
-        &lt;/send&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;main&quot;&gt;
-        &lt;in&gt;
-            &lt;property name=&quot;direction&quot; value=&quot;incoming&quot;/&gt;
-            &lt;sequence key=&quot;stockquote&quot;/&gt;
-        &lt;/in&gt;
-        &lt;out&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+    &lt;!-- define a string resource entry to the local registry -->
+    &lt;localEntry key="version">0.1&lt;/localEntry>
+    &lt;!-- define a reuseable endpoint definition -->
+    &lt;endpoint name="simple">
+        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+    &lt;/endpoint>
+
+    &lt;!-- define a reusable sequence -->
+    &lt;sequence name="stockquote">
+        &lt;!-- log the message using the custom log level. illustrates custom properties for log -->
+        &lt;log level="custom">
+            &lt;property name="Text" value="Sending quote request"/>
+            &lt;property name="version" expression="get-property('version')"/>
+            &lt;property name="direction" expression="get-property('direction')"/>
+        &lt;/log>
+        &lt;!-- send message to real endpoint referenced by key "simple" endpoint definition -->
+        &lt;send>
+            &lt;endpoint key="simple"/>
+        &lt;/send>
+    &lt;/sequence>
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;property name="direction" value="incoming"/>
+            &lt;sequence key="stockquote"/>
+        &lt;/in>
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Illustrates local registry entry definitions, reusable endpoints and sequences</strong> </p>
 <p>
@@ -461,60 +479,62 @@ mediator forwards the response back to t
 [HttpServerWorker-1] DEBUG AddressEndpoint - Sending To: http://localhost:9000/services/SimpleStockQuoteService </pre>
 <div class="section"><h2>
 <a name="Sample4" id="Sample4">Sample 4: Introduction to error handling</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-
-    &lt;!-- the default fault handling sequence used by Synapse - named 'fault' --&gt;
-    &lt;sequence name=&quot;fault&quot;&gt;
-        &lt;log level=&quot;custom&quot;&gt;
-            &lt;property name=&quot;text&quot; value=&quot;An unexpected error occured&quot;/&gt;
-            &lt;property name=&quot;message&quot; expression=&quot;get-property('ERROR_MESSAGE')&quot;/&gt;
-        &lt;/log&gt;
-        &lt;drop/&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;sunErrorHandler&quot;&gt;
-        &lt;log level=&quot;custom&quot;&gt;
-            &lt;property name=&quot;text&quot; value=&quot;An unexpected error occured for stock SUN&quot;/&gt;
-            &lt;property name=&quot;message&quot; expression=&quot;get-property('ERROR_MESSAGE')&quot;/&gt;
-        &lt;/log&gt;
-        &lt;drop/&gt;
-    &lt;/sequence&gt;
-
-    &lt;!-- default message handling sequence used by Synapse - named 'main' --&gt;
-    &lt;sequence name=&quot;main&quot;&gt;
-        &lt;in&gt;
-            &lt;switch source=&quot;//m0:getQuote/m0:request/m0:symbol&quot; xmlns:m0=&quot;http://services.samples&quot;&gt;
-                &lt;case regex=&quot;IBM&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;/case&gt;
-                &lt;case regex=&quot;MSFT&quot;&gt;
-                    &lt;send&gt;
-                        &lt;endpoint key=&quot;bogus&quot;/&gt;
-                    &lt;/send&gt;
-                &lt;/case&gt;
-                &lt;case regex=&quot;SUN&quot;&gt;
-                    &lt;sequence key=&quot;sunSequence&quot;/&gt;
-                &lt;/case&gt;
-            &lt;/switch&gt;
-            &lt;drop/&gt;
-        &lt;/in&gt;
-
-        &lt;out&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;sunSequence&quot; onError=&quot;sunErrorHandler&quot;&gt;
-        &lt;send&gt;
-            &lt;endpoint key=&quot;sunPort&quot;/&gt;
-        &lt;/send&gt;
-    &lt;/sequence&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;!-- the default fault handling sequence used by Synapse - named 'fault' -->
+    &lt;sequence name="fault">
+        &lt;log level="custom">
+            &lt;property name="text" value="An unexpected error occured"/>
+            &lt;property name="message" expression="get-property('ERROR_MESSAGE')"/>
+        &lt;/log>
+        &lt;drop/>
+    &lt;/sequence>
+
+    &lt;sequence name="sunErrorHandler">
+        &lt;log level="custom">
+            &lt;property name="text" value="An unexpected error occured for stock SUN"/>
+            &lt;property name="message" expression="get-property('ERROR_MESSAGE')"/>
+            &lt;!--&lt;property name="detail" expression="get-property('ERROR_DETAIL')"/>-->
+        &lt;/log>
+        &lt;drop/>
+    &lt;/sequence>
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;switch xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol">
+                &lt;case regex="IBM">
+                    &lt;send>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+                        &lt;/endpoint>
+                    &lt;/send>
+                &lt;/case>
+                &lt;case regex="MSFT">
+                    &lt;send>
+                        &lt;endpoint key="bogus"/>
+                    &lt;/send>
+                &lt;/case>
+                &lt;case regex="SUN">
+                    &lt;sequence key="sunSequence"/>
+                &lt;/case>
+            &lt;/switch>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+    &lt;sequence name="sunSequence" onError="sunErrorHandler">
+        &lt;send>
+            &lt;endpoint key="sunPort"/>
+        &lt;/send>
+    &lt;/sequence>
 
-&lt;/definitions&gt; </pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to error handling with the 'fault' sequence</strong> </p>
 <p>
@@ -544,40 +564,45 @@ mediator forwards the response back to t
 [HttpServerWorker-1] INFO LogMediator text = An unexpected error occured for stock SUN, message = Couldn't find the endpoint with the key : sunPort</pre>
 <div class="section"><h2>
 <a name="Sample5" id="Sample5">Sample 5: Creating SOAP fault messages and changing the direction of a message</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="myFaultHandler">
+        &lt;makefault response="true">
+			&lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+            &lt;reason expression="get-property('ERROR_MESSAGE')"/>
+        &lt;/makefault>
+        &lt;send/>
+    &lt;/sequence>
+
+    &lt;sequence name="main" onError="myFaultHandler">
+        &lt;in>
+            &lt;switch xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol">
+                &lt;case regex="MSFT">
+                    &lt;send>
+                        &lt;endpoint>
+                            &lt;address uri="http://bogus:9000/services/NonExistentStockQuoteService"/>
+                        &lt;/endpoint>
+                    &lt;/send>
+                &lt;/case>
+                &lt;case regex="SUN">
+                    &lt;send>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9009/services/NonExistentStockQuoteService"/>
+                        &lt;/endpoint>
+                    &lt;/send>
+                &lt;/case>
+            &lt;/switch>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
 
-    &lt;sequence name=&quot;myFaultHandler&quot;&gt;
-        &lt;makefault response=&quot;true&quot;&gt;
-            &lt;code value=&quot;tns:Receiver&quot; xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-            &lt;reason expression=&quot;get-property('ERROR_MESSAGE')&quot;/&gt;
-        &lt;/makefault&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;main&quot; onError=&quot;myFaultHandler&quot;&gt;
-        &lt;in&gt;
-            &lt;switch source=&quot;//m0:getQuote/m0:request/m0:symbol&quot;
-                    xmlns:m0=&quot;http://services.samples/xsd&quot;&gt;
-                &lt;case regex=&quot;MSFT&quot;&gt;
-                    &lt;send&gt;
-                        &lt;endpoint&gt;&lt;address uri=&quot;http://bogus:9000/services/NonExistentStockQuoteService&quot;/&gt;&lt;/endpoint&gt;
-                    &lt;/send&gt;
-                &lt;/case&gt;
-                &lt;case regex=&quot;SUN&quot;&gt;
-                    &lt;send&gt;
-                        &lt;endpoint&gt;&lt;address uri=&quot;http://localhost:9009/services/NonExistentStockQuoteService&quot;/&gt;&lt;/endpoint&gt;
-                    &lt;/send&gt;
-                &lt;/case&gt;
-            &lt;/switch&gt;
-            &lt;drop/&gt;
-        &lt;/in&gt;
-
-        &lt;out&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Makefault mediator and sending back error responses </strong> </p>
 <p>
@@ -596,12 +621,18 @@ mediator forwards the response back to t
     &lt;faultstring&gt;java.net.ConnectException: Connection refused&lt;/faultstring&gt;&lt;detail /&gt;&lt;/soapenv:Fault&gt;</pre>
 <div class="section"><h2>
 <a name="Sample6" id="Sample6">Sample 6: Manipulating SOAP headers, and filtering incoming and outgoing messages</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;in&gt;
-        &lt;header name=&quot;To&quot; value=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
-    &lt;/in&gt;
-    &lt;send/&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;header name="To" value="http://localhost:9000/services/SimpleStockQuoteService"/>
+        &lt;/in>
+        &lt;send/>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to header, in (out) mediators</strong> </p>
 <p>
@@ -612,44 +643,47 @@ mediator forwards the response back to t
 <pre xml:space="preserve">ant stockquote -Dtrpurl=http://localhost:8280/</pre>
 <div class="section"><h2>
 <a name="Sample7" id="Sample7">Sample 7: Introduction to local Registry entries and using Schema validation</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;validate>
+                &lt;schema key="validate_schema"/>
+                &lt;on-fail>
+                    &lt;!-- if the request does not validate againt schema throw a fault -->
+                    &lt;makefault response="true">
+                        &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+                        &lt;reason value="Invalid custom quote request"/>
+                    &lt;/makefault>
+                &lt;/on-fail>
+            &lt;/validate>
+        &lt;/in>
+        &lt;send/>
+    &lt;/sequence>
+
+    &lt;localEntry key="validate_schema">
+        &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                   xmlns="http://services.samples" elementFormDefault="qualified"
+                   attributeFormDefault="unqualified" targetNamespace="http://services.samples">
+            &lt;xs:element name="getQuote">
+                &lt;xs:complexType>
+                    &lt;xs:sequence>
+                        &lt;xs:element name="request">
+                            &lt;xs:complexType>
+                                &lt;xs:sequence>
+                                    &lt;xs:element name="stocksymbol" type="xs:string"/>
+                                &lt;/xs:sequence>
+                            &lt;/xs:complexType>
+                        &lt;/xs:element>
+                    &lt;/xs:sequence>
+                &lt;/xs:complexType>
+            &lt;/xs:element>
+        &lt;/xs:schema>
+    &lt;/localEntry>
 
-    &lt;localEntry key=&quot;validate_schema&quot;&gt;
-        &lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
-                    xmlns=&quot;http://services.samples&quot; elementFormDefault=&quot;qualified&quot;
-                    attributeFormDefault=&quot;unqualified&quot;
-                    targetNamespace=&quot;http://services.samples&quot;&gt;
-            &lt;xs:element name=&quot;getQuote&quot;&gt;
-                &lt;xs:complexType&gt;
-                    &lt;xs:sequence&gt;
-                        &lt;xs:element name=&quot;request&quot;&gt;
-                            &lt;xs:complexType&gt;
-                                &lt;xs:sequence&gt;
-                                    &lt;xs:element name=&quot;stocksymbol&quot; type=&quot;xs:string&quot;/&gt;
-                                &lt;/xs:sequence&gt;
-                            &lt;/xs:complexType&gt;
-                        &lt;/xs:element&gt;
-                    &lt;/xs:sequence&gt;
-                &lt;/xs:complexType&gt;
-            &lt;/xs:element&gt;
-        &lt;/xs:schema&gt;
-    &lt;/localEntry&gt;
-
-    &lt;in&gt;
-        &lt;validate&gt;
-            &lt;schema key=&quot;validate_schema&quot;/&gt;
-            &lt;on-fail&gt;
-                &lt;!-- if the request does not validate againt schema throw a fault --&gt;
-                &lt;makefault response=&quot;true&quot;&gt;
-                    &lt;code value=&quot;tns:Receiver&quot;
-                            xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-                    &lt;reason value=&quot;Invalid custom quote request&quot;/&gt;
-                &lt;/makefault&gt;
-            &lt;/on-fail&gt;
-        &lt;/validate&gt;
-    &lt;/in&gt;
-    &lt;send/&gt;
-&lt;/definitions&gt; </pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to local (static) registry entries and the validate mediator</strong> </p>
 <p>
@@ -662,30 +696,35 @@ mediator forwards the response back to t
 <pre xml:space="preserve">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</pre>
 <div class="section"><h2>
 <a name="Sample8" id="Sample8">Sample 8: Introduction to static and dynamic registry resources, and using XSLT transformations</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) -->
+    &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+        &lt;!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
+        &lt;parameter name="root">file:repository/conf/sample/resources/&lt;/parameter>
+        &lt;!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
+        &lt;parameter name="cachableDuration">15000&lt;/parameter>
+    &lt;/registry>
+
+    &lt;!-- define the request processing XSLT resource as a static URL source -->
+    &lt;localEntry key="xslt-key-req" src="file:repository/conf/sample/resources/transform/transform.xslt"/>
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;!-- transform the custom quote request into a standard quote requst expected by the service -->
+            &lt;xslt key="xslt-key-req"/>
+        &lt;/in>
+        &lt;out>
+            &lt;!-- transform the standard response back into the custom format the client expects -->
+            &lt;!-- the key is looked up in the remote registry and loaded as a 'dynamic' registry resource -->
+            &lt;xslt key="transform/transform_back.xslt"/>
+        &lt;/out>
+        &lt;send/>
+    &lt;/sequence>
 
-    &lt;!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) --&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;!-- define the request processing XSLT resource as a static URL source --&gt;
-    &lt;localEntry key=&quot;xslt-key-req&quot; src=&quot;file:repository/conf/sample/resources/transform/transform.xslt&quot;/&gt;
-
-    &lt;in&gt;
-        &lt;!-- transform the custom quote request into a standard quote requst expected by the service --&gt;
-        &lt;xslt key=&quot;xslt-key-req&quot;/&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 and loaded as a 'dynamic' registry resource --&gt;
-        &lt;xslt key=&quot;transform/transform_back.xslt&quot;/&gt;
-    &lt;/out&gt;
-    &lt;send/&gt;
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to static and dynamic registry resources and the XSLT mediator</strong> </p>
 <p>
@@ -713,16 +752,20 @@ mediator forwards the response back to t
 <p>Thus the SimpleURLRegistry allows resource to be cached, and updates detected so that the changes could be reloaded without restarting the Synapse instance. </p>
 <div class="section"><h2>
 <a name="Sample9" id="Sample9">Sample 9: Introduction to dynamic sequences with the Registry</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;registry provider=&quot;org.apache.synapse.registry.url.SimpleURLRegistry&quot;&gt;
-        &lt;parameter name=&quot;root&quot;&gt;file:./repository/conf/sample/resources/&lt;/parameter&gt;
-        &lt;parameter name=&quot;cachableDuration&quot;&gt;15000&lt;/parameter&gt;
-    &lt;/registry&gt;
-
-    &lt;sequence name="main"&gt;
-        &lt;sequence key=&quot;sequence/dynamic_seq_1.xml&quot;/&gt;
-    &lt;/sequence&gt;
-&lt;/definitions&gt; </pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+        &lt;parameter name="root">file:./repository/conf/sample/resources/&lt;/parameter>
+        &lt;parameter name="cachableDuration">15000&lt;/parameter>
+    &lt;/registry>
+
+    &lt;sequence name="main">
+        &lt;sequence key="sequence/dynamic_seq_1.xml"/>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to dynamic sequences with a registry</strong> </p>
 <p>
@@ -746,22 +789,31 @@ mediator forwards the response back to t
 <p>The cache timeout could be tuned appropriately by configuring the URL registry to suit the environment and the needs. </p>
 <div class="section"><h2>
 <a name="Sample10" id="Sample10">Sample 10: Introduction to dynamic endpoints with the Registry</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+        &lt;parameter name="root">file:repository/conf/sample/resources/&lt;/parameter>
+        &lt;parameter name="cachableDuration">15000&lt;/parameter>
+    &lt;/registry>
+
+    &lt;sequence name="foo">
+        &lt;sequence key="xxx"/>
+    &lt;/sequence>
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint key="endpoint/dynamic_endpt_1.xml"/>
+            &lt;/send>
+        &lt;/in>
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
 
-    &lt;registry provider=&quot;org.apache.synapse.registry.url.SimpleURLRegistry&quot;&gt;
-        &lt;parameter name=&quot;root&quot;&gt;file:repository/conf/sample/resources/&lt;/parameter&gt;
-        &lt;parameter name=&quot;cachableDuration&quot;&gt;15000&lt;/parameter&gt;
-    &lt;/registry&gt;
-
-    &lt;in&gt;
-        &lt;send&gt;
-            &lt;endpoint key=&quot;endpoint/dynamic_endpt_1.xml&quot;/&gt;
-        &lt;/send&gt;
-    &lt;/in&gt;
-    &lt;out&gt;
-        &lt;send/&gt;
-    &lt;/out&gt;
-&lt;/definitions&gt; </pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to dynamic endpoints with the Registry</strong> </p>
 <p>
@@ -775,12 +827,16 @@ mediator forwards the response back to t
 <p>Now edit the repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml definition and update the address to &quot;http://localhost:9001/services/SimpleStockQuoteService&quot;. After the cached value expires, the Registry loads the new definition of the endpoint, and then the messages can be seen being routed to the second sample Axis2 server on HTTP port 9001. </p>
 <div class="section"><h2>
 <a name="Sample11" id="Sample11">Sample 11: A full registry based configuration, and sharing a configuration between multiple instances</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;registry provider=&quot;org.apache.synapse.registry.url.SimpleURLRegistry&quot;&gt;
-        &lt;parameter name=&quot;root&quot;&gt;file:./repository/conf/sample/resources/&lt;/parameter&gt;
-        &lt;parameter name=&quot;cachableDuration&quot;&gt;15000&lt;/parameter&gt;
-    &lt;/registry&gt;
-&lt;/definitions&gt; </pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+        &lt;parameter name="root">file:./repository/conf/sample/resources/&lt;/parameter>
+        &lt;parameter name="cachableDuration">15000&lt;/parameter>
+    &lt;/registry>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: A full registry based configuration</strong> </p>
 <p>
@@ -792,13 +848,19 @@ mediator forwards the response back to t
 <pre xml:space="preserve">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</pre>
 <pre xml:space="preserve">[HttpServerWorker-1] INFO LogMediator - message = This is a dynamic Synapse configuration</pre>
 <p>The actual synapse.xml loaded is: </p>
-<pre xml:space="preserve">&lt;!-- a registry based Synapse configuration --&gt;
-&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;log level=&quot;custom&quot;&gt;
-        &lt;property name=&quot;message&quot; value=&quot;This is a dynamic Synapse configuration $$$&quot;/&gt;
-    &lt;/log&gt;
-    &lt;send/&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;!-- a registry based Synapse configuration -->
+&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;log level="custom">
+            &lt;property name="message" value="This is a dynamic Synapse configuration"/>
+        &lt;/log>
+        &lt;send/>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
 <div class="section"><h2>
 <a name="Sample12" id="Sample12">Sample 12: One way messaging / fireAndForget through Synapse</a></h2></div>
 <p>
@@ -825,22 +887,69 @@ mediator forwards the response back to t
 Standard dual channel :: Stock price = $57.16686934968289</pre>
 <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 clients 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 being 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>
+<div class="section"><h2>
+<a name="Sample14" id="Sample14">Sample 14: Sequences and Endpoints as local registry items</a></h2></div>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;localEntry key="local-enrty-ep-key"
+                src="file:repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml"/>
+
+    &lt;localEntry key="local-enrty-sequence-key">
+        &lt;sequence name="dynamic_sequence">
+            &lt;log level="custom">
+                &lt;property name="message" value="*** Test Message 1 ***"/>
+            &lt;/log>
+        &lt;/sequence>
+    &lt;/localEntry>
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;sequence key="local-enrty-sequence-key"/>
+            &lt;send>
+                &lt;endpoint key="local-enrty-ep-key"/>
+            &lt;/send>
+        &lt;/in>
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
+<p>
+<strong>Objective: Sequence and Endpoints as local registry entries</strong> </p>
+<p>
+<strong>Prerequisites:</strong>
+<br/> Start the Synapse configuration numbered 14: i.e. synapse -sample 14
+<br/> Start the Axis2 server and deploy the SimpleStockQuoteService if not already done </p>
+<p>This example shows sequences and endpoints fetched from local registry. Thus it is possible to have endpoints sequences as local registry entries including file entries.
+Execute the following command to see the sample working, where you will be able to see the log statement from the fetched sequence from the local entry and the endpoint will be fetched from the specified file at runtime and be cached in the system</p>
+<pre xml:space="preserve">ant stockquote -Dtrpurl=http://localhost:8280/</pre>
 <h1>
 <a name="Endpoints" id="Endpoints">Advanced mediations with endpoints</a> </h1>
 <div class="section"><h2>
 <a name="Sample50" id="Sample50">Sample 50: POX to SOAP conversion</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;!-- filtering of messages with XPath and regex matches --&gt;
-    &lt;filter source=&quot;get-property('To')&quot; regex=&quot;.*/StockQuote.*&quot;&gt;
-        &lt;send&gt;
-            &lt;endpoint&gt;
-                &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot; format=&quot;soap11&quot;/&gt;
-            &lt;/endpoint&gt;
-        &lt;/send&gt;
-        &lt;drop/&gt;
-    &lt;/filter&gt;
-    &lt;send/&gt;
-&lt;/definitions&gt; </pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;!-- filtering of messages with XPath and regex matches -->
+        &lt;filter source="get-property('To')" regex=".*/StockQuote.*">
+            &lt;then>
+                &lt;send>
+                    &lt;endpoint>
+                        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11"/>
+                    &lt;/endpoint>
+                &lt;/send>
+                &lt;drop/>
+            &lt;/then>
+        &lt;/filter>
+        &lt;send/>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: POX to SOAP conversion</strong> </p>
 <p>
@@ -865,35 +974,51 @@ Transfer-Encoding: chunked
 &lt;/m0:getQuote&gt;0</pre>
 <div class="section"><h2>
 <a name="Sample51" id="Sample51">Sample 51: MTOM and SwA optimizations and request/response correlation</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;in&gt;
-        &lt;filter source=&quot;get-property('Action')&quot; regex=&quot;urn:uploadFileUsingMTOM&quot;&gt;
-            &lt;property name=&quot;example&quot; value=&quot;mtom&quot;/&gt;
-            &lt;send&gt;
-                &lt;endpoint&gt;
-                    &lt;address uri=&quot;http://localhost:9000/services/MTOMSwASampleService&quot; optimize=&quot;mtom&quot;/&gt;
-                &lt;/endpoint&gt;
-            &lt;/send&gt;
-        &lt;/filter&gt;
-        &lt;filter source=&quot;get-property('Action')&quot; regex=&quot;urn:uploadFileUsingSwA&quot;&gt;
-            &lt;property name=&quot;example&quot; value=&quot;swa&quot;/&gt;
-            &lt;send&gt;
-                &lt;endpoint&gt;
-                    &lt;address uri=&quot;http://localhost:9000/services/MTOMSwASampleService&quot; optimize=&quot;swa&quot;/&gt;
-                &lt;/endpoint&gt;
-            &lt;/send&gt;
-        &lt;/filter&gt;
-    &lt;/in&gt;
-    &lt;out&gt;
-        &lt;filter source=&quot;get-property('example')&quot; regex=&quot;mtom&quot;&gt;
-            &lt;property name=&quot;enableMTOM&quot; value=&quot;true&quot; scope=&quot;axis2&quot;/&gt;
-        &lt;/filter&gt;
-        &lt;filter source=&quot;get-property('example')&quot; regex=&quot;swa&quot;&gt;
-            &lt;property name=&quot;enableSwA&quot; value=&quot;true&quot; scope=&quot;axis2&quot;/&gt;
-        &lt;/filter&gt;
-        &lt;send/&gt;
-    &lt;/out&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;filter source="get-property('Action')" regex="urn:uploadFileUsingMTOM">
+                &lt;then>
+                    &lt;property name="example" value="mtom"/>
+                    &lt;send>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9000/services/MTOMSwASampleService"
+                                     optimize="mtom"/>
+                        &lt;/endpoint>
+                    &lt;/send>
+                &lt;/then>
+            &lt;/filter>
+            &lt;filter source="get-property('Action')" regex="urn:uploadFileUsingSwA">
+                &lt;then>
+                    &lt;property name="example" value="swa"/>
+                    &lt;send>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9000/services/MTOMSwASampleService"
+                                     optimize="swa"/>
+                        &lt;/endpoint>
+                    &lt;/send>
+                &lt;/then>
+            &lt;/filter>
+        &lt;/in>
+        &lt;out>
+            &lt;filter source="get-property('example')" regex="mtom">
+                &lt;then>
+                    &lt;property name="enableMTOM" value="true" scope="axis2"/>
+                &lt;/then>
+            &lt;/filter>
+            &lt;filter source="get-property('example')" regex="swa">
+                &lt;then>
+                    &lt;property name="enableSwA" value="true" scope="axis2"/>
+                &lt;/then>
+            &lt;/filter>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: MTOM and SwA optimizations and request/response correlation</strong> </p>
 <p>
@@ -973,52 +1098,54 @@ Content-ID:
          &lt;urn:uuid:15FD2DA2584A32BF7C1177414169826&gt;22800GIF89a... &lt;&lt; binary content &gt;&gt;</pre>
 <div class="section"><h2>
 <a name="Sample52" id="Sample52">Sample 52: Session less load balancing between 3 endpoints</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main" onError="errorHandler">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint>
+                    &lt;loadbalance>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9001/services/LBService1">
+                                &lt;enableAddressing/>
+                                &lt;suspendDurationOnFailure>60&lt;/suspendDurationOnFailure>
+                            &lt;/address>
+                        &lt;/endpoint>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9002/services/LBService1">
+                                &lt;enableAddressing/>
+                                &lt;suspendDurationOnFailure>60&lt;/suspendDurationOnFailure>
+                            &lt;/address>
+                        &lt;/endpoint>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9003/services/LBService1">
+                                &lt;enableAddressing/>
+                                &lt;suspendDurationOnFailure>60&lt;/suspendDurationOnFailure>
+                            &lt;/address>
+                        &lt;/endpoint>
+                    &lt;/loadbalance>
+                &lt;/endpoint>
+            &lt;/send>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) -->
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+    &lt;sequence name="errorHandler">
+        &lt;makefault response="true">
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>
+        &lt;/makefault>
+        &lt;send/>
+    &lt;/sequence>
 
-    &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
-        &lt;in&gt;
-            &lt;send&gt;
-                &lt;endpoint&gt;
-                    &lt;loadbalance&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9001/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                                &lt;suspendDurationOnFailure&gt;60&lt;/suspendDurationOnFailure&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9002/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                                &lt;suspendDurationOnFailure&gt;60&lt;/suspendDurationOnFailure&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9003/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                                &lt;suspendDurationOnFailure&gt;60&lt;/suspendDurationOnFailure&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                    &lt;/loadbalance&gt;
-                &lt;/endpoint&gt;
-            &lt;/send&gt;
-            &lt;drop/&gt;
-        &lt;/in&gt;
-
-        &lt;out&gt;
-            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) --&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;errorHandler&quot;&gt;
-        &lt;makefault response=&quot;true&quot;&gt;
-            &lt;code value=&quot;tns:Receiver&quot; xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-            &lt;reason value=&quot;COULDN'T SEND THE MESSAGE TO THE SERVER.&quot;/&gt;
-        &lt;/makefault&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
-
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Demonstrate the simple load balancing among a set of endpoints</strong> </p>
 <p>
@@ -1054,52 +1181,54 @@ Content-ID:
 <p>Now restart MyServer1. You can observe that requests will be again sent to all three servers roughly after 60 seconds. This is because we have specified &lt;suspendDurationOnFailure&gt; as 60 seconds in the configuration. Therefore, load balance endpoint will suspend any failed child endpoint only for 60 seconds after detecting the failure. </p>
 <div class="section"><h2>
 <a name="Sample53" id="Sample53">Sample 53: Failover sending among 3 endpoints</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-
-    &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
-        &lt;in&gt;
-            &lt;send&gt;
-                &lt;endpoint&gt;
-                    &lt;failover&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9001/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                                &lt;suspendDurationOnFailure&gt;60&lt;/suspendDurationOnFailure&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9002/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                                &lt;suspendDurationOnFailure&gt;60&lt;/suspendDurationOnFailure&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9003/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                                &lt;suspendDurationOnFailure&gt;60&lt;/suspendDurationOnFailure&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                    &lt;/failover&gt;
-                &lt;/endpoint&gt;
-            &lt;/send&gt;
-            &lt;drop/&gt;
-        &lt;/in&gt;
-
-        &lt;out&gt;
-            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) --&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;errorHandler&quot;&gt;
-        &lt;makefault response=&quot;true&quot;&gt;
-            &lt;code value=&quot;tns:Receiver&quot; xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-            &lt;reason value=&quot;COULDN'T SEND THE MESSAGE TO THE SERVER.&quot;/&gt;
-        &lt;/makefault&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main" onError="errorHandler">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint>
+                    &lt;failover>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9001/services/LBService1">
+                                &lt;enableAddressing/>
+                                &lt;suspendDurationOnFailure>60&lt;/suspendDurationOnFailure>
+                            &lt;/address>
+                        &lt;/endpoint>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9002/services/LBService1">
+                                &lt;enableAddressing/>
+                                &lt;suspendDurationOnFailure>60&lt;/suspendDurationOnFailure>
+                            &lt;/address>
+                        &lt;/endpoint>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9003/services/LBService1">
+                                &lt;enableAddressing/>
+                                &lt;suspendDurationOnFailure>60&lt;/suspendDurationOnFailure>
+                            &lt;/address>
+                        &lt;/endpoint>
+                    &lt;/failover>
+                &lt;/endpoint>
+            &lt;/send>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) -->
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+    &lt;sequence name="errorHandler">
+        &lt;makefault response="true">
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>
+        &lt;/makefault>
+        &lt;send/>
+    &lt;/sequence>
 
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Demonstrate the failover sending</strong> </p>
 <p>
@@ -1123,54 +1252,55 @@ Content-ID:
 <p>Once a server is detected as failed, it will be added to the active servers list again after 60 seconds (specified in &lt;suspendDurationOnFailure&gt; in the configuration). Therefore, if you have restarted any of the stopped servers and have shutdown all other servers, messages will be directed to the newly started server. </p>
 <div class="section"><h2>
 <a name="Sample54" id="Sample54">Sample 54: Session affinity load balancing between 3 endpoints</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-
-    &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
-        &lt;in&gt;
-            &lt;send&gt;
-                &lt;endpoint&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main" onError="errorHandler">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint>
                     &lt;!-- specify the session as the simple client session provided by Synapse for
-                    testing purpose --&gt;
-                    
-                    <strong>&lt;session type=&quot;simpleClientSession&quot;/&gt;</strong>
-
-                    &lt;loadbalance&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9001/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9002/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                        &lt;endpoint&gt;
-                            &lt;address uri=&quot;http://localhost:9003/services/LBService1&quot;&gt;
-                                &lt;enableAddressing/&gt;
-                            &lt;/address&gt;
-                        &lt;/endpoint&gt;
-                    &lt;/loadbalance&gt;
-                &lt;/endpoint&gt;
-            &lt;/send&gt;
-            &lt;drop/&gt;
-        &lt;/in&gt;
-
-        &lt;out&gt;
-            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) --&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;errorHandler&quot;&gt;
-        &lt;makefault response=&quot;true&quot;&gt;
-            &lt;code value=&quot;tns:Receiver&quot; xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-            &lt;reason value=&quot;COULDN'T SEND THE MESSAGE TO THE SERVER.&quot;/&gt;
-        &lt;/makefault&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
+                                            testing purpose -->
+                    &lt;session type="simpleClientSession"/>
+
+                    &lt;loadbalance>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9001/services/LBService1">
+                                &lt;enableAddressing/>
+                            &lt;/address>
+                        &lt;/endpoint>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9002/services/LBService1">
+                                &lt;enableAddressing/>
+                            &lt;/address>
+                        &lt;/endpoint>
+                        &lt;endpoint>
+                            &lt;address uri="http://localhost:9003/services/LBService1">
+                                &lt;enableAddressing/>
+                            &lt;/address>
+                        &lt;/endpoint>
+                    &lt;/loadbalance>
+                &lt;/endpoint>
+            &lt;/send>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) -->
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+    &lt;sequence name="errorHandler">
+        &lt;makefault response="true">
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>
+        &lt;/makefault>
+        &lt;send/>
+    &lt;/sequence>
 
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Demonstrate the loadbalancing with session affinity using client initiated sessions</strong> </p>
 <p>
@@ -1195,67 +1325,68 @@ Content-ID:
 <p>You can see that session number 0 is always directed to the server named MyServer1. That means session number 0 is bound to MyServer1. Similarly session 1 and 2 are bound to MyServer3 and MyServer2 respectively. </p>
 <div class="section"><h2>
 <a name="Sample55" id="Sample55">Sample 55: Session affinity load balancing between fail over endpoints</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-
-    &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
-        &lt;in&gt;
-            &lt;send&gt;
-                &lt;endpoint&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main" onError="errorHandler">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint>
                     &lt;!-- specify the session as the simple client session provided by Synapse for
-                    testing purpose --&gt;
-                    
-                    <strong>&lt;session type=&quot;simpleClientSession&quot;/&gt;</strong>
-
-                    &lt;loadbalance&gt;
-                        &lt;endpoint&gt;
-                            &lt;failover&gt;
-                                &lt;endpoint&gt;
-                                    &lt;address uri=&quot;http://localhost:9001/services/LBService1&quot;&gt;
-                                        &lt;enableAddressing/&gt;
-                                    &lt;/address&gt;
-                                &lt;/endpoint&gt;
-                                &lt;endpoint&gt;
-                                    &lt;address uri=&quot;http://localhost:9002/services/LBService1&quot;&gt;
-                                        &lt;enableAddressing/&gt;
-                                    &lt;/address&gt;
-                                &lt;/endpoint&gt;
-                            &lt;/failover&gt;
-                        &lt;/endpoint&gt;
-                        &lt;endpoint&gt;
-                            &lt;failover&gt;
-                                &lt;endpoint&gt;
-                                    &lt;address uri=&quot;http://localhost:9003/services/LBService1&quot;&gt;
-                                        &lt;enableAddressing/&gt;
-                                    &lt;/address&gt;
-                                &lt;/endpoint&gt;
-                                &lt;endpoint&gt;
-                                    &lt;address uri=&quot;http://localhost:9004/services/LBService1&quot;&gt;
-                                        &lt;enableAddressing/&gt;
-                                    &lt;/address&gt;
-                                &lt;/endpoint&gt;
-                            &lt;/failover&gt;
-                        &lt;/endpoint&gt;
-                    &lt;/loadbalance&gt;
-                &lt;/endpoint&gt;
-            &lt;/send&gt;
-            &lt;drop/&gt;
-        &lt;/in&gt;
-
-        &lt;out&gt;
-            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) --&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-
-    &lt;sequence name=&quot;errorHandler&quot;&gt;
-        &lt;makefault response=&quot;true&quot;&gt;
-            &lt;code value=&quot;tns:Receiver&quot; xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-            &lt;reason value=&quot;COULDN'T SEND THE MESSAGE TO THE SERVER.&quot;/&gt;
-        &lt;/makefault&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
+                                     testing purpose -->
+                    &lt;session type="simpleClientSession"/>
+
+                    &lt;loadbalance>
+                        &lt;endpoint>
+                            &lt;failover>
+                                &lt;endpoint>
+                                    &lt;address uri="http://localhost:9001/services/LBService1">
+                                        &lt;enableAddressing/>
+                                    &lt;/address>
+                                &lt;/endpoint>
+                                &lt;endpoint>
+                                    &lt;address uri="http://localhost:9002/services/LBService1">
+                                        &lt;enableAddressing/>
+                                    &lt;/address>
+                                &lt;/endpoint>
+                            &lt;/failover>
+                        &lt;/endpoint>
+                        &lt;endpoint>
+                            &lt;failover>
+                                &lt;endpoint>
+                                    &lt;address uri="http://localhost:9003/services/LBService1">
+                                        &lt;enableAddressing/>
+                                    &lt;/address>
+                                &lt;/endpoint>
+                                &lt;endpoint>
+                                    &lt;address uri="http://localhost:9004/services/LBService1">
+                                        &lt;enableAddressing/>
+                                    &lt;/address>
+                                &lt;/endpoint>
+                            &lt;/failover>
+                        &lt;/endpoint>
+                    &lt;/loadbalance>
+                &lt;/endpoint>
+            &lt;/send>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) -->
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+    &lt;sequence name="errorHandler">
+        &lt;makefault response="true">
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>
+        &lt;/makefault>
+        &lt;send/>
+    &lt;/sequence>
 
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Demonstrate the session affinity based load balancing with failover capability</strong> </p>
 <p>
@@ -1293,26 +1424,28 @@ Content-ID:
 ...</pre>
 <div class="section"><h2>
 <a name="Sample56" id="Sample56">Sample 56: WSDL endpoint</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns="http://synapse.apache.org/ns/2010/04/configuraiton"&gt;
-
-    &lt;sequence name="main"&gt;
-        &lt;in&gt;
-            &lt;send&gt;
-                &lt;!-- get epr from the given wsdl --&gt;
-                &lt;endpoint&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;send>
+                &lt;!-- get epr from the given wsdl -->
+                &lt;endpoint>
                     &lt;wsdl uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"
                           service="SimpleStockQuoteService"
-                          port="SimpleStockQuoteServiceHttpSoap11Endpoint"/&gt;
-                &lt;/endpoint&gt;
-            &lt;/send&gt;
-        &lt;/in&gt;
-
-        &lt;out&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
+                          port="SimpleStockQuoteServiceHttpSoap11Endpoint"/>
+                &lt;/endpoint>
+            &lt;/send>
+        &lt;/in>
+
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
 
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Demonstrate the use of WSDL endpoints</strong> </p>
 <p>
@@ -1334,40 +1467,41 @@ Content-ID:
 <p>Client will print the quote price for IBM received from the server running on port 9000. Observe the Axis2 console and the Synapse console to verify this behavior. </p>
 <div class="section"><h2>
 <a name="Sample57" id="Sample57">Sample 57: Dynamic load balancing between 3 nodes</a></h2></div>
-<pre xml:space="preserve">
-&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-
-    &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
-        &lt;in&gt;
-            &lt;send&gt;
-                &lt;endpoint name=&quot;dynamicLB&quot;&gt;
-                    &lt;dynamicLoadbalance failover=&quot;true&quot;
-                                           algorithm=&quot;org.apache.synapse.endpoints.algorithms.RoundRobin&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main" onError="errorHandler">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint name="dynamicLB">
+                    &lt;dynamicLoadbalance failover="true"
+                                        algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
                         &lt;membershipHandler
-                                class=&quot;org.apache.synapse.core.axis2.Axis2LoadBalanceMembershipHandler&quot;&gt;
-                            &lt;property name=&quot;applicationDomain&quot; value=&quot;apache.axis2.app.domain&quot;/&gt;
-                        &lt;/membershipHandler&gt;
-                    &lt;/dynamicLoadbalance&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=&quot;errorHandler&quot;&gt;
-        &lt;makefault response=&quot;true&quot;&gt;
-            &lt;code value=&quot;tns:Receiver&quot; xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-            &lt;eason value=&quot;COULDN'T SEND THE MESSAGE TO THE SERVER.&quot;/&gt;
-        &lt;/makefault&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
+                                class="org.apache.synapse.core.axis2.Axis2LoadBalanceMembershipHandler">
+                            &lt;property name="applicationDomain" value="apache.axis2.app.domain"/>
+                        &lt;/membershipHandler>
+                    &lt;/dynamicLoadbalance>
+                &lt;/endpoint>
+            &lt;/send>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) -->
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+    &lt;sequence name="errorHandler">
+        &lt;makefault response="true">
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>
+        &lt;/makefault>
+        &lt;send/>
+    &lt;/sequence>
 
-&lt;/definitions&gt;
-</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Demonstrate the simple dynamic load balancing among a set of nodes</strong> </p>
 <p>
@@ -1404,38 +1538,39 @@ Content-ID:
 <p>Now restart MyServer1. You can observe that requests will be again sent to all three servers. </p>
 <div class="section"><h2>
 <a name="Sample58" id="Sample58">Sample 58: Static load balancing between 3 nodes</a></h2></div>
-<pre xml:space="preserve">
-&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-
-    &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
-        &lt;in&gt;
-            &lt;send&gt;
-                &lt;endpoint&gt;
-                    &lt;loadbalance failover=&quot;true&quot;&gt;
-                        &lt;member hostName=&quot;127.0.0.1&quot; httpPort=&quot;9001&quot; httpsPort=&quot;9005&quot;/&gt;
-                        &lt;member hostName=&quot;127.0.0.1&quot; httpPort=&quot;9002&quot; httpsPort=&quot;9006&quot;/&gt;
-                        &lt;member hostName=&quot;127.0.0.1&quot; httpPort=&quot;9003&quot; httpsPort=&quot;9007&quot;/&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=&quot;errorHandler&quot;&gt;
-        &lt;makefault response=&quot;true&quot;&gt;
-            &lt;code value=&quot;tns:Receiver&quot; xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot;/&gt;
-            &lt;reason value=&quot;COULDN'T SEND THE MESSAGE TO THE SERVER.&quot;/&gt;
-        &lt;/makefault&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main" onError="errorHandler">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint>
+                    &lt;loadbalance failover="true">
+                        &lt;member hostName="127.0.0.1" httpPort="9001" httpsPort="9005"/>
+                        &lt;member hostName="127.0.0.1" httpPort="9002" httpsPort="9006"/>
+                        &lt;member hostName="127.0.0.1" httpPort="9003" httpsPort="9007"/>
+                    &lt;/loadbalance>
+                &lt;/endpoint>
+            &lt;/send>
+            &lt;drop/>
+        &lt;/in>
+
+        &lt;out>
+            &lt;!-- Send the messages where they have been sent (i.e. implicit To EPR) -->
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+    &lt;sequence name="errorHandler">
+        &lt;makefault response="true">
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/>
+        &lt;/makefault>
+        &lt;send/>
+    &lt;/sequence>
 
-&lt;/definitions&gt;
-</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Demonstrate the simple static load balancing among a set of nodes</strong> </p>
 <p>
@@ -1473,24 +1608,28 @@ Content-ID:
 <a name="MessageMediationQoS" id="MessageMediationQoS">Quality of Service addition or deduction samples in message mediation</a> </h1>
 <div class="section"><h2>
 <a name="Sample100" id="Sample100">Sample 100: Using WS-Security for outgoing messages</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;localEntry key=&quot;sec_policy&quot; src=&quot;file:repository/conf/sample/resources/policy/policy_3.xml&quot;/&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;localEntry key="sec_policy" src="file:repository/conf/sample/resources/policy/policy_3.xml"/>
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;send>
+                &lt;endpoint name="secure">
+                    &lt;address uri="http://localhost:9000/services/SecureStockQuoteService">
+                        &lt;enableSec policy="sec_policy"/>
+                    &lt;/address>
+                &lt;/endpoint>
+            &lt;/send>
+        &lt;/in>
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
 
-    &lt;in&gt;
-        &lt;send&gt;
-            &lt;endpoint name=&quot;secure&quot;&gt;
-                &lt;address uri=&quot;http://localhost:9000/services/SecureStockQuoteService&quot;&gt;
-                    &lt;enableSec policy=&quot;sec_policy&quot;/&gt;
-                &lt;/address&gt;
-            &lt;/endpoint&gt;
-        &lt;/send&gt;
-    &lt;/in&gt;
-    &lt;out&gt;
-        &lt;header name=&quot;wsse:Security&quot; action=&quot;remove&quot;
-                xmlns:wsse=&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;/&gt;
-        &lt;send/&gt;
-    &lt;/out&gt;
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Connecting to endpoints with WS-Security for outgoing messages</strong> </p>
 <p>
@@ -1549,29 +1688,29 @@ User-Agent: Synapse-HttpComponents-NIO
 
 <div class="section"><h2>
 <a name="Sample101" id="Sample101">Sample 101: Reliable message exchange between Synapse and the back-end server using WS-ReliableMessaging</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-
-    &lt;in&gt;
-        &lt;RMSequence single=&quot;true&quot; version=&quot;1.0&quot;/&gt;
-        &lt;send&gt;
-           &lt;endpoint name=&quot;reliable&quot;&gt;
-              &lt;address uri=&quot;http://localhost:9000/services/ReliableStockQuoteService&quot;&gt;
-                 &lt;enableRM/&gt;
-                 &lt;enableAddressing/&gt;
-              &lt;/address&gt;
-           &lt;/endpoint&gt;
-        &lt;/send&gt;
-    &lt;/in&gt;
-    &lt;out&gt;
-        &lt;header name=&quot;wsrm:SequenceAcknowledgement&quot; action=&quot;remove&quot;
-                xmlns:wsrm=&quot;http://schemas.xmlsoap.org/ws/2005/02/rm&quot;/&gt;
-        &lt;header name=&quot;wsrm:Sequence&quot; action=&quot;remove&quot;
-                xmlns:wsrm=&quot;http://schemas.xmlsoap.org/ws/2005/02/rm&quot;/&gt;
-        &lt;send/&gt;
-    &lt;/out&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;RMSequence single="true" version="1.0"/>
+            &lt;send>
+                &lt;endpoint name="reliable">
+                    &lt;address uri="http://localhost:9000/services/ReliableStockQuoteService">
+                        &lt;enableRM/>
+                        &lt;enableAddressing/>
+                    &lt;/address>
+                &lt;/endpoint>
+            &lt;/send>
+        &lt;/in>
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
 
-&lt;/definitions&gt;</pre>
-<strong>Objective: Demonstrate the message exchange between Synapse and the server using WS-ReliableMessaging (WS-RM)</strong>
+&lt;/definitions></pre>
+<strong>Objective: Demonstrate the message exchange between Synapse and the server using WS-ReliableMessaging (WS-RM) - 1.0</strong>
 <p>
 <strong>Prerequisites:</strong>
 <br/>Deploy the ReliableStockQuoteService in the sample Axis2 server by switching to the samples/axis2Server/src/ReliableStockQuoteService directory and running the command 'ant'.
@@ -1689,24 +1828,54 @@ User-Agent: Synapse-HttpComponents-NIO
     &lt;/soapenv:Body&gt;
 &lt;/soapenv:Envelope&gt;</pre>
 <p>Note that although each of above messages are separate SOAP messages, in most cases they will be exchanged in a single socket connection as HTTP Keep-Alive header is used. </p>
+<div class="section"><h2>
+<a name="Sample102" id="Sample102">Sample 102: Reliable message exchange between Synapse and the back-end server using WS-ReliableMessaging</a></h2></div>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;sequence name="main">
+        &lt;in>
+            &lt;RMSequence single="true" version="1.1"/>
+            &lt;send>
+                &lt;endpoint name="reliable">
+                    &lt;address uri="http://localhost:9000/services/ReliableStockQuoteService">
+                        &lt;enableRM/>
+                        &lt;enableAddressing/>
+                    &lt;/address>
+                &lt;/endpoint>
+            &lt;/send>
+        &lt;/in>
+        &lt;out>
+            &lt;send/>
+        &lt;/out>
+    &lt;/sequence>
+
+&lt;/definitions></pre>
+<strong>Objective: Demonstrate the message exchange between Synapse and the server using WS-ReliableMessaging (WS-RM) - 1.1</strong>
+<p>This sample is as same as the previous one except it uses WS-RM 1.1 version where as the previous sample is using the RM version 1.0</p>
 <h1>
 <a name="ProxyServices" id="ProxyServices">Synapse Proxy service samples</a> </h1>
 
 <div class="section"><h2>
 <a name="Sample150" id="Sample150">Sample 150: Introduction to proxy services</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;proxy name=&quot;StockQuoteProxy&quot;&gt;
-        &lt;target&gt;
-            &lt;endpoint&gt;
-                &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
-            &lt;/endpoint&gt;
-            &lt;outSequence&gt;
-                &lt;send/&gt;
-            &lt;/outSequence&gt;
-        &lt;/target&gt;
-        &lt;publishWSDL uri=&quot;file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl&quot;/&gt;
-    &lt;/proxy&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;proxy name="StockQuoteProxy">
+        &lt;target>
+            &lt;endpoint>
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+            &lt;/endpoint>
+            &lt;outSequence>
+                &lt;send/>
+            &lt;/outSequence>
+        &lt;/target>
+        &lt;publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+    &lt;/proxy>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Introduction to Synapse proxy services</strong> </p>
 <p>
@@ -1719,31 +1888,41 @@ User-Agent: Synapse-HttpComponents-NIO
 <p>An 'inSequence' or 'endpoint' or both of these would decide how the message would be handled after the proxy service receives the message. In the above example, the request received is forwarded to the sample service hosted on Axis2. The 'outSequence' defines how the response is handled before it is sent back to the client. By default, a proxy service is exposed over all transports configured for Synapse, unless these are specifically mentioned through the 'transports' attribute. </p>
 <div class="section"><h2>
 <a name="Sample151" id="Sample151">Sample 151: Custom sequences and endpoints with proxy services</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;localEntry key="proxy_wsdl"
+                src="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+
+    &lt;endpoint name="proxy_2_endpoint">
+        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+    &lt;/endpoint>
+
+    &lt;sequence name="proxy_1">
+        &lt;send>
+            &lt;endpoint>
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+            &lt;/endpoint>
+        &lt;/send>
+    &lt;/sequence>
+
+    &lt;sequence name="out">
+        &lt;send/>
+    &lt;/sequence>
+
+    &lt;proxy name="StockQuoteProxy1">
+        &lt;target inSequence="proxy_1" outSequence="out"/>
+        &lt;    publishWSDL key="proxy_wsdl"/>
+    &lt;
+    /proxy>
+
+    &lt;    proxy name="StockQuoteProxy2">
+        &lt;target endpoint="proxy_2_endpoint" outSequence="out"/>
+        &lt;publishWSDL key="proxy_wsdl"/>
+    &lt;/proxy>
 
-    &lt;sequence name=&quot;proxy_1&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;/sequence&gt;
-    &lt;sequence name=&quot;out&quot;&gt;
-        &lt;send/&gt;
-    &lt;/sequence&gt;
-    &lt;endpoint name=&quot;proxy_2_endpoint&quot;&gt;
-        &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
-    &lt;/endpoint&gt;
-    &lt;localEntry key=&quot;proxy_wsdl&quot; src=&quot;file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl&quot;/&gt;
-
-    &lt;proxy name=&quot;StockQuoteProxy1&quot;&gt;
-        &lt;publishWSDL key=&quot;proxy_wsdl&quot;/&gt;
-        &lt;target inSequence=&quot;proxy_1&quot; outSequence=&quot;out&quot;/&gt;
-    &lt;/proxy&gt;
-
-    &lt;proxy name=&quot;StockQuoteProxy2&quot;&gt;
-        &lt;publishWSDL key=&quot;proxy_wsdl&quot;/&gt;
-        &lt;target endpoint=&quot;proxy_2_endpoint&quot; outSequence=&quot;out&quot;/&gt;
-    &lt;/proxy&gt;
-&lt;/definitions&gt;</pre>
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Using custom sequences and endpoints for message mediation with proxy services</strong> </p>
 <p>
@@ -1757,19 +1936,23 @@ User-Agent: Synapse-HttpComponents-NIO
 <br/>ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy2</pre>
 <div class="section"><h2>
 <a name="Sample152" id="Sample152">Sample 152: Switching transports and message format from SOAP to REST/POX</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;proxy name=&quot;StockQuoteProxy&quot; transports=&quot;https&quot;&gt;
-        &lt;target&gt;
-            &lt;endpoint&gt;
-                &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot; format=&quot;pox&quot;/&gt;
-            &lt;/endpoint&gt;
-            &lt;outSequence&gt;
-                &lt;send/&gt;
-            &lt;/outSequence&gt;
-        &lt;/target&gt;
-        &lt;publishWSDL uri=&quot;file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl&quot;/&gt;
-    &lt;/proxy&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
+
+    &lt;proxy name="StockQuoteProxy" transports="https">
+        &lt;target>
+            &lt;endpoint>
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService" format="pox"/>
+            &lt;/endpoint>
+            &lt;outSequence>
+                &lt;send/>
+            &lt;/outSequence>
+        &lt;/target>
+        &lt;publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+    &lt;/proxy>
+
+&lt;/definitions></pre>
 <p>
 <strong>Objective: Switching transports and message format from SOAP to REST/POX</strong> </p>
 <p>
@@ -1825,24 +2008,28 @@ Connection: Keep-Alive
 
 <div class="section"><h2>
 <a name="Sample153" id="Sample153">Sample 153: Routing the messages arrived to a proxy service without processing the security headers</a></h2></div>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
-    &lt;proxy name=&quot;StockQuoteProxy&quot;&gt;
-        &lt;target&gt;
-            &lt;inSequence&gt;
-                &lt;property name="preserveProcessedHeaders" value="true"/&gt;
-                &lt;send&gt;
-                    &lt;endpoint&gt;
-                        &lt;address uri=&quot;http://localhost:9000/services/SecureStockQuoteService&quot;/&gt;
-                    &lt;/endpoint&gt;
-                &lt;/send&gt;
-            &lt;/inSequence&gt;
-            &lt;outSequence&gt;
-                &lt;send/&gt;
-            &lt;/outSequence&gt;
-        &lt;/target&gt;
-        &lt;publishWSDL uri=&quot;file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl&quot;/&gt;
-    &lt;/proxy&gt;
-&lt;/definitions&gt;</pre>
+<pre xml:space="preserve">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"

[... 4262 lines stripped ...]