You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by hi...@apache.org on 2011/12/22 17:16:05 UTC

svn commit: r1222320 [6/13] - in /synapse/branches/2.1/src: ./ site/ site/resources/ site/resources/css/ site/resources/images/ site/xdoc/ site/xdoc/userguide/ site/xdoc/userguide/samples/ site/xdoc/userguide/samples/setup/

Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample152.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample152.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample152.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample152.xml Thu Dec 22 16:16:02 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/src/site/xdoc/userguide/samples/sample153.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample153.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample153.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample153.xml Thu Dec 22 16:16:02 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/src/site/xdoc/userguide/samples/sample154.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample154.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample154.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample154.xml Thu Dec 22 16:16:02 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/src/site/xdoc/userguide/samples/sample155.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample155.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample155.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample155.xml Thu Dec 22 16:16:02 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/src/site/xdoc/userguide/samples/sample156.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample156.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample156.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample156.xml Thu Dec 22 16:16:02 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/src/site/xdoc/userguide/samples/sample157.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample157.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample157.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample157.xml Thu Dec 22 16:16:02 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/src/site/xdoc/userguide/samples/sample158.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample158.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample158.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample158.xml Thu Dec 22 16:16:02 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

Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample2.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample2.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample2.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample2.xml Thu Dec 22 16:16:02 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 2</title>
+    </properties>
+    <body>
+        <section name="Sample 2: CBR with Switch Case Mediator">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;sequence name="main"&gt;
+        &lt;switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="http://services.samples"&gt;
+            &lt;case regex="IBM"&gt;
+                &lt;!-- the property mediator sets a local property on the *current* message --&gt;
+                &lt;property name="symbol" value="Great stock - IBM"/&gt;
+            &lt;/case&gt;
+            &lt;case regex="MSFT"&gt;
+                &lt;property name="symbol" value="Are you sure? - MSFT"/&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="symbol" expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)"/&gt;
+            &lt;/default&gt;
+        &lt;/switch&gt;
+        &lt;log level="custom"&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="symbol" expression="get-property('symbol')"/&gt;
+            &lt;!-- the get-property() function supports the implicit message headers To/From/Action/FaultTo/ReplyTo --&gt;
+            &lt;property name="epr" expression="get-property('To')"/&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;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Introduction to the switch-case mediator and manipulating properties set on the
+                    messages.
+                </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 2 (repository/conf/sample/synapse_sample_2.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 2<br/>
+                                Windows: synapse.bat -sample 2
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the sample Axis2 client in the smart client using different symbols
+                    such as IBM, MSFT and SUN.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</div>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=MSFT</div>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=SUN</div>
+
+                <p>
+                    When the symbol IBM is requested, viewing the mediation logs you will see that
+                    the switch mediator's first case for 'IBM' is executed and a local property named
+                    'symbol' is set to 'Great stock - IBM'. Subsequently this local property value
+                    is looked up by the log mediator and logged using the 'get-property()' XPath
+                    extension function.
+                </p>
+                <div class="consoleOutput">INFO LogMediator - symbol = Great stock - IBM, epr = http://localhost:9000/axis2/services/SimpleStockQuoteService</div>
+
+                <p>
+                    Similarly for the symbol 'MSFT' the second case statement in the switch mediator
+                    will be executed which will result in the following log.
+                </p>
+                <div class="consoleOutput">INFO LogMediator - symbol = Are you sure? - MSFT, epr = http://localhost:9000/axis2/services/SimpleStockQuoteService</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/src/site/xdoc/userguide/samples/sample200.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample200.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample200.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample200.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,102 @@
+<?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 200</title>
+    </properties>
+    <body>
+        <section name="Sample 200: Engaging WS-Security on Proxy Services">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;localEntry key="sec_policy" src="file:repository/conf/sample/resources/policy/policy_3.xml"/&gt;
+
+    &lt;proxy name="StockQuoteProxy"&gt;
+        &lt;target&gt;
+            &lt;inSequence&gt;
+                &lt;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&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;enableSec/&gt;
+        &lt;policy key="sec_policy"/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrates how to secure a proxy service using WS-Security and WS-Policy
+                    standards
+                </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 SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 200 (repository/conf/sample/synapse_sample_200.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 200<br/>
+                                Windows: synapse.bat -sample 200
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    The proxy service expects to receive a signed and encrypted message as specified
+                    by the security policy. Please see Apache Rampart and Axis2 documentation on the
+                    format of the policy file. The element 'enableSec' specifies that Apache Rampart
+                    should be engaged on this proxy service. Hence if Rampart rejects any request
+                    messages that does not conform to the specified policy, those messages will
+                    never reach the 'inSequence' to be processed. 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 is 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 is attached to the provided base WSDL. When
+                    sending the message to the backend service, you can verify that the security
+                    headers are removed. The response received from Axis2 does not use WS-Security,
+                    but the response forwarded back to the client is signed and encrypted as 
+                    expected by the client.
+                </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/src/site/xdoc/userguide/samples/sample201.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample201.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample201.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample201.xml Thu Dec 22 16:16:02 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 201</title>
+    </properties>
+    <body>
+        <section name="Sample 201: Reliable Communication Between the Client and Proxy Services Using WS-ReliableMessaging">
+            <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;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&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;enableRM/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Show case how to engage WS-ReliableMessaging on proxy services so that the
+                    communication between client and the proxy service is reliable
+                </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 201 (repository/conf/sample/synapse_sample_201.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 201<br/>
+                                Windows: synapse.bat -sample 201
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    In the above configuration, a proxy service is created with WS-RM enabled using
+                    the &lt;enableRM/&gt; tag. Therefore, this proxy service is capable of
+                    communicating with a WS-RM client. It also removes the WS-RM headers in the
+                    inSequence before the message is sent to the backend server. This is required as
+                    the reliable messaging is applicable only between the client and Synapse. Now
+                    start the client with WS-RM as follows:
+                </p>
+                <div class="command">ant stockquote -Dsymbol=IBM -Dmode=quote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dwsrm=true</div>
+                <p>
+                    In this case, client sends a WS-RM enabled request to Synapse where Synapse sends
+                    normal requests to the server. This can be observed by examining the wire level
+                    messages between the client and Synapse. These messages would be similar to the
+                    wire level messages shown in <a href="sample101.html">sample 101</a>.
+                </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/src/site/xdoc/userguide/samples/sample202.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample202.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample202.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample202.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,78 @@
+<?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 202</title>
+    </properties>
+    <body>
+        <section name="Sample 202: ">
+            <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;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&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;enableRM/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+
+                </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 202 (repository/conf/sample/synapse_sample_202.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 202<br/>
+                                Windows: synapse.bat -sample 202
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
+
+                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
+
+                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</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/src/site/xdoc/userguide/samples/sample250.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample250.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample250.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample250.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,133 @@
+<?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 250</title>
+    </properties>
+    <body>
+        <section name="Sample 250:Introduction to Transport Switching - JMS to HTTP/S ">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="StockQuoteProxy" transports="jms"&gt;
+        &lt;target&gt;
+            &lt;inSequence&gt;
+                &lt;property action="set" name="OUT_ONLY" value="true"/&gt;
+            &lt;/inSequence&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;parameter name="transport.jms.ContentType"&gt;
+            &lt;rules&gt;
+                &lt;jmsProperty&gt;contentType&lt;/jmsProperty&gt;
+                &lt;default&gt;application/xml&lt;/default&gt;
+            &lt;/rules&gt;
+        &lt;/parameter&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Demonstrate the ability of Synapse to perform transport switching (i.e. receiving
+                    messages over one transport and forwarding them over a different transport)
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                        </li>
+                        <li>
+                            Setup and start a JMS broker (Apache ActiveMQ can be used as the
+                            JMS broker for this scenario. Refer <a href="setup/jms.html#pre">JMS setup guide</a>
+                            for information on how to run ActiveMQ.)
+                        </li>
+                        <li>
+                            Enable the JMS transport receiver of Synapse (Refer
+                            <a href="setup/jms.html#listener">JMS setup guide</a> for more details)
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 250 (repository/conf/sample/synapse_sample_250.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 250<br/>
+                                Windows: synapse.bat -sample 250
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    In this sample we are using a proxy service exposed over JMS (note the transports=jms
+                    attribute). If you check the WSDL of the proxy service using a web browser you
+                    will notice that it only has JMS endpoints.
+                </p>
+                <p>
+                    Run the sample JMS client by switching to the samples/axis2Client directory and
+                    executing the following command.
+                </p>
+                <div class="command">ant jmsclient -Djms_type=pox -Djms_dest=dynamicQueues/StockQuoteProxy -Djms_payload=MSFT</div>
+                <p>
+                    This will send a plain XML formatted place order request to a JMS queue named
+                    'StockQuoteProxy'. Synapse will be polling on this queue for any incoming messages
+                    so it will pick up the request. If you run Synapse in the DEBUG mode, following
+                    entry will be printed on the console.
+                </p>
+                <div class="consoleOutput">[JMSWorker-1] DEBUG ProxyServiceMessageReceiver -Proxy Service StockQuoteProxy received a new message...</div>
+                <p>
+                    Then Synapse will mediate the request through the service bus and forward it to
+                    the sample Axis2 server over HTTP. Axis2 server will print the following entry
+                    on the console when it receives the request.
+                </p>
+                <div class="consoleOutput">Accepted order for : 16517 stocks of MSFT at $ 169.14622538721846</div>
+                <p>
+                    Note that the operation is out-only and no response is sent back to the client. 
+                    The transport.jms.ContentType property is necessary to allow the JMS transport
+                    to determine the content type of incoming messages. With the given configuration
+                    it will first try to read the content type from the 'contentType' message property
+                    and fall back to 'application/xml' (i.e. POX) if this property is not set. Note
+                    that the JMS client used in this example doesn't send any content type
+                    information.
+                </p>
+                <p>
+                    It is also important to note that the name of the source JMS queue is same as the
+                    name of the proxy service (StockQuoteProxy). This is the default behavior of
+                    Synapse. Each proxy service by default listens on a JMS queue which has the same
+                    name as the service. It is possible to instruct a JMS proxy service to listen to
+                    an already existing destination without creating a new one. To do this, use the
+                    parameter elements on the proxy service definition to specify the destination
+                    and connection factory information. An example is given below.
+                </p>
+                <div class="xmlConf">&lt;parameter name=&quot;transport.jms.Destination&quot;&gt;dynamicTopics/something.TestTopic&lt;/parameter&gt;</div>
+                <p>
+                    With the above parameter in the proxy configuration, proxy service will listen
+                    on a JMS topic named 'something.TestTopic' for incoming requests.
+                </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/src/site/xdoc/userguide/samples/sample251.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample251.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample251.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample251.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,101 @@
+<?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 251</title>
+    </properties>
+    <body>
+        <section name="Sample 251: Switching from HTTP/S to JMS">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;proxy name="StockQuoteProxy" transports="http"&gt;
+        &lt;target&gt;
+            &lt;endpoint&gt;
+                &lt;address
+                        uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616&amp;transport.jms.DestinationType=queue"/&gt;
+            &lt;/endpoint&gt;
+            &lt;inSequence&gt;
+                &lt;property action="set" name="OUT_ONLY" value="true"/&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>
+                    This sample demonstrates receiving messages over HTTP/S and forwarding them to
+                    a JMS queue
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Setup and start a JMS broker (Apache ActiveMQ can be used as the
+                            JMS broker for this scenario. Refer <a href="setup/jms.html#pre">JMS setup guide</a>
+                            for information on how to run ActiveMQ.)
+                        </li>
+                        <li>
+                            Enable the JMS transport receiver of the sample Axis2 server (Refer
+                            <a href="setup/jms.html#server">JMS setup guide</a> for details)
+                        </li>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 (Since
+                            the JMS receiver is enabled, Axis2 will start polling on a JMS queue)
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 251 (repository/conf/sample/synapse_sample_251.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 251<br/>
+                                Windows: synapse.bat -sample 251
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    This Synapse configuration creates a proxy service over HTTP and forwards
+                    received messages to a JMS queue. To test this functionality, send a place order
+                    request to Synapse over HTTP as follows.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=placeorder -Dsymbol=MSFT</div>
+                <p>
+                    Note that the target endpoint of the proxy service points to a JMS queue in the
+                    ActiveMQ broker.
+                </p>
+                <div class="consoleOutput">jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=
+QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;
+java.naming.provider.url=tcp://localhost:61616</div>
+                <p>
+                    The sample Axis2 server will pick up the message from the JMS queue and print the
+                    following log entry.
+                </p>
+                <div class="consoleOutput">Accepted order for : 18406 stocks of MSFT at $ 83.58806051152119</div>
+            </subsection>
+        </section>
+        <p><a href="../samples.html">Back to Catalog</a></p>        
+    </body>
+</document>
\ No newline at end of file