Author: hiranya
Date: Sat Nov 27 19:19:54 2010
New Revision: 1039730
URL: http://svn.apache.org/viewvc?rev=1039730&view=rev
Log:
Sample 0, 1
Added:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample0.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample1.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/template.xml
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml?rev=1039730&r1=1039729&r2=1039730&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
(original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
Sat Nov 27 19:19:54 2010
@@ -37,8 +37,8 @@
<subsection name="Message Mediation">
<p>
<ul>
- <li><a href="">Sample 0: Introduction to
Synapse</a></li>
- <li><a href="">Sample 1: Simple content based routing
(CBR) of messages</a></li>
+ <li><a href="samples/sample0.html">Sample 0:
Introduction to Synapse</a></li>
+ <li><a href="samples/sample1.html">Sample 1: Simple
content based routing (CBR) of messages</a></li>
<li><a href="">Sample 2: CBR with the Switch-case
mediator, using message properties</a></li>
<li><a href="">Sample 3: Local Registry entry
definitions, reusable endpoints and sequences</a></li>
<li><a href="">Sample 4: Introduction to error
handling</a></li>
Added:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample0.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample0.xml?rev=1039730&view=auto
==============================================================================
---
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample0.xml
(added)
+++
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample0.xml
Sat Nov 27 19:19:54 2010
@@ -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 0</title>
+ </properties>
+ <body>
+ <section name="Sample 0: Introduction to Synapse">
+ <div class="xmlConf"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+
+ <sequence name="main">
+ <!-- log all attributes of messages passing through -->
+ <log level="full"/>
+
+ <!-- Send the message to implicit destination -->
+ <send/>
+ <sequence/>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Introduction to Synapse - Shows how Synape can be
configured to log and pass
+ messages through.
+ </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 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">
+ <h4>Smart Client Mode</h4>
+ <p>
+ Execute the client in the smart client mode using the
following command.
+ </p>
+ <div class="command">ant stockquote
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/</div>
+ <p>
+ By tracing the execution of Synapse with the log output
level set to DEBUG,
+ you will see that the client request is arriving at
Synapse with a WS-Addressing 'To'
+ header set to EPR
http://localhost:9000/services/SimpleStockQuoteService. The
+ Synapse engine logs the message at the 'full' log level
(i.e. all the
+ message headers and the body) and then sends it to its
explicit 'To'
+ address which is
http://localhost:9000/services/SimpleStockQuoteService.
+ You will see a log entry in the Axis2 server console
confirming that the message
+ got routed to the sample server and the service hosted at
the server generated
+ a stock quote for the requested symbol.
+ </p>
+ <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006
SimpleStockQuoteService :: Generating quote for : IBM</div>
+ <p>
+ The response message generated by the service is received
by Synapse,
+ and flows through the same mediation rules, which log the
response and
+ send back to the client. On the client console you should
see an output
+ similar to the following based on the message received by
the client.
+ </p>
+ <div class="consoleOutput">Standard :: Stock price =
$95.26454380258552</div>
+
+ <h4>Proxy Client Mode</h4>
+ <p>
+ Execute the sample Axis2 client as follows to run it in
the proxy mode.
+ </p>
+ <div class="command">ant stockquote
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
-Dprxurl=http://localhost:8280/</div>
+ <p>
+ You will see the exact same behaviour as per the previous
example when you run
+ this scenario. However this time the client sends the
message to the Axis2 server
+ using Synapse as a HTTP proxy.
+ </p>
+ <p>
+ The Axis2 client supports another mode of operation known
as the 'dumb client
+ mode'. This will be addressed in <a
href="sample1.html">sample 1</a>.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample1.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample1.xml?rev=1039730&view=auto
==============================================================================
---
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample1.xml
(added)
+++
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample1.xml
Sat Nov 27 19:19:54 2010
@@ -0,0 +1,96 @@
+<?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 1</title>
+ </properties>
+ <body>
+ <section name="Sample 1: Simple Content Based Routing (CBR) of
Messages">
+ <div class="xmlConf"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+
+ <sequence name="main">
+ <!-- filtering of messages with XPath and regex matches -->
+ <filter source="get-property('To')" regex=".*/StockQuote.*">
+ <then>
+ <send>
+ <endpoint>
+ <address
uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ <drop/>
+ </then>
+ </filter>
+ <send/>
+ </sequence>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Introduction to simple content based routing - Shows how a
message could be
+ made to pass through Synapse using the dumb client mode,
where Synapse acts as
+ a gateway to accept all messages and then perform
mediation and routing based
+ on message properties or content.
+ </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 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>Execute the sample client in the dumb client mode using the
following command.</p>
+ <div class="command">ant stockquote
-Dtrpurl=http://localhost:8280/services/StockQuote</div>
+
+ <p>
+ This time you will see Synapse receiving a message for
which Synapse was set
+ as the ultimate receiver. The filter mediator in the main
sequence performs
+ a regular expression match on the 'To' header
(http://localhost:8280/services/StockQuote)
+ to check whether it matches the expression
".*/StockQuote.*". Since the 'To' header
+ matches this expression the child mediators of the filter
mediator get executed.
+ As a result, the message is sent to the Axis2 server. The
drop mediator after
+ the send mediator terminates the flow of the sequence.
Axis2 server will print
+ the following log when it receives the stock quote request
from Synapse.
+ </p>
+ <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006
SimpleStockQuoteService :: Generating quote for : IBM</div>
+ <p>
+ During response processing, the filter condition fails,
and thus the child mediators
+ of the filter are skipped. The 'send' mediator at the end
of the sequence
+ forwards the response back to the client using the
implicit 'To' address.
+ The client will print a message similar to the following
when it receives the
+ response.
+ </p>
+ <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/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/template.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/template.xml?rev=1039730&view=auto
==============================================================================
---
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/template.xml
(added)
+++
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/template.xml
Sat Nov 27 19:19:54 2010
@@ -0,0 +1,61 @@
+<?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 X</title>
+ </properties>
+ <body>
+ <section name="Sample X: ">
+ <div class="xmlConf">
+
+ </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 X
(repository/conf/sample/synapse_sample_X.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample X<br/>
+ Windows: synapse.bat -sample X
+ </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