You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ka...@apache.org on 2011/12/23 12:55:09 UTC

svn commit: r1222651 [6/14] - in /synapse/branches/2.1: ./ modules/distribution/ modules/distribution/src/main/assembly/ modules/documentation/ modules/documentation/src/ modules/documentation/src/site/ modules/documentation/src/site/resources/ modules...

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample102.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample102.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample102.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample102.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 102</title>
+    </properties>
+    <body>
+        <section name="Sample 102:Reliable message exchange between Synapse and the back-end server using WS-ReliableMessaging 1.1 ">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;sequence name="main"&gt;
+        &lt;in&gt;
+            &lt;RMSequence single="true" version="1.1"/&gt;
+            &lt;send&gt;
+                &lt;endpoint name="reliable"&gt;
+                    &lt;address uri="http://localhost:9000/services/ReliableStockQuoteService"&gt;
+                        &lt;enableRM/&gt;
+                        &lt;enableAddressing/&gt;
+                    &lt;/address&gt;
+                &lt;/endpoint&gt;
+            &lt;/send&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+               	 	Demonstrate the message exchange between Synapse and the server using WS-ReliableMessaging (WS-RM) - 1.1
+			    </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 102 (repository/conf/sample/synapse_sample_102.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 102<br/>
+                                Windows: synapse.bat -sample 102
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+             	<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>
+             </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample11.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample11.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample11.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample11.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 11</title>
+    </properties>
+    <body>
+        <section name="Sample 11: A Full Registry based Configuration, and Sharing Configuration Between Multiple Instances">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry"&gt;
+        &lt;parameter name="root"&gt;file:./repository/conf/sample/resources/&lt;/parameter&gt;
+        &lt;parameter name="cachableDuration"&gt;15000&lt;/parameter&gt;
+    &lt;/registry&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrating the ability of Synapse to load the entire configuration from
+                    a remote registry. This approach can also be used to share a single configuration
+                    between multiple Synapse instances by pointing all the Synapse instances to the
+                    same URL registry.
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 11 (repository/conf/sample/synapse_sample_11.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 11<br/>
+                                Windows: synapse.bat -sample 11
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    This example shows a full registry based Synapse configuration. This makes it
+                    possible to easily start multiple instances of Synapse sharing a single configuration
+                    in a clustered environment. The Synapse configuration of a given node hosting
+                    Synapse simply points to the registry and looks up the actual configuration by
+                    requesting the key 'synapse.xml'. 
+                </p>
+                <p>(Note: Full registry based configuration is not dynamic atleast for the moment -
+                    i.e. it is not reloading itself)</p>
+                <p>
+                    Invoke the client as follows.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
+                <p>
+                    Synapse will generate the following log output.
+                </p>
+                <div class="consoleOutput">[HttpServerWorker-1] INFO LogMediator - message = This is a dynamic Synapse configuration</div>
+                <p>The actual synapse.xml loaded from the registry is: </p>
+                <div class="xmlConf">&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;</div>
+
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample12.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample12.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample12.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample12.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 12</title>
+    </properties>
+    <body>
+        <section name="Sample 12: One-way Messaging / Fire-and-Forget Through Synapse">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;sequence name="main"&gt;
+        &lt;!-- filtering of messages with XPath and regex matches --&gt;
+        &lt;filter source="get-property('To')" regex=".*/StockQuote.*"&gt;
+            &lt;then&gt;
+                &lt;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&gt;
+                    &lt;/endpoint&gt;
+                &lt;/send&gt;
+                &lt;drop/&gt;
+            &lt;/then&gt;
+        &lt;/filter&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate the ability to perform one-way invocations (out-only) through
+                    Synapse.
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            This sample makes use of the configuration used in <a href="sample1.html">sample 1</a>.
+                            So start Synapse using the configuration numbered 1 (repository/conf/sample/synapse_sample_1.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 1<br/>
+                                Windows: synapse.bat -sample 1
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    In this example we will invoke the one-way 'placeOrder' operation on the
+                    SimpleStockQuoteService using the sample client which uses the Axis2
+                    ServiceClient.fireAndForget() API. To send a placeOrder request from the sample
+                    client, execute the following command.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder</div>
+
+                <p>
+                    Going through the Axis2 server logs, you will notice the following entry, which
+                    confirms that Axis2 accepted the in-only request.
+                </p>
+                <div class="consoleOutput">SimpleStockQuoteService :: Accepted order for : 7482 stocks of IBM at $ 169.27205579038733</div>
+
+                <p>
+                    If you send your client request through TCPmon, you will notice that the
+                    SimpleStockQuoteService replies to Synapse with a HTTP 202 reply, and that Synapse
+                    in turns replies to the client with a HTTP 202 acknowledgment.
+                </p>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 13</title>
+    </properties>
+    <body>
+        <section name="Sample 13: Dual Channel Invocations Through Synapse">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+
+    &lt;sequence name="main"&gt;
+        &lt;!-- log all attributes of messages passing through --&gt;
+        &lt;log level=&quot;full&quot;/&gt;
+
+        &lt;!-- Send the message to implicit destination --&gt;
+        &lt;send/&gt;
+    &lt;sequence/&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate the ability to perform dual channel invocations through
+                    Synapse (asynchronous notification).
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            This sample makes use of the configuration used in <a href="sample0.html">sample 0</a>.
+                            So start Synapse using the configuration numbered 0 (repository/conf/sample/synapse_sample_0.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 0<br/>
+                                Windows: synapse.bat -sample 0
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
+                <p>
+                    This example invokes the same 'getQuote' operation on the SimpleStockQuoteService
+                    using the custom client which uses the Axis2 ServiceClient API with useSeparateListener
+                    set to 'true', so that the response is coming through a different channel than
+                    the one which is used to send the request. Note the following log thrown out
+                    by the sample client.
+                </p>
+                <div class="consoleOutput">Response received to the callback
+Standard dual channel :: Stock price = $57.16686934968289</div>
+                <p>
+                    If you send your client request through TCPmon, you will notice that Synapse replies
+                    to the client with a HTTP 202 acknowledgment when you send the request and the
+                    communication between Synapse and the server happens on a single channel and then
+                    you get the response back from Synapse to the client callback in a different channel
+                    (which cannot be observed through TCPmon).
+                </p>
+                <p>
+                    Also you could see the wsa:Reply-To header being something like
+                    http://localhost:8200/axis2/services/anonService2 which implies that the reply
+                    is gpoing on a different channel listening on the port 8200. Please note that it
+                    is required to engage addressing when using the dual channel invocation because
+                    it requires the wsa:Reply-To header.
+                </p>                
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more 
+	contributor license agreements. See the NOTICE file ~ distributed with this 
+	work for additional information ~ regarding copyright ownership. The ASF 
+	licenses this file ~ to you under the Apache License, Version 2.0 (the ~ 
+	"License"); you may not use this file except in compliance ~ with the License. 
+	You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
+	~ ~ Unless required by applicable law or agreed to in writing, ~ software 
+	distributed under the License is distributed on an ~ * "AS IS" BASIS, WITHOUT 
+	WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the 
+	License for the ~ specific language governing permissions and limitations 
+	~ under the License. -->
+
+<document>
+	<properties>
+		<title>Apache Synapse - Sample 14</title>
+	</properties>
+	<body>
+		<section name="Sample 14: Sequences and Endpoints as local registry items">
+			<div class="xmlConf"><pre xml:space="preserve">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;
+             xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+             xsi:schemaLocation=&quot;http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd&quot;&gt;
+
+    &lt;localEntry key=&quot;local-enrty-ep-key&quot;
+                src=&quot;file:repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml&quot;/&gt;
+
+    &lt;localEntry key=&quot;local-enrty-sequence-key&quot;&gt;
+        &lt;sequence name=&quot;dynamic_sequence&quot;&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;message&quot; value=&quot;*** Test Message 1 ***&quot;/&gt;
+            &lt;/log&gt;
+        &lt;/sequence&gt;
+    &lt;/localEntry&gt;
+
+    &lt;sequence name=&quot;main&quot;&gt;
+        &lt;in&gt;
+            &lt;sequence key=&quot;local-enrty-sequence-key&quot;/&gt;
+            &lt;send&gt;
+                &lt;endpoint key=&quot;local-enrty-ep-key&quot;/&gt;
+            &lt;/send&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</pre></div>
+			<subsection name="Objective">
+				<p>
+					Objective: Sequence and Endpoints as local registry entries
+				</p>
+			</subsection>
+
+			<subsection name="Pre-requisites">
+				<p>
+					<ul>
+						<li>
+							Start the Synapse configuration numbered 14: i.e. synapse
+							-sample 14
+						</li>
+						<li>
+							Start the Axis2 server and deploy the SimpleStockQuoteService if
+							not already done
+						</li>
+					</ul>
+				</p>
+			</subsection>
+			<subsection name="Executing the Client">
+				<p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/</div>
+             	<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>
+                
+            </subsection>
+
+		</section>
+		<p>
+			<a href="../samples.html">Back to Catalog</a>
+		</p>
+	</body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample150.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample150.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample150.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample150.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 150</title>
+    </properties>
+    <body>
+        <section name="Sample 150: Introduction to Proxy Services">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="StockQuoteProxy"&gt;
+        &lt;target&gt;
+            &lt;endpoint&gt;
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&gt;
+            &lt;/endpoint&gt;
+            &lt;outSequence&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+        &lt;publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Introduce the concept of proxy services in Synapse
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 150 (repository/conf/sample/synapse_sample_150.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 150<br/>
+                                Windows: synapse.bat -sample 150
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the stock quote client as follows and invoke the proxy service:
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy</div>
+
+                <p>
+                    The '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 transportss
+                    configured for Synapse, unless these are specifically mentioned through the
+                    'transports' attribute.
+                </p>
+                <p>
+                    You can also view the WSDL of the proxy service by launching a web browser and
+                    navigating to the following URL:
+                </p>
+                <div class="command">http://localhost:8280/services/StockQuoteProxy?wsdl</div>
+                
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample151.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample151.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample151.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample151.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 151</title>
+    </properties>
+    <body>
+        <section name="Sample 151: Custom Sequences and Endpoints with Proxy Services">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;localEntry key="proxy_wsdl"
+                src="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
+
+    &lt;endpoint name="proxy_2_endpoint"&gt;
+        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&gt;
+    &lt;/endpoint&gt;
+
+    &lt;sequence name="proxy_1"&gt;
+        &lt;send&gt;
+            &lt;endpoint&gt;
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&gt;
+            &lt;/endpoint&gt;
+        &lt;/send&gt;
+    &lt;/sequence&gt;
+
+    &lt;sequence name="out"&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+
+    &lt;proxy name="StockQuoteProxy1"&gt;
+        &lt;target inSequence="proxy_1" outSequence="out"/&gt;
+        &lt;publishWSDL key="proxy_wsdl"/&gt;
+    &lt;/proxy&gt;
+
+    &lt;proxy name="StockQuoteProxy2"&gt;
+        &lt;target endpoint="proxy_2_endpoint" outSequence="out"/&gt;
+        &lt;publishWSDL key="proxy_wsdl"/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate how to use predefined endpoints and sequences in a proxy service
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 151 (repository/conf/sample/synapse_sample_151.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 151<br/>
+                                Windows: synapse.bat -sample 151
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    This configuration creates two proxy services. The first proxy service
+                    'StockQuoteProxy1' uses the sequence named 'proxy_1' to process incoming
+                    messages and the sequence named 'out' to process outgoing responses. The second
+                    proxy service, 'StockQuoteProxy2' is set to directly forward messages to the
+                    endpoint named 'proxy_2_endpoint' without any mediation.
+                </p>
+                <p>
+                    You can send a stock quote request to each of these proxy services and receive
+                    the reply generated by the actual service hosted on the Axis2 server instance.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy1
+<br/>ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy2</div>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample152.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample152.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample152.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample152.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 152</title>
+    </properties>
+    <body>
+        <section name="Sample 152: Switching Transports and Message Format from SOAP to REST/POX">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="StockQuoteProxy" transports="https"&gt;
+        &lt;target&gt;
+            &lt;endpoint&gt;
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService" format="pox"/&gt;
+            &lt;/endpoint&gt;
+            &lt;outSequence&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+        &lt;publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate implementing simple transport switching and message format switching
+                    scenarios using proxy services
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 152 (repository/conf/sample/synapse_sample_152.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 152<br/>
+                                Windows: synapse.bat -sample 152
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    This configuration demonstrates how a proxy service can be exposed on a subset
+                    of available transports, and how it could switch from one transport to another.
+                    This example exposes the created proxy service only on HTTPS, and thus if the
+                    user tries to access it over HTTP, it would result in a fault.
+                </p>
+                <div class="consoleOutput">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy
+...
+ [java] org.apache.axis2.AxisFault: The service cannot be found for the endpoint reference (EPR) /soap/StockQuoteProxy</div>
+
+                <p>
+                    Accessing this over HTTPS causes the proxy service to access the SimpleStockQuoteService
+                    on the sample Axis2 server using REST/POX.
+                </p>
+                <div class="command">ant stockquote -Dtrpurl=https://localhost:8243/services/StockQuoteProxy</div>
+
+                <p>
+                    TCPMon can be used to trace the actual REST/POX messages exchanged between Synapse
+                    and the sample Axis2 server. Synapse converts the POX response back to SOAP before
+                    sending it back to the client.
+                </p>
+                <div class="consoleOutput">POST /services/SimpleStockQuoteService HTTP/1.1
+Host: 127.0.0.1
+SOAPAction: urn:getQuote
+Content-Type: application/xml; charset=UTF-8;action=&quot;urn:getQuote&quot;;
+Transfer-Encoding: chunked
+Connection: Keep-Alive
+User-Agent: Synapse-HttpComponents-NIO
+
+75
+&lt;m0:getQuote xmlns:m0=&quot;http://services.samples&quot;&gt;
+   &lt;m0:request&gt;
+      &lt;m0:symbol&gt;IBM&lt;/m0:symbol&gt;
+   &lt;/m0:request&gt;
+&lt;/m0:getQuote&gt;</div>
+                
+                <div class="consoleOutput">HTTP/1.1 200 OK
+Content-Type: application/xml; charset=UTF-8;action=&quot;http://services.samples/SimpleStockQuoteServicePortType/getQuoteResponse&quot;;
+Date: Tue, 24 Apr 2007 14:42:11 GMT
+Server: Synapse-HttpComponents-NIO
+Transfer-Encoding: chunked
+Connection: Keep-Alive
+
+2b3
+&lt;ns:getQuoteResponse xmlns:ns=&quot;http://services.samples/xsd&quot;&gt;
+   &lt;ns:return&gt;
+      &lt;ns:change&gt;3.7730036841862384&lt;/ns:change&gt;
+      &lt;ns:earnings&gt;-9.950236235550818&lt;/ns:earnings&gt;
+      &lt;ns:high&gt;-80.23868444613285&lt;/ns:high&gt;
+      &lt;ns:last&gt;80.50750970812187&lt;/ns:last&gt;
+      &lt;ns:lastTradeTimestamp&gt;Tue Apr 24 20:42:11 LKT 2007&lt;/ns:lastTradeTimestamp&gt;
+      &lt;ns:low&gt;-79.67368355714606&lt;/ns:low&gt;
+      &lt;ns:marketCap&gt;4.502043663670823E7&lt;/ns:marketCap&gt;
+      &lt;ns:name&gt;IBM Company&lt;/ns:name&gt;
+      &lt;ns:open&gt;-80.02229531286982&lt;/ns:open&gt;
+      &lt;ns:peRatio&gt;25.089295161182022&lt;/ns:peRatio&gt;
+      &lt;ns:percentageChange&gt;4.28842665653824&lt;/ns:percentageChange&gt;
+      &lt;ns:prevClose&gt;87.98107059692451&lt;/ns:prevClose&gt;
+      &lt;ns:symbol&gt;IBM&lt;/ns:symbol&gt;
+      &lt;ns:volume&gt;19941&lt;/ns:volume&gt;
+   &lt;/ns:return&gt;
+&lt;/ns:getQuoteResponse&gt;</div>
+
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample153.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample153.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample153.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample153.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 153</title>
+    </properties>
+    <body>
+        <section name="Sample 153: Routing the Messages without Processing the Security Headers">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="StockQuoteProxy"&gt;
+        &lt;target&gt;
+            &lt;inSequence&gt;
+                &lt;property name="preserveProcessedHeaders" value="true"/&gt;
+                &lt;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;address uri="http://localhost:9000/services/SecureStockQuoteService"/&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="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate the ability of Synapse to pass SOAP messages through without removing
+                    already processed headers
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Download and install the Java Cryptography Extension (JCE) unlimited
+                            strength policy files for your JDK
+                        </li>
+                        <li>
+                            Deploy the SecureStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 153 (repository/conf/sample/synapse_sample_153.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 153<br/>
+                                Windows: synapse.bat -sample 153
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    In this sample the proxy service will receive secured messages with security
+                    headers which are flagged 'MustUnderstand'. But since the element 'enableSec'
+                    is not present in the proxy configuration, Synapse will not engage Apache Rampart
+                    on this proxy service. It is expected that a MustUnderstand failure exception
+                    on the AxisEngine would occur before the message arrives at mediation engine.
+                    But Synapse handles this message and gets it through by setting all the
+                    MustUnderstand headers which are not processed as processed. This will enable
+                    Synapse to route the messages without reading the Security headers (just routing
+                    the messages from client to service, both of which are secured). To execute the 
+                    client, send a stock quote request to the proxy service, and sign and encrypt
+                    the request by specifying the client side security policy as follows:
+                </p>
+                <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dpolicy=./../../repository/conf/sample/resources/policy/client_policy_3.xml</div>
+                <p>
+                    By following through the debug logs or TCPMon output, you can see that the
+                    request received by the proxy service was signed and encrypted. Also, looking
+                    up the WSDL of the proxy service by requesting the URL http://localhost:8280/services/StockQuoteProxy?wsdl
+                    reveals that the security policy attachments are not there and security is not engaged.
+                    When sending the message to the backend service, you can verify that the security 
+                    headers were there as in the original message to Synapse from client, and that
+                    the response received does use WS-Security, and forwarded back to the client
+                    without any modification. You should note that this won't be a security hole
+                    because the message inside Synapse is signed and encrypted and can only be
+                    forwarded to a secure service.
+                </p>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample154.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample154.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample154.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample154.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 154</title>
+    </properties>
+    <body>
+        <section name="Sample 154: Load Balancing with Proxy Services">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="LBProxy" transports="http" startOnLoad="true"&gt;
+        &lt;target faultSequence="errorHandler"&gt;
+            &lt;inSequence&gt;
+                &lt;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;session type="simpleClientSession"/&gt;
+                        &lt;loadbalance algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin"&gt;
+                            &lt;endpoint&gt;
+                                &lt;address uri="http://localhost:9001/services/LBService1"&gt;
+                                    &lt;enableAddressing/&gt;
+                                    &lt;suspendDurationOnFailure&gt;20&lt;/suspendDurationOnFailure&gt;
+                                &lt;/address&gt;
+                            &lt;/endpoint&gt;
+                            &lt;endpoint&gt;
+                                &lt;address uri="http://localhost:9002/services/LBService1"&gt;
+                                    &lt;enableAddressing/&gt;
+                                    &lt;suspendDurationOnFailure&gt;20&lt;/suspendDurationOnFailure&gt;
+                                &lt;/address&gt;
+                            &lt;/endpoint&gt;
+                            &lt;endpoint&gt;
+                                &lt;address uri="http://localhost:9003/services/LBService1"&gt;
+                                    &lt;enableAddressing/&gt;
+                                    &lt;suspendDurationOnFailure&gt;20&lt;/suspendDurationOnFailure&gt;
+                                &lt;/address&gt;
+                            &lt;/endpoint&gt;
+                        &lt;/loadbalance&gt;
+                    &lt;/endpoint&gt;
+                &lt;/send&gt;
+                &lt;drop/&gt;
+            &lt;/inSequence&gt;
+            &lt;outSequence&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+        &lt;publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_2.wsdl"/&gt;
+    &lt;/proxy&gt;
+
+    &lt;sequence name="errorHandler"&gt;
+        &lt;makefault response="true"&gt;
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/&gt;
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/&gt;
+        &lt;/makefault&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate how to use a proxy service as a load balancer
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the LoadbalanceFailoverService in the sample Axis2 server (go to
+                            samples/axis2Server/src/LoadbalanceFailoverService and run 'ant')
+                        </li>
+                        <li>
+                            Start 3 instances of the Axis2 server on different ports as follows
+                            <div class="command">./axis2server.sh -http 9001 -https 9005 -name MyServer1<br/>
+./axis2server.sh -http 9002 -https 9006 -name MyServer2<br/>
+./axis2server.sh -http 9003 -https 9007 -name MyServer3</div>
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 154 (repository/conf/sample/synapse_sample_154.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 154<br/>
+                                Windows: synapse.bat -sample 154
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    This sample is similar to <a href="sample54.html">sample 54</a>. The only
+                    notable difference is the use of a proxy service.
+                </p>
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant loadbalancefailover -Dmode=session -Dtrpurl=http://localhost:8280/services/LBProxy</div>
+                <p>
+                    You will get an output similar to the following.
+                </p>
+                <div class="consoleOutput">[java] Request: 1 Session number: 1 Response from server: MyServer3
+[java] Request: 2 Session number: 2 Response from server: MyServer2
+[java] Request: 3 Session number: 0 Response from server: MyServer1
+[java] Request: 4 Session number: 2 Response from server: MyServer2
+[java] Request: 5 Session number: 1 Response from server: MyServer3
+[java] Request: 6 Session number: 2 Response from server: MyServer2
+[java] Request: 7 Session number: 2 Response from server: MyServer2
+[java] Request: 8 Session number: 1 Response from server: MyServer3
+[java] Request: 9 Session number: 0 Response from server: MyServer1
+[java] Request: 10 Session number: 0 Response from server: MyServer1
+... </div>
+                <p>
+                    You can see that session ID 0 is always directed to the server named MyServer1.
+                    That means session ID 0 is bound to MyServer1. Similarly session 1 and 2 are bound
+                    to MyServer3 and MyServer2 respectively.
+                </p>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample155.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample155.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample155.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample155.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 155</title>
+    </properties>
+    <body>
+        <section name="Sample 155: Dual Channel Invocation on Client Side and Server Side">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="StockQuoteProxy"&gt;
+        &lt;target&gt;
+            &lt;endpoint&gt;
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"&gt;
+                    &lt;enableAddressing separateListener="true"/&gt;
+                &lt;/address&gt;
+            &lt;/endpoint&gt;
+            &lt;outSequence&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+        &lt;publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    <a href="sample13.html">Sample 13</a> show cased how to perform dual channel
+                    invocations on the client side. This sample demonstrates how to perform dual
+                    channel invocations on both client side and server side, using proxy services.
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 155 (repository/conf/sample/synapse_sample_155.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 155<br/>
+                                Windows: synapse.bat -sample 155
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    This sample will show the action of the dual channel invocation between client
+                    and Synapse as well as between Synapse and the Axis2 server. Note that if you
+                    want to enable dual channel invocation you need to set the separateListener
+                    attribute to true on the enableAddressing element of the endpoint.
+                </p>
+                <p>
+                    Execute the stock quote client in the dual channel mode as follows:
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=dualquote</div>
+                <p>
+                    In the above example, the request received is forwarded to the sample service
+                    hosted on Axis2 and the endpoint specifies to enable addressing and do the
+                    invocation in dual channel mode. If you observe the message flow using TCPmon,
+                    you will see that on the channel you send the request to Synapse, the response has 
+                    been written as HTTP 202 Accepted, where as the real response from Synapse
+                    comes over a different channel which cannot be obsesrved unless you use tcpdump
+                    to dump all the TCP level messages.
+                </p>
+                <p>
+                    At the same time you can observe the behaviour of the invocation between Synapse
+                    and the actual Axis2 service, where you can see a 202 Accepted message being
+                    delivered to Synapse as the response to the request. The actual response will be
+                    delivered to Synapse over a different channel.
+                </p>                
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample156.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample156.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample156.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample156.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 156</title>
+    </properties>
+    <body>
+        <section name="Sample 156: Service Integration with Specifying the Receiving Sequence">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+    &lt;localEntry key=&quot;sec_policy&quot; src=&quot;file:repository/conf/sample/resources/policy/policy_3.xml&quot;/&gt;
+    &lt;proxy name=&quot;StockQuoteProxy&quot;&gt;
+        &lt;target&gt;
+            &lt;inSequence&gt;
+                &lt;enrich&gt;
+                    &lt;source type=&quot;body&quot;/&gt;
+                    &lt;target type=&quot;property&quot; property=&quot;REQUEST&quot;/&gt;
+                &lt;/enrich&gt;
+
+                &lt;send receive=&quot;SimpleServiceSeq&quot;&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;/inSequence&gt;
+            &lt;outSequence&gt;
+                &lt;drop/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+    &lt;/proxy&gt;
+
+    &lt;sequence name=&quot;SimpleServiceSeq&quot;&gt;
+        &lt;property name=&quot;SECURE_SER_AMT&quot; expression=&quot;//ns:getQuoteResponse/ns:return/ax21:last&quot;
+                  xmlns:ns=&quot;http://services.samples&quot; xmlns:ax21=&quot;http://services.samples/xsd&quot;/&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;SecureStockQuoteService-Amount&quot; expression=&quot;get-property(&#39;SECURE_SER_AMT&#39;)&quot;/&gt;
+        &lt;/log&gt;
+        &lt;enrich&gt;
+            &lt;source type=&quot;body&quot;/&gt;
+            &lt;target type=&quot;property&quot; property=&quot;SecureService_Res&quot;/&gt;
+        &lt;/enrich&gt;
+        &lt;enrich&gt;
+            &lt;source type=&quot;property&quot; property=&quot;REQUEST&quot;/&gt;
+            &lt;target type=&quot;body&quot;/&gt;
+        &lt;/enrich&gt;
+        &lt;send receive=&quot;ClientOutSeq&quot;&gt;
+            &lt;endpoint name=&quot;SimpleStockQuoteService&quot;&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;ClientOutSeq&quot;&gt;
+        &lt;property name=&quot;SIMPLE_SER_AMT&quot; expression=&quot;//ns:getQuoteResponse/ns:return/ax21:last&quot;
+                  xmlns:ns=&quot;http://services.samples&quot; xmlns:ax21=&quot;http://services.samples/xsd&quot;/&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;SimpleStockQuoteService-Amount&quot; expression=&quot;get-property(&#39;SIMPLE_SER_AMT&#39;)&quot;/&gt;
+        &lt;/log&gt;
+        &lt;enrich&gt;
+            &lt;source type=&quot;body&quot;/&gt;
+            &lt;target type=&quot;property&quot; property=&quot;SimpleService_Res&quot;/&gt;
+        &lt;/enrich&gt;
+
+        &lt;filter xpath=&quot;fn:number(get-property(&#39;SIMPLE_SER_AMT&#39;)) &gt; fn:number(get-property(&#39;SECURE_SER_AMT&#39;))&quot;&gt;
+            &lt;then&gt;
+                &lt;log&gt;
+                    &lt;property name=&quot;StockQuote&quot; value=&quot;SecureStockQuoteService&quot;/&gt;
+                &lt;/log&gt;
+                &lt;enrich&gt;
+                    &lt;source type=&quot;property&quot; property=&quot;SecureService_Res&quot;/&gt;
+                    &lt;target type=&quot;body&quot;/&gt;
+                &lt;/enrich&gt;
+            &lt;/then&gt;
+            &lt;else&gt;
+                &lt;log&gt;
+                    &lt;property name=&quot;StockQuote&quot; value=&quot;SimpleStockQuoteService&quot;/&gt;
+                &lt;/log&gt;
+            &lt;/else&gt;
+        &lt;/filter&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Synapse is capable of mediating requests among multiple services and managing
+                    complex message flows thereby acting as a lightweight orchestration engine. This
+                    sample demonstrates how to easily integrate multiple services with Synapse using
+                    the 'receiving sequence' feature of Synapse.
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server
+                        </li>
+                        <li>
+                            Deploy the SecureStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 156 (repository/conf/sample/synapse_sample_156.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 156<br/>
+                                Windows: synapse.bat -sample 156
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    This sample includes a proxy service which first forwards the client request to
+                    the SecureStockQuoteService. Once a response has been received from this service,
+                    Synapse will turn around and invoke the SimpleStockQuoteService. To do this proxy
+                    service must hold on to the original request in memory. This is done using an
+                    enrich mediator. Once Synapse has received a response from the SimpleStockQuoteService
+                    it will compare the two responses received from the two services and select the
+                    one with the lower stock quote value. This response will be then sent to the
+                    client.
+                </p>
+                <p>
+                    The important feature to note here is the 'receive' attribute set on the 'send'
+                    mediators. This tells Synapse that responses of those send operations should be
+                    directed to the sequences referred by the 'receive' attribute. Therefore the
+                    response from the SecureStockQuoteService is directed to the sequence named
+                    'SimpleServiceSeq'. Similarly the response from the SimpleStockQuoteService will
+                    be handled by the sequence named 'ClientOutSeq'.
+                </p>
+                <p>
+                    To try this out, execute the stock quote client as follows:
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy</div>
+                <p>
+                    You can confirm that Synapse invokes both services by going through the console
+                    output of the Axis2 server. However Axis2 client will receive only one response
+                    back. As far as  the client is concerned, only one HTTP transaction is taking place.
+                    But Synapse does multiple service invocations with the back-end to make the whole
+                    integration scenario tick.
+                </p>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample157.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample157.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample157.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample157.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 157</title>
+    </properties>
+    <body>
+        <section name="Sample 157: Conditional Router Mediator for Implementing Complex Routing Scenarios">
+            <div class="xmlConf">&lt;definitions xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+    &lt;proxy name=&quot;StockQuoteProxy&quot; transports=&quot;https http&quot; startOnLoad=&quot;true&quot; trace=&quot;disable&quot;&gt;
+        &lt;target&gt;
+            &lt;inSequence&gt;
+                &lt;conditionalRouter continueAfter=&quot;false&quot;&gt;
+                    &lt;conditionalRoute breakRoute=&quot;false&quot;&gt;
+                        &lt;condition&gt;
+                            &lt;match xmlns=&quot;&quot; type=&quot;header&quot; source=&quot;foo&quot; regex=&quot;bar.*&quot;/&gt;
+                        &lt;/condition&gt;
+                        &lt;target sequence=&quot;cnd1_seq&quot;/&gt;
+                    &lt;/conditionalRoute&gt;
+
+                    &lt;conditionalRoute breakRoute=&quot;false&quot;&gt;
+                        &lt;condition&gt;
+                            &lt;and xmlns=&quot;&quot;&gt;
+                                &lt;match type=&quot;header&quot; source=&quot;my_custom_header1&quot; regex=&quot;foo.*&quot;/&gt;
+                                &lt;match type=&quot;url&quot; regex=&quot;/services/StockQuoteProxy.*&quot;/&gt;
+                            &lt;/and&gt;
+                        &lt;/condition&gt;
+                        &lt;target sequence=&quot;cnd2_seq&quot;/&gt;
+                    &lt;/conditionalRoute&gt;
+
+                    &lt;conditionalRoute breakRoute=&quot;false&quot;&gt;
+                        &lt;condition&gt;
+                            &lt;and xmlns=&quot;&quot;&gt;
+                                &lt;match type=&quot;header&quot; source=&quot;my_custom_header2&quot; regex=&quot;bar.*&quot;/&gt;
+                                &lt;equal type=&quot;param&quot; source=&quot;qparam1&quot; value=&quot;qpv_foo&quot;/&gt;
+                                &lt;or&gt;
+                                    &lt;match type=&quot;url&quot; regex=&quot;/services/StockQuoteProxy.*&quot;/&gt;
+                                    &lt;match type=&quot;header&quot; source=&quot;my_custom_header3&quot; regex=&quot;foo.*&quot;/&gt;
+                                &lt;/or&gt;
+                                &lt;not&gt;
+                                    &lt;equal type=&quot;param&quot; source=&quot;qparam2&quot; value=&quot;qpv_bar&quot;/&gt;
+                                &lt;/not&gt;
+                            &lt;/and&gt;
+                        &lt;/condition&gt;
+                        &lt;target sequence=&quot;cnd3_seq&quot;/&gt;
+                    &lt;/conditionalRoute&gt;
+                &lt;/conditionalRouter&gt;
+            &lt;/inSequence&gt;
+            &lt;outSequence&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+    &lt;/proxy&gt;
+
+    &lt;sequence name=&quot;cnd1_seq&quot;&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;MSG_FLOW&quot; value=&quot;Condition (I) Satisfied&quot;/&gt;
+        &lt;/log&gt;
+        &lt;sequence key=&quot;send_seq&quot;/&gt;
+    &lt;/sequence&gt;
+    &lt;sequence name=&quot;cnd2_seq&quot;&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;MSG_FLOW&quot; value=&quot;Condition (II) Satisfied&quot;/&gt;
+        &lt;/log&gt;
+        &lt;sequence key=&quot;send_seq&quot;/&gt;
+    &lt;/sequence&gt;
+    &lt;sequence name=&quot;cnd3_seq&quot;&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;MSG_FLOW&quot; value=&quot;Condition (III) Satisfied&quot;/&gt;
+        &lt;/log&gt;
+        &lt;sequence key=&quot;send_seq&quot;/&gt;
+    &lt;/sequence&gt;
+
+    &lt;sequence name=&quot;send_seq&quot;&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;DEBUG&quot; value=&quot;Condition Satisfied&quot;/&gt;
+        &lt;/log&gt;
+        &lt;send&gt;
+            &lt;endpoint name=&quot;simple&quot;&gt;
+                &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
+            &lt;/endpoint&gt;
+        &lt;/send&gt;
+    &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Conditional router mediator can be used to implement complex routing rules in
+                    Synapse. It can route messages to various endpoints based on URLs, query parameters
+                    and transport headers. This sample demonstrates how to use the conditional router
+                    mediator within a proxy service to build a smart routing proxy.
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server a d start
+                            Axis2 server.
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 157 (repository/conf/sample/synapse_sample_157.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 157<br/>
+                                Windows: synapse.bat -sample 157
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    We will be using 'curl' as the client in this scenario. <a href="http://curl.haxx.se/">Curl</a>
+                    is a neat little command line tool that can be used to generate various types
+                    of HTTP requests (among other things).
+                </p>
+                <p>
+                    First create a sample input file named stockQuoteReq.xml with the following
+                    content.
+                </p>
+                <div class="xmlConf">&lt;soap:Envelope xmlns:soap=&quot;http://www.w3.org/2003/05/soap-envelope&quot; xmlns:ser=&quot;http://services.samples&quot; xmlns:xsd=&quot;http://services.samples/xsd&quot;&gt;
+   &lt;soap:Header/&gt;
+   &lt;soap:Body&gt;
+      &lt;ser:getQuote&gt;
+         &lt;ser:request&gt;
+            &lt;xsd:symbol&gt;IBM&lt;/xsd:symbol&gt;
+         &lt;/ser:request&gt;
+      &lt;/ser:getQuote&gt;
+   &lt;/soap:Body&gt;
+&lt;/soap:Envelope&gt;</div>
+                <p>
+                    Invoke curl as follows to see header based routing feature in action.
+                </p>
+                <div class="command">curl -d @stockQuoteReq.xml -H "Content-Type: application/soap+xml;charset=UTF-8" -H "foo:bar" "http://localhost:8280/services/StockQuoteProxy"</div>
+                <p>
+                    This sends a HTTP request with a custom header named 'foo'. Proxy service will
+                    detect this header and print a custom log message confirming the receipt of the
+                    request.
+                </p>
+                <p>
+                    Now invoke curl as follows to test a combination header and URL based routing.
+                </p>
+                <div class="command">curl -d @stockQuoteReq.xml -H "Content-Type: application/soap+xml;charset=UTF-8" -H "my_custom_header1:foo1" "http://localhost:8280/services/StockQuoteProxy"</div>
+                <p>
+                    Finally invoke curl as follows to test routing based on complex conditions.
+                </p>
+                <div class="command">curl -d @stockQuoteReq.xml -H "Content-Type: application/soap+xml;charset=UTF-8" -H "my_custom_header2:bar" -H "my_custom_header3:foo" "http://localhost:8280/services/StockQuoteProxy?qparam1=qpv_foo&amp;qparam2=qpv_foo2"</div>
+                <p>
+                    In each case Synapse will log a different log entry because the conditional router
+                    mediator uses different sequences to process the three messages.
+                </p>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>
+    </body>
+</document>
\ No newline at end of file

Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample158.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 158</title>
+    </properties>
+    <body>
+        <section name="Sample 156: Exposing a SOAP service over JSON">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="JSONProxy" transports="http https"&gt;
+        &lt;target&gt;
+            &lt;endpoint&gt;
+                &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&gt;
+            &lt;/endpoint&gt;
+            &lt;inSequence&gt;
+                &lt;log level="full"/&gt;
+                &lt;xslt key="in_transform"/&gt;
+                &lt;property name="messageType" scope="axis2" value="text/xml"/&gt;
+            &lt;/inSequence&gt;
+            &lt;outSequence&gt;
+                &lt;log level="full"/&gt;
+                &lt;xslt key="out_transform"/&gt;
+                &lt;property name="messageType" scope="axis2" value="application/json"/&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+    &lt;/proxy&gt;
+
+    &lt;localEntry key="in_transform"&gt;
+        &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                        xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+                        xmlns:m0="http://services.samples" version="2.0" exclude-result-prefixes="m0 fn"&gt;
+            &lt;xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/&gt;
+            &lt;xsl:template match="*"&gt;
+                &lt;xsl:element name="{local-name()}" namespace="http://services.samples"&gt;
+                    &lt;xsl:copy-of select="attribute::*"/&gt;
+                    &lt;xsl:apply-templates/&gt;
+                &lt;/xsl:element&gt;
+            &lt;/xsl:template&gt;
+        &lt;/xsl:stylesheet&gt;
+    &lt;/localEntry&gt;
+
+    &lt;localEntry key="out_transform"&gt;
+        &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
+            &lt;xsl:output method="xml" version="1.0" encoding="UTF-8"/&gt;
+            &lt;xsl:template match="*"&gt;
+                &lt;xsl:element name="{local-name()}"&gt;
+                    &lt;xsl:apply-templates/&gt;
+                &lt;/xsl:element&gt;
+            &lt;/xsl:template&gt;
+        &lt;/xsl:stylesheet&gt;
+    &lt;/localEntry&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+ 					Demonstrate the ability to switch between JSON and XML/SOAP content interchange formats
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Setup Synapse and the sample Axis2 client for JSON  (Refer  Synapse <a href="setup/script.html#json">Samples Setup Guide</a> for details)
+                        </li>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 158 (repository/conf/sample/synapse_sample_158.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 158<br/>
+                                Windows: synapse.bat -sample 158
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <div class="command">ant jsonclient -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/services/JSONProxy</div>
+ 				<p>JSON client will send a stockquote request to Synapse using the
+					JSON content interchange format. Synapse will trnasform it into a SOAP
+					request and forward to the Axis2 server. The SOAP response from the
+					Axis2 server will be converted into a JSON message and sent back to the
+					JSON client.</p>
+				<p>You may use a tool like TCPMon to monitor the JSON requests sent
+						over the wire. A sample JSON request and response is shown below:</p>
+
+                <div class="consoleOutput">{"getQuote":{"request":{"symbol":"IBM"}}}</div>
+
+                <div class="consoleOutput">{"getQuoteResponse":{"return":{"change":3.853593376681722,"earnings":12.802850763714854,"high":67.92488310190126,"last":66.14619264746406,"lastTradeTimestamp":"Mon Aug 23 16:48:40 IST 2010","low":-66.04000424423522,"marketCap":-9334516.42324327,"name":"IBM Company","open":-64.61950137150009,"peRatio":-19.78600441437058,"percentageChange":5.411779328273005,"prevClose":71.2075112994578,"symbol":"IBM","volume":16842}}}</div>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file