Added: synapse/site/3_0_1/userguide/samples/sample2.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample2.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample2.html (added) +++ synapse/site/3_0_1/userguide/samples/sample2.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,204 @@ +<!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 2</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_2:_CBR_with_Switch_Case_Mediator"></a>Sample 2: CBR with Switch Case Mediator</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <sequence name="main"> + <switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="http://services.samples"> + <case regex="IBM"> + <!-- the property mediator sets a local property on the *current* message --> + <property name="symbol" value="Great stock - IBM"/> + </case> + <case regex="MSFT"> + <property name="symbol" value="Are you sure? - MSFT"/> + </case> + <default> + <!-- it is possible to assign the result of an XPath expression as well --> + <property name="symbol" expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)"/> + </default> + </switch> + <log level="custom"> + <!-- 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) --> + <property name="symbol" expression="get-property('symbol')"/> + <!-- the get-property() function supports the implicit message headers To/From/Action/FaultTo/ReplyTo --> + <property name="epr" expression="get-property('To')"/> + </log> + <!-- Send the messages where they are destined to (i.e. the 'To' EPR of the message) --> + <send/> + </sequence> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Introduction to the switch-case mediator and manipulating properties set on the + messages. + </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 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> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<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> + </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/sample200.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample200.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample200.html (added) +++ synapse/site/3_0_1/userguide/samples/sample200.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,198 @@ +<!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 200</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_200:_Engaging_WS-Security_on_Proxy_Services"></a>Sample 200: Engaging WS-Security on Proxy Services</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <localEntry key="sec_policy" src="file:repository/conf/sample/resources/policy/policy_3.xml"/> + + <proxy name="StockQuoteProxy"> + <target> + <inSequence> + <send> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </send> + </inSequence> + <outSequence> + <send/> + </outSequence> + </target> + <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/> + <enableSec/> + <policy key="sec_policy"/> + </proxy> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrates how to secure a proxy service using WS-Security and WS-Policy + standards + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </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> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<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> + </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/sample250.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample250.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample250.html (added) +++ synapse/site/3_0_1/userguide/samples/sample250.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,238 @@ +<!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 250</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_250:Introduction_to_Transport_Switching_-_JMS_to_HTTPS"></a>Sample 250:Introduction to Transport Switching - JMS to HTTP/S </h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <proxy name="StockQuoteProxy" transports="jms"> + <target> + <inSequence> + <property action="set" name="OUT_ONLY" value="true"/> + </inSequence> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + <outSequence> + <send/> + </outSequence> + </target> + <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/> + <parameter name="transport.jms.ContentType"> + <rules> + <jmsProperty>contentType</jmsProperty> + <default>application/xml</default> + </rules> + </parameter> + </proxy> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<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> + </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> + 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> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<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"><parameter name="transport.jms.Destination">dynamicTopics/something.TestTopic</parameter></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> + </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/sample251.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample251.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample251.html (added) +++ synapse/site/3_0_1/userguide/samples/sample251.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,201 @@ +<!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 251</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_251:_Switching_from_HTTPS_to_JMS"></a>Sample 251: Switching from HTTP/S to JMS</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <proxy name="StockQuoteProxy" transports="http"> + <target> + <endpoint> + <address + uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/> + </endpoint> + <inSequence> + <property action="set" name="OUT_ONLY" value="true"/> + </inSequence> + <outSequence> + <send/> + </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> + This sample demonstrates receiving messages over HTTP/S and forwarding them to + a JMS queue + </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#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> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<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&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory& +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> + </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/sample252.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample252.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample252.html (added) +++ synapse/site/3_0_1/userguide/samples/sample252.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,356 @@ +<!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 252</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_252:_Pure_Text_Binary_and_POX_Message_Support_with_JMS"></a>Sample 252: Pure Text, Binary and POX Message Support with JMS</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <sequence name="text_proxy"> + <log level="full"/> + <header name="Action" value="urn:placeOrder"/> + <script language="js"> + var args = mc.getPayloadXML().toString().split(" "); + mc.setPayloadXML( + &lt;placeOrder xmlns="http://services.samples"&gt; + &lt;order&gt; + &lt;price&gt;{args[0]}&lt;/price&gt; + &lt;quantity&gt;{args[1]}&lt;/quantity&gt; + &lt;symbol&gt;{args[2]}&lt;/symbol&gt; + &lt;/order&gt; + &lt;/placeOrder&gt;); + </script> + <property action="set" name="OUT_ONLY" value="true"/> + <log level="full"/> + <send> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </send> + </sequence> + + <sequence name="mtom_proxy"> + <log level="full"/> + <property action="set" name="OUT_ONLY" value="true"/> + <header name="Action" value="urn:oneWayUploadUsingMTOM"/> + <send> + <endpoint> + <address uri="http://localhost:9000/services/MTOMSwASampleService" optimize="mtom"/> + </endpoint> + </send> + </sequence> + + <sequence name="pox_proxy"> + <property action="set" name="OUT_ONLY" value="true"/> + <header name="Action" value="urn:placeOrder"/> + <send> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService" + format="soap11"/> + </endpoint> + </send> + </sequence> + + <sequence name="out"> + <send/> + </sequence> + + <proxy name="JMSFileUploadProxy" transports="jms"> + <target inSequence="mtom_proxy" outSequence="out"/> + <parameter name="transport.jms.ContentType"> + <rules> + <bytesMessage>application/octet-stream</bytesMessage> + </rules> + </parameter> + <parameter name="Wrapper">{http://synapse.apache.org/userguide/samples/}element</parameter> + </proxy> + + <proxy name="JMSTextProxy" transports="jms"> + <target inSequence="text_proxy" outSequence="out"/> + <parameter name="transport.jms.ContentType"> + <rules> + <textMessage>text/plain</textMessage> + </rules> + </parameter> + <parameter name="Wrapper">{http://synapse.apache.org/userguide/samples/}text</parameter> + </proxy> + + <proxy name="JMSPoxProxy" transports="jms"> + <target inSequence="pox_proxy" outSequence="out"/> + <parameter name="transport.jms.ContentType">application/xml</parameter> + </proxy> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrate the ability of Synapse to receive and mediate plain text, binary and + POX (Plain Old XML) messages over JMS. + </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> + 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 252 (repository/conf/sample/synapse_sample_252.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 252<br /> + Windows: synapse.bat -sample 252 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + This configuration creates 3 JMS proxy services named JMSFileUploadProxy, + JMSTextProxy and JMSPoxProxy exposed over JMS queues with the same names as the + services. The first part of this example demonstrates the pure text message + support with JMS, where a user sends a space separated text message over JMS of + the form '<price> <qty> <symbol>'. Synapse converts this message + into a SOAP message and sends this to the placeOrder operation of the SimpleStockQuoteService. + Synapse uses the script mediator to transform the text message into a XML payload + using the JavaScript support available to tokenize the string. The proxy service + property named 'Wrapper' defines a custom wrapper element QName, to be used when + wrapping text/binary content into a SOAP envelope. + </p> + +<p> + Execute JMS client as follows. This will post a pure text JMS message with the + content defined (e.g. '12.33 1000 ACP') to the specified JMS destination - + dynamicQueues/JMSTextProxy. + </p> + +<div class="command">ant jmsclient -Djms_type=text -Djms_payload="12.33 1000 ACP" -Djms_dest=dynamicQueues/JMSTextProxy</div> + +<p> + Following the logs, you will notice that Synapse received the JMS text message + and transformed it into a SOAP payload as follows. Notice that the wrapper element + '{http://synapse.apache.org/userguide/samples/}text' has been used to wrap the text message + content. + </p> + +<div class="consoleOutput">[jms-Worker-1] INFO LogMediator To: , WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: ID:orcus.veithen.net-50631-1225235276233-1:0:1:1:1, Direction: request, +Envelope: +<?xml version="1.0" encoding="utf-8"?> +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <axis2ns1:text xmlns:axis2ns1="http://synapse.apache.org/userguide/samples/">12.33 1000 ACP</axis2ns1:text> + </soapenv:Body> +</soapenv:Envelope></div> + +<p> + Then you can see how the script mediator creates a stock quote request by tokenizing + the text as follows. + </p> + +<div class="consoleOutput">[jms-Worker-1] INFO LogMediator To: , WSAction: urn:placeOrder, SOAPAction: urn:placeOrder, MessageID: ID:orcus.veithen.net-50631-1225235276233-1:0:1:1:1, Direction: request, +Envelope: +<?xml version="1.0" encoding="utf-8"?> +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <placeOrder xmlns="http://services.samples"> + <order> + <price>12.33</price> + <quantity>1000</quantity> + <symbol>ACP</symbol> + </order> + </placeOrder> + </soapenv:Body> +</soapenv:Envelope></div> + +<p> + This SOAP message is then sent to the SimpleStockQuoteService on the sample + Axis2 server. The sample Axis2 server will accept the one-way message and print + the following log: + </p> + +<div class="consoleOutput">samples.services.SimpleStockQuoteService :: Accepted order for : 1000 stocks of ACP at $ 12.33</div> + +<p> + The next section of this example demonstrates how a pure binary JMS message can + be received and processed through Synapse. The configuration creates a proxy + service named 'JMSFileUploadProxy' that accepts binary messages and wraps them + into a custom element '{http://synapse.apache.org/userguide/samples/}element'. The received + message is then forwarded to the MTOMSwASampleService using the SOAP action + 'urn:oneWayUploadUsingMTOM' while optimizing binary content using MTOM. To execute + this sample, use the JMS client to publish a pure binary JMS message containing + the file './../../repository/conf/sample/resources/mtom/asf-logo.gif' to the JMS + destination 'dynamicQueues/JMSFileUploadProxy' as follows: + </p> + +<div class="command">ant jmsclient -Djms_type=binary -Djms_dest=dynamicQueues/JMSFileUploadProxy \ + -Djms_payload=./../../repository/conf/sample/resources/mtom/asf-logo.gif</div> + +<p> + Examining the Synapse logs will reveal that the binary content was received + over JMS and wrapped with the specified element into a SOAP infoset as follows: + </p> + +<div class="consoleOutput">[jms-Worker-1] INFO LogMediator To: , WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: ID:orcus.veithen.net-50702-1225236039556-1:0:1:1:1, Direction: request, +Envelope: +<?xml version="1.0" encoding="utf-8"?> +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <axis2ns1:element xmlns:axis2ns1="http://synapse.apache.org/userguide/samples/">R0lGODlhgw...AAOw==</axis2ns1:element> + </soapenv:Body> +</soapenv:Envelope></div> + +<p> + Thereafter the message is sent as a MTOM optimized message as specified by the + 'format=mtom' attribute of the endpoint, to the MTOMSwASampleService using the + SOAP action 'urn:oneWayUploadUsingMTOM'. Once received by the sample service, + it is saved into a temporary file and could be verified for correctness. + </p> + +<div class="consoleOutput">Wrote to file : ./../../work/temp/sampleServer/mtom-4417.gif</div> + +<p> + The final section of this example shows how a POX JMS message is received by Synapse + and sent to the SimpleStockQuoteService as a SOAP message. Use the JMS client as + follows to create a POX (Plain Old XML) message with a stock quote request payload + (without a SOAP envelope), and send it to the JMS destination 'dynamicQueues/JMSPoxProxy' + as follows: + </p> + +<div class="command">ant jmsclient -Djms_type=pox -Djms_dest=dynamicQueues/JMSPoxProxy -Djms_payload=MSFT</div> + +<p> + Synapse converts the POX message into a SOAP payload and sends to the + SimpleStockQuoteService after setting the SOAP action as 'urn:placeOrder'. + The sample Axis2 server displays a successful message on the receipt of the + message as: + </p> + +<div class="consoleOutput">samples.services.SimpleStockQuoteService :: Accepted order for : 19211 stocks of MSFT at $ 172.39703010684752</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/sample253.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample253.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample253.html (added) +++ synapse/site/3_0_1/userguide/samples/sample253.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,229 @@ +<!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 253</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_253:_One-way_Bridging_from_JMS_to_HTTP_and_Replying_with_a_202_Accepted_Response"></a>Sample 253: One-way Bridging from JMS to HTTP and Replying with a 202 Accepted Response</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <proxy name="JMStoHTTPStockQuoteProxy" transports="jms"> + <target> + <inSequence> + <property action="set" name="OUT_ONLY" value="true"/> + </inSequence> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + <outSequence> + <send/> + </outSequence> + </target> + <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/> + </proxy> + + <proxy name="OneWayProxy" transports="http"> + <target> + <inSequence> + <log level="full"/> + </inSequence> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + <outSequence> + <send/> + </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> + This sample demonstrates the ability of Synapse to perform transport switching + between JMS and HTTP. It also shows how to configure a one-way HTTP proxy in + Synapse. + </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> + 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 253 (repository/conf/sample/synapse_sample_253.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 253<br /> + Windows: synapse.bat -sample 253 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + This example invokes the one-way 'placeOrder' operation on the SimpleStockQuoteService + using the Axis2 ServiceClient.fireAndForget() API at the client. To test this, + run the sample client as follows and you will notice the one-way JMS message + flowing through Synapse into the sample Axis2 server instance over HTTP, and Axis2 + acknowledging it with a HTTP 202 Accepted response. + </p> + +<div class="command">ant stockquote -Dmode=placeorder -Dtrpurl="jms:/JMStoHTTPStockQuoteProxy?\ +transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory\ +&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory\ +&java.naming.provider.url=tcp://localhost:61616\ +&transport.jms.ContentTypeProperty=Content-Type&transport.jms.DestinationType=queue"</div> + +<p> + The second example shows how Synapse could be made to respond with a HTTP 202 + Accepted response to a request received. The proxy service simply logs the message + received and acknowledges it. To try this out, run the sample client as follows. + </p> + +<div class="command">ant stockquote -Dmode=placeorder -Dtrpurl=http://localhost:8280/services/OneWayProxy</div> + +<p> + On the Synapse console you could see the logged message, and if TCPMon was used + at the client, you would see the 202 Accepted response sent back to the client + from Synapse. + </p> + +<div class="consoleOutput">HTTP/1.1 202 Accepted +Content-Type: text/xml; charset=UTF-8 +Host: 127.0.0.1 +SOAPAction: "urn:placeOrder" +Date: Sun, 06 May 2007 17:20:19 GMT +Server: Synapse-HttpComponents-NIO +Transfer-Encoding: chunked + +0</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>