You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by va...@apache.org on 2017/12/04 09:54:01 UTC
svn commit: r1817077 [19/34] - in /synapse/site/3_0_1: ./ css/ dev/ fonts/
images/ images/logos/ images/profiles/ img/ js/ userguide/
userguide/samples/ userguide/samples/setup/ userguide/transports/
Added: synapse/site/3_0_1/userguide/samples/sample381.html
URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample381.html?rev=1817077&view=auto
==============================================================================
--- synapse/site/3_0_1/userguide/samples/sample381.html (added)
+++ synapse/site/3_0_1/userguide/samples/sample381.html Mon Dec 4 09:53:57 2017
@@ -0,0 +1,239 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-04
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="Date-Revision-yyyymmdd" content="20171204" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Apache Synapse – Apache Synapse - Sample 381</title>
+ <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+ <link rel="stylesheet" href="../../css/site.css" />
+ <link rel="stylesheet" href="../../css/print.css" media="print" />
+ <script type="text/javascript" src="../../js/apache-maven-fluido-1.6.min.js"></script>
+ </head>
+ <body class="topBarDisabled">
+ <div class="container-fluid">
+ <div id="banner">
+ <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+ <div class="pull-right"></div>
+ <div class="clear"><hr/></div>
+ </div>
+
+ <div id="breadcrumbs">
+ <ul class="breadcrumb">
+ <li id="publishDate">Last Published: 2017-12-04<span class="divider">|</span>
+</li>
+ <li id="projectVersion">Version: 3.0.1</li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <div id="leftColumn" class="span2">
+ <div class="well sidebar-nav">
+<ul class="nav nav-list">
+ <li class="nav-header">Main Menu</li>
+ <li><a href="../../index.html" title="Home"><span class="none"></span>Home</a> </li>
+ <li><a href="../../download.html" title="Download"><span class="none"></span>Download</a> </li>
+ <li><a href="../../history.html" title="History"><span class="none"></span>History</a> </li>
+ <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li>
+ <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li>
+ <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li>
+ <li class="nav-header">Documentation</li>
+ <li><a href="../../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li>
+ <li><a href="../../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li>
+ <li><a href="../../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li>
+ <li><a href="../../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li>
+ <li><a href="../../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li>
+ <li><a href="../../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li>
+ <li><a href="../../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li>
+ <li><a href="../../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li>
+ <li><a href="../../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li>
+ <li><a href="../../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li>
+ <li><a href="../../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li>
+ <li><a href="../../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li>
+ <li><a href="../../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li>
+ <li><a href="../../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li>
+ <li><a href="../../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li>
+ <li class="nav-header">Developer Resources</li>
+ <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li>
+ <li><a href="../../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li>
+ <li><a href="../../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li>
+ <li class="nav-header">Project Details</li>
+ <li><a href="../../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li>
+ <li><a href="../../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li>
+ <li><a href="../../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li>
+ <li><a href="../../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li>
+ <li><a href="../../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li>
+ <li><a href="../../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li>
+ </ul>
+ <hr />
+ <div id="poweredBy">
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
+ </div>
+ </div>
+ </div>
+ <div id="bodyColumn" class="span10" >
+
+
+ <div class="section">
+<h2><a name="Sample_381:_Class_Mediator_for_CBR_of_Binary_Messages"></a>Sample 381: Class Mediator for CBR of Binary Messages</h2>
+
+<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="JMSBinaryProxy" transports="jms">
+ <target inSequence="BINARY_CBR_SEQ"/>
+ </proxy>
+
+ <sequence name="BINARY_CBR_SEQ">
+ <in>
+ <log level="full"/>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ <class name="samples.mediators.BinaryExtractMediator">
+ <property name="offset" value="11"/>
+ <property name="length" value="4"/>
+ <property name="variableName" value="symbol"/>
+ <property name="binaryEncoding" value="utf-8"/>
+ </class>
+ <log level="custom">
+ <property name="symbol" expression="get-property('symbol')"/>
+ </log>
+ <switch source="get-property('symbol')">
+ <case regex="GOOG">
+ <send>
+ <endpoint>
+ <address
+ uri="jms:/dynamicTopics/mdd.GOOG?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=topic"/>
+ </endpoint>
+ </send>
+ </case>
+ <case regex="MSFT">
+ <send>
+ <endpoint>
+ <address
+ uri="jms:/dynamicTopics/mdd.MSFT?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=topic"/>
+ </endpoint>
+ </send>
+ </case>
+ <default/>
+ </switch>
+ </in>
+ </sequence>
+
+</definitions></div>
+
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+
+<p>
+ Demonstrate an advanced content based routing (CBR) scenario using a custom mediator
+ </p>
+ </div>
+
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+
+<p>
+ </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#intro">JMS setup guide</a> for information on
+ how to run ActiveMQ.)
+ </li>
+
+<li>
+ Enable the JMS transport receiver and sender of Synapse (Refer JMS setup
+ guide for more details)
+ </li>
+
+<li>
+ Start Synapse using the configuration numbered 381 (repository/conf/sample/synapse_sample_381.xml)
+
+<div class="command">
+ Unix/Linux: sh synapse.sh -sample 381<br />
+ Windows: synapse.bat -sample 381
+ </div>
+ </li>
+ </ul>
+
+ </div>
+
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+
+<p>
+ In this configuration, a proxy service has been defined to accept incoming JMS
+ messages. JMS messages contain binary payloads. User configures the offset, length,
+ and binary encoding of the text literal that Synapse should use for CBR. Configuration
+ simply routes the messages based on this text to different endpoints.
+ </p>
+
+<p>
+ A JMS producer and two instances of a consumer used to demonstrate the CBR functionality.
+ </p>
+
+<p>
+ Now run the first consumer using the following command.
+ </p>
+
+<div class="command">ant mddconsumer -Djms_topic=mdd.MSFT</div>
+
+<p>
+ Now run the second consumer using the following command.
+ </p>
+
+<div class="command">ant mddconsumer -Djms_topic=mdd.GOOG</div>
+
+<p>
+ Now run the market data producer to genenrate market data for symbol 'MSFT' using
+ the following command.
+ </p>
+
+<div class="command">ant mddproducer -Dsymbol=MSFT</div>
+
+<p>
+ Now run the market data producer to genenrate market data for symbol 'GOOG' using
+ the following command.
+ </p>
+
+<div class="command">ant mddproducer -Dsymbol=GOOG</div>
+
+<p>
+ You will see the below output in the client console(s) based on the symbol.
+ </p>
+
+<div class="consoleOutput">mddconsumer:
+ [java] Market data recived for symbol : topic://mdd.MSFT
+ [java] Market data recived for symbol : topic://mdd.MSFT</div>
+ </div>
+ </div>
+
+<p><a href="../samples.html">Back to Catalog</a></p>
+
+
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <footer>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <p>Copyright ©2005–2017
+<a href="http://www.apache.org/">Apache Software Foundation</a>.
+All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html>
Added: synapse/site/3_0_1/userguide/samples/sample390.html
URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample390.html?rev=1817077&view=auto
==============================================================================
--- synapse/site/3_0_1/userguide/samples/sample390.html (added)
+++ synapse/site/3_0_1/userguide/samples/sample390.html Mon Dec 4 09:53:57 2017
@@ -0,0 +1,209 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-04
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="Date-Revision-yyyymmdd" content="20171204" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Apache Synapse – Apache Synapse - Sample 390</title>
+ <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+ <link rel="stylesheet" href="../../css/site.css" />
+ <link rel="stylesheet" href="../../css/print.css" media="print" />
+ <script type="text/javascript" src="../../js/apache-maven-fluido-1.6.min.js"></script>
+ </head>
+ <body class="topBarDisabled">
+ <div class="container-fluid">
+ <div id="banner">
+ <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+ <div class="pull-right"></div>
+ <div class="clear"><hr/></div>
+ </div>
+
+ <div id="breadcrumbs">
+ <ul class="breadcrumb">
+ <li id="publishDate">Last Published: 2017-12-04<span class="divider">|</span>
+</li>
+ <li id="projectVersion">Version: 3.0.1</li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <div id="leftColumn" class="span2">
+ <div class="well sidebar-nav">
+<ul class="nav nav-list">
+ <li class="nav-header">Main Menu</li>
+ <li><a href="../../index.html" title="Home"><span class="none"></span>Home</a> </li>
+ <li><a href="../../download.html" title="Download"><span class="none"></span>Download</a> </li>
+ <li><a href="../../history.html" title="History"><span class="none"></span>History</a> </li>
+ <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li>
+ <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li>
+ <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li>
+ <li class="nav-header">Documentation</li>
+ <li><a href="../../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li>
+ <li><a href="../../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li>
+ <li><a href="../../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li>
+ <li><a href="../../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li>
+ <li><a href="../../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li>
+ <li><a href="../../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li>
+ <li><a href="../../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li>
+ <li><a href="../../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li>
+ <li><a href="../../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li>
+ <li><a href="../../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li>
+ <li><a href="../../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li>
+ <li><a href="../../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li>
+ <li><a href="../../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li>
+ <li><a href="../../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li>
+ <li><a href="../../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li>
+ <li class="nav-header">Developer Resources</li>
+ <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li>
+ <li><a href="../../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li>
+ <li><a href="../../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li>
+ <li class="nav-header">Project Details</li>
+ <li><a href="../../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li>
+ <li><a href="../../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li>
+ <li><a href="../../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li>
+ <li><a href="../../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li>
+ <li><a href="../../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li>
+ <li><a href="../../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li>
+ </ul>
+ <hr />
+ <div id="poweredBy">
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
+ </div>
+ </div>
+ </div>
+ <div id="bodyColumn" class="span10" >
+
+
+ <div class="section">
+<h2><a name="Sample_390:_Introduction_to_the_XQuery_Mediator"></a>Sample 390: Introduction to the XQuery Mediator</h2>
+
+<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) -->
+ <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+ <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
+ <parameter name="root">file:repository/conf/sample/resources/</parameter>
+ <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
+ <parameter name="cachableDuration">15000</parameter>
+ </registry>
+
+ <localEntry key="xquery-key-req"
+ src="file:repository/conf/sample/resources/xquery/xquery_req.xq"/>
+
+ <proxy name="StockQuoteProxy">
+ <target>
+ <inSequence>
+ <property name="body" expression="$body/child::*[position()=1]"/>
+ <xquery key="xquery-key-req">
+ <variable name="payload" type="ELEMENT"/>
+ </xquery>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </inSequence>
+ <outSequence>
+ <out>
+ <xquery key="xquery/xquery_res.xq">
+ <variable name="payload" type="ELEMENT"/>
+ <variable xmlns:m0="http://services.samples"
+ name="code" type="STRING"
+ expression="self::node()//m0:return/m0:symbol/child::text()"/>
+ <variable xmlns:m0="http://services.samples"
+ name="price" type="DOUBLE"
+ expression="self::node()//m0:return/m0:last/child::text()"/>
+ </xquery>
+ <send/>
+ </out>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+
+</definitions></div>
+
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+
+<p>
+ Demonstrate how to use the XQuery mediator for message content transformations
+ </p>
+ </div>
+
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+
+<p>
+ </p>
+<ul>
+
+<li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+
+<li>
+ Start Synapse using the configuration numbered 390 (repository/conf/sample/synapse_sample_390.xml)
+
+<div class="command">
+ Unix/Linux: sh synapse.sh -sample 390<br />
+ Windows: synapse.bat -sample 390
+ </div>
+ </li>
+ </ul>
+
+ </div>
+
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+
+<p>
+ This example uses the XQuery mediator to perform transformations. This sample
+ behaves the same as <a href="sample8.html">sample 8</a> and the only difference
+ is that this sample uses XQuery instead of XSLT for transformation.
+ </p>
+
+<p>
+ Send a custom quote request to Synapse as follows.
+ </p>
+
+<div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=customquote</div>
+
+<p>
+ Request is transformed into a standard stock quote request by the XPery mediator.
+ The XQuery definition is loaded through a local entry. The response from Axis2
+ is transformed back to a custom quote response. In this case the XQuery definition
+ is loaded from the registry.
+ </p>
+ </div>
+ </div>
+
+<p><a href="../samples.html">Back to Catalog</a></p>
+
+
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <footer>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <p>Copyright ©2005–2017
+<a href="http://www.apache.org/">Apache Software Foundation</a>.
+All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html>
Added: synapse/site/3_0_1/userguide/samples/sample391.html
URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample391.html?rev=1817077&view=auto
==============================================================================
--- synapse/site/3_0_1/userguide/samples/sample391.html (added)
+++ synapse/site/3_0_1/userguide/samples/sample391.html Mon Dec 4 09:53:57 2017
@@ -0,0 +1,191 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-04
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="Date-Revision-yyyymmdd" content="20171204" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Apache Synapse – Apache Synapse - Sample 391</title>
+ <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+ <link rel="stylesheet" href="../../css/site.css" />
+ <link rel="stylesheet" href="../../css/print.css" media="print" />
+ <script type="text/javascript" src="../../js/apache-maven-fluido-1.6.min.js"></script>
+ </head>
+ <body class="topBarDisabled">
+ <div class="container-fluid">
+ <div id="banner">
+ <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+ <div class="pull-right"></div>
+ <div class="clear"><hr/></div>
+ </div>
+
+ <div id="breadcrumbs">
+ <ul class="breadcrumb">
+ <li id="publishDate">Last Published: 2017-12-04<span class="divider">|</span>
+</li>
+ <li id="projectVersion">Version: 3.0.1</li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <div id="leftColumn" class="span2">
+ <div class="well sidebar-nav">
+<ul class="nav nav-list">
+ <li class="nav-header">Main Menu</li>
+ <li><a href="../../index.html" title="Home"><span class="none"></span>Home</a> </li>
+ <li><a href="../../download.html" title="Download"><span class="none"></span>Download</a> </li>
+ <li><a href="../../history.html" title="History"><span class="none"></span>History</a> </li>
+ <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li>
+ <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li>
+ <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li>
+ <li class="nav-header">Documentation</li>
+ <li><a href="../../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li>
+ <li><a href="../../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li>
+ <li><a href="../../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li>
+ <li><a href="../../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li>
+ <li><a href="../../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li>
+ <li><a href="../../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li>
+ <li><a href="../../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li>
+ <li><a href="../../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li>
+ <li><a href="../../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li>
+ <li><a href="../../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li>
+ <li><a href="../../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li>
+ <li><a href="../../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li>
+ <li><a href="../../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li>
+ <li><a href="../../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li>
+ <li><a href="../../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li>
+ <li class="nav-header">Developer Resources</li>
+ <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li>
+ <li><a href="../../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li>
+ <li><a href="../../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li>
+ <li class="nav-header">Project Details</li>
+ <li><a href="../../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li>
+ <li><a href="../../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li>
+ <li><a href="../../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li>
+ <li><a href="../../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li>
+ <li><a href="../../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li>
+ <li><a href="../../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li>
+ </ul>
+ <hr />
+ <div id="poweredBy">
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
+ </div>
+ </div>
+ </div>
+ <div id="bodyColumn" class="span10" >
+
+
+ <div class="section">
+<h2><a name="Sample_391:_Using_External_XML_Documents_in_the_XQuery_Mediator"></a>Sample 391: Using External XML Documents in the XQuery Mediator</h2>
+
+<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) -->
+ <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+ <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
+ <parameter name="root">file:repository/conf/sample/resources/</parameter>
+ <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
+ <parameter name="cachableDuration">15000</parameter>
+ </registry>
+
+ <proxy name="StockQuoteProxy">
+ <target>
+ <inSequence>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </inSequence>
+ <outSequence>
+ <out>
+ <xquery key="xquery/xquery_commisson.xq">
+ <variable name="payload" type="ELEMENT"/>
+ <variable name="commission" type="ELEMENT" key="misc/commission.xml"/>
+ </xquery>
+ <send/>
+ </out>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+
+</definitions></div>
+
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+
+<p>
+ Demonstrate how to import external XML documents into the XQuery engine using
+ the XQuery mediator
+ </p>
+ </div>
+
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+
+<p>
+ </p>
+<ul>
+
+<li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+
+<li>
+ Start Synapse using the configuration numbered 391 (repository/conf/sample/synapse_sample_391.xml)
+
+<div class="command">
+ Unix/Linux: sh synapse.sh -sample 391<br />
+ Windows: synapse.bat -sample 391
+ </div>
+ </li>
+ </ul>
+
+ </div>
+
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+
+<p>
+ In this sample, data from commission.xml file is used inside XQuery. The stock
+ quote price from the response and commission from the commission.xml document
+ will be added and given as a new price value.
+ </p>
+
+<p>
+ Try out this sample by invoking the proxy service as follows.
+ </p>
+
+<div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy</div>
+ </div>
+ </div>
+
+<p><a href="../samples.html">Back to Catalog</a></p>
+
+
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <footer>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <p>Copyright ©2005–2017
+<a href="http://www.apache.org/">Apache Software Foundation</a>.
+All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html>
Added: synapse/site/3_0_1/userguide/samples/sample4.html
URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample4.html?rev=1817077&view=auto
==============================================================================
--- synapse/site/3_0_1/userguide/samples/sample4.html (added)
+++ synapse/site/3_0_1/userguide/samples/sample4.html Mon Dec 4 09:53:57 2017
@@ -0,0 +1,260 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-04
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="Date-Revision-yyyymmdd" content="20171204" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Apache Synapse – Apache Synapse - Sample 4</title>
+ <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+ <link rel="stylesheet" href="../../css/site.css" />
+ <link rel="stylesheet" href="../../css/print.css" media="print" />
+ <script type="text/javascript" src="../../js/apache-maven-fluido-1.6.min.js"></script>
+ </head>
+ <body class="topBarDisabled">
+ <div class="container-fluid">
+ <div id="banner">
+ <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+ <div class="pull-right"></div>
+ <div class="clear"><hr/></div>
+ </div>
+
+ <div id="breadcrumbs">
+ <ul class="breadcrumb">
+ <li id="publishDate">Last Published: 2017-12-04<span class="divider">|</span>
+</li>
+ <li id="projectVersion">Version: 3.0.1</li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <div id="leftColumn" class="span2">
+ <div class="well sidebar-nav">
+<ul class="nav nav-list">
+ <li class="nav-header">Main Menu</li>
+ <li><a href="../../index.html" title="Home"><span class="none"></span>Home</a> </li>
+ <li><a href="../../download.html" title="Download"><span class="none"></span>Download</a> </li>
+ <li><a href="../../history.html" title="History"><span class="none"></span>History</a> </li>
+ <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li>
+ <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li>
+ <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li>
+ <li class="nav-header">Documentation</li>
+ <li><a href="../../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li>
+ <li><a href="../../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li>
+ <li><a href="../../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li>
+ <li><a href="../../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li>
+ <li><a href="../../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li>
+ <li><a href="../../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li>
+ <li><a href="../../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li>
+ <li><a href="../../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li>
+ <li><a href="../../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li>
+ <li><a href="../../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li>
+ <li><a href="../../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li>
+ <li><a href="../../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li>
+ <li><a href="../../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li>
+ <li><a href="../../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li>
+ <li><a href="../../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li>
+ <li class="nav-header">Developer Resources</li>
+ <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li>
+ <li><a href="../../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li>
+ <li><a href="../../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li>
+ <li class="nav-header">Project Details</li>
+ <li><a href="../../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li>
+ <li><a href="../../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li>
+ <li><a href="../../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li>
+ <li><a href="../../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li>
+ <li><a href="../../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li>
+ <li><a href="../../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li>
+ </ul>
+ <hr />
+ <div id="poweredBy">
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
+ </div>
+ </div>
+ </div>
+ <div id="bodyColumn" class="span10" >
+
+
+ <div class="section">
+<h2><a name="Sample_4:_Introduction_to_Error_Handling"></a>Sample 4: Introduction to Error Handling</h2>
+
+<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <!-- the default fault handling sequence used by Synapse - named 'fault' -->
+ <sequence name="fault">
+ <log level="custom">
+ <property name="text" value="An unexpected error occured"/>
+ <property name="message" expression="get-property('ERROR_MESSAGE')"/>
+ </log>
+ <drop/>
+ </sequence>
+
+ <sequence name="sunErrorHandler">
+ <log level="custom">
+ <property name="text" value="An unexpected error occured for stock SUN"/>
+ <property name="message" expression="get-property('ERROR_MESSAGE')"/>
+ <!--<property name="detail" expression="get-property('ERROR_DETAIL')"/>-->
+ </log>
+ <drop/>
+ </sequence>
+
+ <sequence name="main">
+ <in>
+ <switch xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol">
+ <case regex="IBM">
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </case>
+ <case regex="MSFT">
+ <send>
+ <endpoint key="bogus"/>
+ </send>
+ </case>
+ <case regex="SUN">
+ <sequence key="sunSequence"/>
+ </case>
+ </switch>
+ <drop/>
+ </in>
+
+ <out>
+ <send/>
+ </out>
+ </sequence>
+
+ <sequence name="sunSequence" onError="sunErrorHandler">
+ <send>
+ <endpoint key="sunPort"/>
+ </send>
+ </sequence>
+
+</definitions></div>
+
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+
+<p>
+ Introduction to error handling with the 'fault' sequence
+ </p>
+ </div>
+
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+
+<p>
+ </p>
+<ul>
+
+<li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+
+<li>
+ Start Synapse using the configuration numbered 4 (repository/conf/sample/synapse_sample_4.xml)
+
+<div class="command">
+ Unix/Linux: sh synapse.sh -sample 4<br />
+ Windows: synapse.bat -sample 4
+ </div>
+ </li>
+ </ul>
+
+ </div>
+
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+
+<p>
+ First send a stock quote request from the sample client for the symbol 'IBM' as
+ follows.
+ </p>
+
+<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</div>
+
+<p>
+ The request will be routed to the Axis2 server and client will receive a response
+ as expected.
+ </p>
+
+<div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+
+<p>
+ Now send another stock quote request for the symbol 'MSFT' as follows.
+ </p>
+
+<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=MSFT</div>
+
+<p>
+ For MSFT requests Synapse is instructed to route the messages to an endpoint named
+ 'bogus', which does not exist. Synapse executes the specified error handler
+ sequence closest to the point where the error was encountered. In this case, the
+ currently executing sequence is 'main' and it does not specify an 'onError'
+ attribute. Whenever Synapse cannot find an error handler, it looks for a sequence
+ named 'fault'. Thus the 'fault' sequence can be seen executing, and writing the
+ generic error message to the logs.
+ </p>
+
+<div class="consoleOutput">[HttpServerWorker-1] DEBUG SendMediator - Send mediator :: mediate()
+[HttpServerWorker-1] ERROR IndirectEndpoint - Reference to non-existent endpoint for key : bogus
+[HttpServerWorker-1] DEBUG MediatorFaultHandler - MediatorFaultHandler :: handleFault
+[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator <fault> :: mediate()
+[HttpServerWorker-1] DEBUG LogMediator - Log mediator :: mediate()
+[HttpServerWorker-1] INFO LogMediator text = An unexpected error occured, message = Couldn't find the endpoint with the key : bogus</div>
+
+<p>
+ Now send another stock quote request for the symbol 'SUN'.
+ </p>
+
+<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=SUN</div>
+
+<p>
+ When the 'SUN' quote is requested, a custom sequence 'sunSequence' is invoked,
+ and it specifies 'sunErrorHandler' as its error handler. Hence when the send
+ fails, you could see the proper error handler invocation and the custom error
+ message printed as follows.
+ </p>
+
+<div class="consoleOutput">[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator <sunSequence> :: mediate()
+[HttpServerWorker-1] DEBUG SequenceMediator - Setting the onError handler for the sequence
+[HttpServerWorker-1] DEBUG AbstractListMediator - Implicit Sequence <SequenceMediator> :: mediate()
+[HttpServerWorker-1] DEBUG SendMediator - Send mediator :: mediate()
+[HttpServerWorker-1] ERROR IndirectEndpoint - Reference to non-existent endpoint for key : sunPort
+[HttpServerWorker-1] DEBUG MediatorFaultHandler - MediatorFaultHandler :: handleFault
+[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator <sunErrorHandler> :: mediate()
+[HttpServerWorker-1] DEBUG AbstractListMediator - Implicit Sequence <SequenceMediator> :: mediate()
+[HttpServerWorker-1] DEBUG LogMediator - Log mediator :: mediate()
+[HttpServerWorker-1] INFO LogMediator text = An unexpected error occured for stock SUN, message = Couldn't find the endpoint with the key : sunPort</div>
+ </div>
+ </div>
+
+<p><a href="../samples.html">Back to Catalog</a></p>
+
+
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <footer>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <p>Copyright ©2005–2017
+<a href="http://www.apache.org/">Apache Software Foundation</a>.
+All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html>
Added: synapse/site/3_0_1/userguide/samples/sample400.html
URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample400.html?rev=1817077&view=auto
==============================================================================
--- synapse/site/3_0_1/userguide/samples/sample400.html (added)
+++ synapse/site/3_0_1/userguide/samples/sample400.html Mon Dec 4 09:53:57 2017
@@ -0,0 +1,200 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-04
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="Date-Revision-yyyymmdd" content="20171204" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Apache Synapse – Apache Synapse - Sample 400</title>
+ <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+ <link rel="stylesheet" href="../../css/site.css" />
+ <link rel="stylesheet" href="../../css/print.css" media="print" />
+ <script type="text/javascript" src="../../js/apache-maven-fluido-1.6.min.js"></script>
+ </head>
+ <body class="topBarDisabled">
+ <div class="container-fluid">
+ <div id="banner">
+ <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+ <div class="pull-right"></div>
+ <div class="clear"><hr/></div>
+ </div>
+
+ <div id="breadcrumbs">
+ <ul class="breadcrumb">
+ <li id="publishDate">Last Published: 2017-12-04<span class="divider">|</span>
+</li>
+ <li id="projectVersion">Version: 3.0.1</li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <div id="leftColumn" class="span2">
+ <div class="well sidebar-nav">
+<ul class="nav nav-list">
+ <li class="nav-header">Main Menu</li>
+ <li><a href="../../index.html" title="Home"><span class="none"></span>Home</a> </li>
+ <li><a href="../../download.html" title="Download"><span class="none"></span>Download</a> </li>
+ <li><a href="../../history.html" title="History"><span class="none"></span>History</a> </li>
+ <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li>
+ <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li>
+ <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li>
+ <li class="nav-header">Documentation</li>
+ <li><a href="../../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li>
+ <li><a href="../../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li>
+ <li><a href="../../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li>
+ <li><a href="../../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li>
+ <li><a href="../../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li>
+ <li><a href="../../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li>
+ <li><a href="../../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li>
+ <li><a href="../../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li>
+ <li><a href="../../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li>
+ <li><a href="../../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li>
+ <li><a href="../../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li>
+ <li><a href="../../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li>
+ <li><a href="../../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li>
+ <li><a href="../../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li>
+ <li><a href="../../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li>
+ <li class="nav-header">Developer Resources</li>
+ <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li>
+ <li><a href="../../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li>
+ <li><a href="../../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li>
+ <li class="nav-header">Project Details</li>
+ <li><a href="../../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li>
+ <li><a href="../../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li>
+ <li><a href="../../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li>
+ <li><a href="../../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li>
+ <li><a href="../../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li>
+ <li><a href="../../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li>
+ </ul>
+ <hr />
+ <div id="poweredBy">
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
+ </div>
+ </div>
+ </div>
+ <div id="bodyColumn" class="span10" >
+
+
+ <div class="section">
+<h2><a name="Sample_400:_Message_Splitting_and_Aggregation"></a>Sample 400: Message Splitting and Aggregation</h2>
+
+<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="SplitAggregateProxy">
+ <target>
+ <inSequence>
+ <iterate xmlns:m0="http://services.samples" expression="//m0:getQuote/m0:request"
+ preservePayload="true" attachPath="//m0:getQuote">
+ <target>
+ <sequence>
+ <send>
+ <endpoint>
+ <address
+ uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </sequence>
+ </target>
+ </iterate>
+ </inSequence>
+ <outSequence>
+ <aggregate>
+ <onComplete xmlns:m0="http://services.samples"
+ expression="//m0:getQuoteResponse">
+ <send/>
+ </onComplete>
+ </aggregate>
+ </outSequence>
+ </target>
+ </proxy>
+
+</definitions></div>
+
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+
+<p>
+ Showcase how Synapse can be used to split a message into multiple fragments
+ using the iterate mediator, and process them separately. The sample also shows
+ how to use the aggregate mediator to combine multiple messages into one.
+ </p>
+ </div>
+
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+
+<p>
+ </p>
+<ul>
+
+<li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+
+<li>
+ Start Synapse using the configuration numbered 400 (repository/conf/sample/synapse_sample_400.xml)
+
+<div class="command">
+ Unix/Linux: sh synapse.sh -sample 400<br />
+ Windows: synapse.bat -sample 400
+ </div>
+ </li>
+ </ul>
+
+ </div>
+
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+
+<p>
+ In this sample, the message sent to Synapse is comprised of a number of elements
+ of the same type. When Synapse receives this message it will iterate through those
+ elements and then will send each of them to the specified endpoint as separate
+ messages. When all the responses are received by Synapse, those messages will be
+ aggregated to form the resultant response and will send back to the client.
+ </p>
+
+<p>
+ To try this out invoke the sample client as follows.
+ </p>
+
+<div class="command">ant stockquote -Daddurl=http://localhost:8280/services/SplitAggregateProxy -Ditr=4</div>
+
+<p>
+ The above command will send a request containing four fragments in it. The
+ iterate mediator therefore will break up the message into four. You will notice
+ that Axis2 server is receiving 4 requests from Synapse. Four responses from Axis2
+ will be combined into one by the aggregate mediator and sent back to the sample
+ Axis2 client.
+ </p>
+ </div>
+ </div>
+
+<p><a href="../samples.html">Back to Catalog</a></p>
+
+
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <footer>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <p>Copyright ©2005–2017
+<a href="http://www.apache.org/">Apache Software Foundation</a>.
+All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html>
Added: synapse/site/3_0_1/userguide/samples/sample410.html
URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample410.html?rev=1817077&view=auto
==============================================================================
--- synapse/site/3_0_1/userguide/samples/sample410.html (added)
+++ synapse/site/3_0_1/userguide/samples/sample410.html Mon Dec 4 09:53:57 2017
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-04
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="Date-Revision-yyyymmdd" content="20171204" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Apache Synapse – Apache Synapse - Sample 410</title>
+ <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+ <link rel="stylesheet" href="../../css/site.css" />
+ <link rel="stylesheet" href="../../css/print.css" media="print" />
+ <script type="text/javascript" src="../../js/apache-maven-fluido-1.6.min.js"></script>
+ </head>
+ <body class="topBarDisabled">
+ <div class="container-fluid">
+ <div id="banner">
+ <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+ <div class="pull-right"></div>
+ <div class="clear"><hr/></div>
+ </div>
+
+ <div id="breadcrumbs">
+ <ul class="breadcrumb">
+ <li id="publishDate">Last Published: 2017-12-04<span class="divider">|</span>
+</li>
+ <li id="projectVersion">Version: 3.0.1</li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <div id="leftColumn" class="span2">
+ <div class="well sidebar-nav">
+<ul class="nav nav-list">
+ <li class="nav-header">Main Menu</li>
+ <li><a href="../../index.html" title="Home"><span class="none"></span>Home</a> </li>
+ <li><a href="../../download.html" title="Download"><span class="none"></span>Download</a> </li>
+ <li><a href="../../history.html" title="History"><span class="none"></span>History</a> </li>
+ <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li>
+ <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li>
+ <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li>
+ <li class="nav-header">Documentation</li>
+ <li><a href="../../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li>
+ <li><a href="../../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li>
+ <li><a href="../../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li>
+ <li><a href="../../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li>
+ <li><a href="../../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li>
+ <li><a href="../../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li>
+ <li><a href="../../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li>
+ <li><a href="../../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li>
+ <li><a href="../../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li>
+ <li><a href="../../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li>
+ <li><a href="../../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li>
+ <li><a href="../../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li>
+ <li><a href="../../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li>
+ <li><a href="../../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li>
+ <li><a href="../../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li>
+ <li class="nav-header">Developer Resources</li>
+ <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li>
+ <li><a href="../../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li>
+ <li><a href="../../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li>
+ <li class="nav-header">Project Details</li>
+ <li><a href="../../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li>
+ <li><a href="../../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li>
+ <li><a href="../../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li>
+ <li><a href="../../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li>
+ <li><a href="../../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li>
+ <li><a href="../../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li>
+ </ul>
+ <hr />
+ <div id="poweredBy">
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
+ </div>
+ </div>
+ </div>
+ <div id="bodyColumn" class="span10" >
+
+
+ <div class="section">
+<h2><a name="Sample_410:_Distributed_Transactions_Management_with_the_Transaction_Mediator"></a>Sample 410: Distributed Transactions Management with the Transaction Mediator</h2>
+
+<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+<sequence name="myFaultHandler">
+ <log level="custom">
+ <property name="text" value="** Rollback Transaction**"/>
+ </log>
+ <transaction action="rollback"/>
+ <send/>
+</sequence>
+
+<sequence name="main" onError="myFaultHandler">
+ <in>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </in>
+
+ <out>
+ <transaction action="new"/>
+
+ <log level="custom">
+ <property name="text" value="** Reporting to the Database esbdb**"/>
+ </log>
+ <dbreport useTransaction="true" xmlns="http://ws.apache.org/ns/synapse">
+ <connection>
+ <pool>
+ <dsName>java:jdbc/XADerbyDS</dsName>
+ <icClass>org.jnp.interfaces.NamingContextFactory</icClass>
+ <url>localhost:1099</url>
+ <user>synapse</user>
+ <password>synapse</password>
+ </pool>
+ </connection>
+ <statement>
+ <sql>delete from company where name =?</sql>
+ <parameter expression="//m0:return/m0:symbol/child::text()"
+ xmlns:m0="http://services.samples"
+ type="VARCHAR"/>
+ </statement>
+ </dbreport>
+
+ <log level="custom">
+ <property name="text" value="** Reporting to the Database esbdb1**"/>
+ </log>
+ <dbreport useTransaction="true" xmlns="http://ws.apache.org/ns/synapse">
+ <connection>
+ <pool>
+ <dsName>java:jdbc/XADerbyDS1</dsName>
+ <icClass>org.jnp.interfaces.NamingContextFactory</icClass>
+ <url>localhost:1099</url>
+ <user>synapse</user>
+ <password>synapse</password>
+ </pool>
+ </connection>
+ <statement>
+ <sql> INSERT into company values ('IBM','c4',12.0)</sql>
+ </statement>
+ </dbreport>
+ <transaction action="commit"/>
+ <send/>
+ </out>
+</sequence>
+</definitions></div>
+
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+
+<p>
+ Demonstrate how to manage complex distributed transactions using the transaction
+ mediator
+ </p>
+ </div>
+
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+
+<p>
+ </p>
+<ul>
+
+<li>
+ To run this sample it is required to deploy Synpase on JBoss application
+ server(This is only tested with JBoss application sever). You can use the
+ Synapse war distribution to deploy Synapse on JBoss. Use the synpase_sample_410.xml
+ as the synapse confiuration file and start JBoss. Also you need to define
+ two XA datasources for above the two datasources defined in Synapse. You'll
+ need to refer JBoss documentation to see how to do this.
+ </li>
+
+<li>
+ Setup two Derby database instances as described in the database setup guide.
+ These databases will be used by the XA datasources in JBoss.
+ </li>
+
+<li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ </ul>
+
+ </div>
+
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+
+<p>
+ In this sample a record is deleted from one database and it is added to the
+ second database. If either of the operations(deleting from the 1st database and
+ adding to the second database) fails the entire operation will be roll backed.
+ The records will be left intact.
+ </p>
+
+<p>
+ Invoke the client as follows to try this out.
+ </p>
+
+<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=SUN</div>
+
+<p>
+ You can force an error by shutting down one of the two database instances.
+ </p>
+ </div>
+ </div>
+
+<p><a href="../samples.html">Back to Catalog</a></p>
+
+
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <footer>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <p>Copyright ©2005–2017
+<a href="http://www.apache.org/">Apache Software Foundation</a>.
+All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html>
Added: synapse/site/3_0_1/userguide/samples/sample420.html
URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample420.html?rev=1817077&view=auto
==============================================================================
--- synapse/site/3_0_1/userguide/samples/sample420.html (added)
+++ synapse/site/3_0_1/userguide/samples/sample420.html Mon Dec 4 09:53:57 2017
@@ -0,0 +1,191 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-04
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="Date-Revision-yyyymmdd" content="20171204" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Apache Synapse – Apache Synapse - Sample 420</title>
+ <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+ <link rel="stylesheet" href="../../css/site.css" />
+ <link rel="stylesheet" href="../../css/print.css" media="print" />
+ <script type="text/javascript" src="../../js/apache-maven-fluido-1.6.min.js"></script>
+ </head>
+ <body class="topBarDisabled">
+ <div class="container-fluid">
+ <div id="banner">
+ <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+ <div class="pull-right"></div>
+ <div class="clear"><hr/></div>
+ </div>
+
+ <div id="breadcrumbs">
+ <ul class="breadcrumb">
+ <li id="publishDate">Last Published: 2017-12-04<span class="divider">|</span>
+</li>
+ <li id="projectVersion">Version: 3.0.1</li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <div id="leftColumn" class="span2">
+ <div class="well sidebar-nav">
+<ul class="nav nav-list">
+ <li class="nav-header">Main Menu</li>
+ <li><a href="../../index.html" title="Home"><span class="none"></span>Home</a> </li>
+ <li><a href="../../download.html" title="Download"><span class="none"></span>Download</a> </li>
+ <li><a href="../../history.html" title="History"><span class="none"></span>History</a> </li>
+ <li><a href="http://www.apache.org/licenses/LICENSE-2.0" class="externalLink" title="License"><span class="none"></span>License</a> </li>
+ <li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"><span class="none"></span>Sponsorship</a> </li>
+ <li><a href="http://www.apache.org/security/" class="externalLink" title="Security"><span class="none"></span>Security</a> </li>
+ <li class="nav-header">Documentation</li>
+ <li><a href="../../userguide/installation.html" title="Installation Guide"><span class="none"></span>Installation Guide</a> </li>
+ <li><a href="../../userguide/quick_start.html" title="Quick Start Guide"><span class="none"></span>Quick Start Guide</a> </li>
+ <li><a href="../../userguide/samples/setup/index.html" title="Samples Setup Guide"><span class="none"></span>Samples Setup Guide</a> </li>
+ <li><a href="../../userguide/samples.html" title="Samples Catalog"><span class="none"></span>Samples Catalog</a> </li>
+ <li><a href="../../userguide/config.html" title="Configuration Language"><span class="none"></span>Configuration Language</a> </li>
+ <li><a href="../../userguide/mediators.html" title="Mediators Catalog"><span class="none"></span>Mediators Catalog</a> </li>
+ <li><a href="../../userguide/transports.html" title="Transports Catalog"><span class="none"></span>Transports Catalog</a> </li>
+ <li><a href="../../userguide/properties.html" title="Properties Catalog"><span class="none"></span>Properties Catalog</a> </li>
+ <li><a href="../../userguide/xpath.html" title="XPath functions and Variables"><span class="none"></span>XPath functions and Variables</a> </li>
+ <li><a href="../../userguide/extending.html" title="Extending Synapse"><span class="none"></span>Extending Synapse</a> </li>
+ <li><a href="../../userguide/template_library.html" title="Synapse Template Libraries"><span class="none"></span>Synapse Template Libraries</a> </li>
+ <li><a href="../../userguide/upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a> </li>
+ <li><a href="../../userguide/deployment.html" title="Deployment"><span class="none"></span>Deployment</a> </li>
+ <li><a href="../../apidocs/" title="Javadocs"><span class="none"></span>Javadocs</a> </li>
+ <li><a href="../../userguide/faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li>
+ <li class="nav-header">Developer Resources</li>
+ <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span class="none"></span>Developer Guide</a> </li>
+ <li><a href="../../dev/best-practices.html" title="Development Best Practices"><span class="none"></span>Development Best Practices</a> </li>
+ <li><a href="../../dev/release-process.html" title="Release Process"><span class="none"></span>Release Process</a> </li>
+ <li class="nav-header">Project Details</li>
+ <li><a href="../../project-info.html" title="Overview"><span class="none"></span>Overview</a> </li>
+ <li><a href="../../mail-lists.html" title="Mailing Lists"><span class="none"></span>Mailing Lists</a> </li>
+ <li><a href="../../source-repository.html" title="Source Repository"><span class="none"></span>Source Repository</a> </li>
+ <li><a href="../../issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li>
+ <li><a href="../../dependency-management.html" title="Dependencies"><span class="none"></span>Dependencies</a> </li>
+ <li><a href="../../team-list.html" title="Project Team"><span class="none"></span>Project Team</a> </li>
+ </ul>
+ <hr />
+ <div id="poweredBy">
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <div class="clear"></div>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
+ </div>
+ </div>
+ </div>
+ <div id="bodyColumn" class="span10" >
+
+
+ <div class="section">
+<h2><a name="Sample_420:_Simple_Response_Caching_Scenario"></a>Sample 420: Simple Response Caching Scenario</h2>
+
+<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <sequence name="main">
+ <in>
+ <cache timeout="20" scope="per-host" collector="false"
+ hashGenerator="org.wso2.caching.digest.DOMHASHGenerator">
+ <implementation type="memory" maxSize="100"/>
+ </cache>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </in>
+ <out>
+ <cache collector="true"/>
+ <send/>
+ </out>
+ </sequence>
+
+</definitions></div>
+
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+
+<p>
+ Showcase the caching capabilities of Synapse by implementing a simple response
+ cache in Synapse for an actual service deployed on Axis2
+ </p>
+ </div>
+
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+
+<p>
+ </p>
+<ul>
+
+<li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+
+<li>
+ Start Synapse using the configuration numbered 420 (repository/conf/sample/synapse_sample_420.xml)
+
+<div class="command">
+ Unix/Linux: sh synapse.sh -sample 420<br />
+ Windows: synapse.bat -sample 420
+ </div>
+ </li>
+ </ul>
+
+ </div>
+
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+
+<p>
+ In this sample, the message sent to Synapse is checked for an existing cached
+ response by calculating the hash value of the request. If there is a cache hit
+ in Synapse, then this request will not be forwarded to the actual service. Rather,
+ Synapse responds to the client with the cached response. In case of a cache miss
+ that particular message will be forwarded to the actual service and caches that
+ response in the out path for the use of consecutive requests of the same type.
+ </p>
+
+<p>
+ To try out this scenario, send a request from the sample client as follows.
+ </p>
+
+<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/</div>
+
+<p>
+ You will notice that if you send more than one requests within 20 seconds, only
+ the first request is forwarded to the actual service, and the rest of the requests
+ will be served by the cache inside Synapse. You could observe this by looking at
+ the logs printed by the Axis2 server, as well as by observing a constant quote value in
+ the response to the client instead of the random rate, which changes by each and
+ every 20 seconds.
+ </p>
+ </div>
+ </div>
+
+<p><a href="../samples.html">Back to Catalog</a></p>
+
+
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <footer>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <p>Copyright ©2005–2017
+<a href="http://www.apache.org/">Apache Software Foundation</a>.
+All rights reserved.</p>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html>