Added: synapse/site/userguide/samples/sample17.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample17.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample17.html (added) +++ synapse/site/userguide/samples/sample17.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,425 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-01-04 + | Rendered using Apache Maven Fluido Skin 1.4 +--> +<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="20170104" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse - + Apache Synapse - Sample 17</title> + <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.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.4.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-01-04 + <span class="divider">|</span> + </li> + <li id="projectVersion">Version: 3.0.0 + </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" > + + <!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more + contributor license agreements. See the NOTICE file ~ distributed with this + work for additional information ~ regarding copyright ownership. The ASF + licenses this file ~ to you under the Apache License, Version 2.0 (the ~ + "License"); you may not use this file except in compliance ~ with the License. + You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ ~ Unless required by applicable law or agreed to in writing, ~ software + distributed under the License is distributed on an ~ * "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the + License for the ~ specific language governing permissions and limitations + ~ under the License. --> + + <div class="section"> +<h2>Sample 17: Introduction to the payloadFactory mediator<a name="Sample_17:_Introduction_to_the_payloadFactory_mediator"></a></h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> +<sequence name="main"> + <in> + <!-- using payloadFactory mediator to transform the request message --> + <payloadFactory media-type="xml"> + <format> + <m:getQuote xmlns:m="http://services.samples"> + <m:request> + <m:symbol>$1</m:symbol> + </m:request> + </m:getQuote> + </format> + <args> + <arg xmlns:m0="http://services.samples" expression="//m0:Code"/></args> + </payloadFactory> + </in> + <out> + <!-- using payloadFactory mediator to transform the response message --> + <payloadFactory media-type="xml"> + <format> + <m:CheckPriceResponse xmlns:m="http://services.samples/xsd"> + <m:Code>$1</m:Code> + <m:Price>$2</m:Price> + </m:CheckPriceResponse> + </format> + <args> + <arg xmlns:m0="http://services.samples/xsd" expression="//m0:symbol"/> + <arg xmlns:m0="http://services.samples/xsd" expression="//m0:last"/> + </args> + </payloadFactory> + </out> + <send/> + </sequence> +</definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Objective: Introduction to the payloadFactory mediator + </p> + </div> + + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li> + Start the Synapse configuration numbered 17: i.e. synapse -sample 17 + </li> + +<li> + Start the Axis2 server and deploy the SimpleStockQuoteService if + not already done + </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + Execute the client as follows. + </p> + +<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=customquote + </div> + +<p>This Sample demonstrates how the PayloadFactory Mediator can be used to perform transformations + as an alternative to the XSLT mediator, which is demonstrated in Sample 8: Introduction to + Static and Dynamic Registry Resources and Using XSLT Transformations + </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/userguide/samples/sample269.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample269.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample269.html (added) +++ synapse/site/userguide/samples/sample269.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,475 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-01-04 + | Rendered using Apache Maven Fluido Skin 1.4 +--> +<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="20170104" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse - + Apache Synapse - Sample 269</title> + <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.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.4.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-01-04 + <span class="divider">|</span> + </li> + <li id="projectVersion">Version: 3.0.0 + </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" > + + <!-- ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. --> + + <div class="section"> +<h2>Sample 269:Introduction to AMQP Transport<a name="Sample_269:Introduction_to_AMQP_Transport"></a></h2> + +<div class="xmlConf"> +<definitions xmlns="http://ws.apache.org/ns/synapse"> + + <proxy name="ConsumerProxy" transports="amqp"> + <target> + <inSequence> + <property action="set" name="OUT_ONLY" value="true"/> + <log level="custom"> + <property name="status" value="At ConsumerProxy"/> + </log> + <log level="full"/> + <drop/> + </inSequence> + <outSequence> + <send/> + </outSequence> + </target> + <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/> + <parameter name="transport.amqp.ConnectionFactoryName">consumer</parameter> + <parameter name="transport.amqp.QueueName">ConsumerProxy</parameter> + </proxy> + +</definitions> + </div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Demonstrate the AMQP transport of Synapse. + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li> + <a class="externalLink" href="http://www.rabbitmq.com/java-client.html">Download</a> the RabbitMQ + Java client library and copy it into Synapse class path (SYNAPSE_HOME/lib). + </li> + +<li> + <a class="externalLink" href="http://www.rabbitmq.com/">Download</a> and install the RabbitMQ AMQP broker. + Then start the broker on its default port(5672). + </li> + +<li> + Uncomment the AMQP transport listener section in axis2.xml(repository/conf/axis2.xml). + If you are running the AMQP broker on a port other than the default port, + configure the connection factory definitions in AMQP transport listener appropriately. + </li> + +<li> + Start Synapse using the configuration numbered 269 (repository/conf/sample/synapse_sample_269.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 269<br /> + Windows: synapse.bat -sample 269 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + In this sample we are using a proxy service exposed over AMQP (note the transports=amqp + attribute). If you check the WSDL of the proxy service using a web browser, you + will notice that it only has AMQP endpoints. + </p> + +<p> + Run the sample RabbitMQ AMQP client by switching to the samples/axis2Client directory and + executing the following command. Other options that can be passed into the RabbitMQ + client can be found by just executing 'ant'. + </p> + +<div class="command">ant rabbitmqclient -Damqpmode=producer -DqueueName=ConsumerProxy -DpayLoad=IBM</div> + +<p> + This will send a plain XML formatted place order request to a queue in the RabbitMQ + broker. The queue is named 'ConsumerProxy'. Synapse will be polling on this queue for + any incoming messages so it will pick up the request. A message similar to following + will be logged on the console indicating that the message has been received at the + proxy service. + </p> + +<div class="consoleOutput">2013-07-30 17:00:56,687 [-] [pool-11-thread-5] INFO LogMediator status = At ConsumerProxy</div> + +<div class="consoleOutput"> +22013-07-30 17:00:56,688 [-] [pool-11-thread-5] INFO LogMediator To: null, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><m:placeOrder xmlns:m="http://services.samples"> + <m:order> + <m:price>163.00923364424872</m:price> + <m:quantity>6620</m:quantity> + <m:symbol>IBM</m:symbol> + </m:order> +</m:placeOrder></soapenv:Body></soapenv:Envelope> + </div> + + +<p> + Note that the operation is out-only and no response is sent back to the client. + The content type of the message can be configured using the parameter + transport.amqp.ContentType and by default this is assumed to be application/xml. + </p> + +<div class="xmlConf"><parameter name="transport.amqp.ConnectionFactoryName">consumer</parameter></div> + +<p> + Above parameter defines the name of the connection factory that should be used. + If a specific connection factory is not given the default connection factory will be used. + </p> + +<div class="xmlConf"><parameter name="transport.amqp.QueueName">ConsumerProxy</parameter></div> + +<p> + Above parameter defines the queue to which the proxy service will connect and start to listen. + The other configuration parameters and more examples of AMQP transport can be + found in the AMQP transport documentation. + </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/userguide/samples/sample301.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample301.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample301.html (added) +++ synapse/site/userguide/samples/sample301.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,435 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-01-04 + | Rendered using Apache Maven Fluido Skin 1.4 +--> +<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="20170104" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse - + Apache Synapse - Sample 301</title> + <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.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.4.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-01-04 + <span class="divider">|</span> + </li> + <li id="projectVersion">Version: 3.0.0 + </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" > + + <!-- ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. --> + + <div class="section"> +<h2>Sample 301: Message Injector Task to invoke a named sequence<a name="Sample_301:_Message_Injector_Task_to_invoke_a_named_sequence"></a></h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + <task class="org.apache.synapse.startup.tasks.MessageInjector" name="InjectToSequenceTask"> + <property name="soapAction" value="urn:getQuote"/> + <property name="format" value="soap11"/> + <property name="injectTo" value="sequence"/> + <property name="sequenceName" value="SampleSequence"/> + <property name="message"> + <m0:getQuote xmlns:m0="http://services.samples"> + <m0:request> + <m0:symbol>IBM</m0:symbol> + </m0:request> + </m0:getQuote> + </property> + <trigger interval="5"/> + </task> + <sequence name="SampleSequence"> + <log level="custom"> + <property name="MSG" value="SampleSequence invoked"/> + </log> + <send receive="receivingSequence"> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </send> + </sequence> + <sequence name="receivingSequence"> + <log level="custom"> + <property xmlns:ns="http://services.samples" name="Stock_Quote_on" + expression="//ns:return/ns:lastTradeTimestamp/child::text()"/> + <property xmlns:ns="http://services.samples" name="For_the_organization" + expression="//ns:return/ns:name/child::text()"/> + <property xmlns:ns="http://services.samples" name="Last_Value" + expression="//ns:return/ns:last/child::text()"/> + </log> + </sequence> + </definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Demonstrate how to schedule tasks to invoke a named sequence periodically using + the MessageInjector task implementation + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li> + Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 + </li> + +<li> + Start Synapse using the configuration numbered 301 (repository/conf/sample/synapse_sample_301.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 301<br /> + Windows: synapse.bat -sample 301 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + The above configuration adds a scheduled task and sequences to the Synapse runtime. + The task is configured to run every 5 seconds (note the 'interval' attribute on + the 'trigger' element). + </p> + +<p> + In this sample, the sequence "SampleSequence" will be invoked by the task and + then from the sequence, the injected messages will be sent to the sample Axis2 + server, which will send back a response to Synapse. So every 5 seconds you will + notice that Axis2 is generating a quote and Synapse is receiving the stock quote + response. You will also see "SampleSequence invoked" message getting logged on + the console. + </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/userguide/samples/sample302.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample302.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample302.html (added) +++ synapse/site/userguide/samples/sample302.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,440 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-01-04 + | Rendered using Apache Maven Fluido Skin 1.4 +--> +<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="20170104" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse - + Apache Synapse - Sample 302</title> + <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.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.4.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-01-04 + <span class="divider">|</span> + </li> + <li id="projectVersion">Version: 3.0.0 + </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" > + + <!-- ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. --> + + <div class="section"> +<h2>Sample 302: Message Injector Task to invoke a Proxy service<a name="Sample_302:_Message_Injector_Task_to_invoke_a_Proxy_service"></a></h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + <task class="org.apache.synapse.startup.tasks.MessageInjector" name="InjectToProxyTask"> + <property name="soapAction" value="urn:getQuote"/> + <property name="format" value="soap11"/> + <property name="injectTo" value="proxy"/> + <property name="proxyName" value="SampleProxy"/> + <property name="message"> + <m0:getQuote xmlns:m0="http://services.samples"> + <m0:request> + <m0:symbol>IBM</m0:symbol> + </m0:request> + </m0:getQuote> + </property> + <trigger interval="5"/> + </task> + <proxy name="SampleProxy" transports="http"> + <target> + <inSequence> + <log level="custom"> + <property name="MSG" value="SampleProxy invoked"/> + </log> + <send> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </send> + </inSequence> + <outSequence> + <log level="custom"> + <property xmlns:ns="http://services.samples" name="Stock_Quote_on" + expression="//ns:return/ns:lastTradeTimestamp/child::text()"/> + <property xmlns:ns="http://services.samples" name="For_the_organization" + expression="//ns:return/ns:name/child::text()"/> + <property xmlns:ns="http://services.samples" name="Last_Value" + expression="//ns:return/ns:last/child::text()"/> + </log> + <drop/> + </outSequence> + </target> + </proxy> + </definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Demonstrate how to schedule tasks to invoke a Proxy service periodically using + the MessageInjector task implementation + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li> + Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 + </li> + +<li> + Start Synapse using the configuration numbered 302 (repository/conf/sample/synapse_sample_302.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 302<br /> + Windows: synapse.bat -sample 302 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + The above configuration adds a scheduled task, and a proxy service to the Synapse + runtime. The task is configured to run every 5 seconds (note the 'interval' + attribute on the 'trigger' element). + </p> + +<p> + In this sample, the proxy service "SampleProxy" will be invoked by the task and + then from the proxy service, the injected messages will be sent to the sample + Axis2 server, which will send back a response to Synapse. So every 5 seconds you + will notice that Axis2 is generating a quote and Synapse is receiving the stock + quote response. You will also see the "SampleProxy invoked" message getting + logged on the console. + </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/userguide/samples/sample355.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample355.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample355.html (added) +++ synapse/site/userguide/samples/sample355.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,436 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at 2017-01-04 + | Rendered using Apache Maven Fluido Skin 1.4 +--> +<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="20170104" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse - + Apache Synapse - Sample 355</title> + <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.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.4.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-01-04 + <span class="divider">|</span> + </li> + <li id="projectVersion">Version: 3.0.0 + </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" > + + <!-- ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. --> + + <div class="section"> +<h2>Sample 355: Using Python Scripts for Mediation<a name="Sample_355:_Using_Python_Scripts_for_Mediation"></a></h2> + +<div class="xmlConf"> + <definitions xmlns="http://ws.apache.org/ns/synapse"> + + <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="stockquoteScript" + src="file:repository/conf/sample/resources/script/stockquoteTransformRequest.py"/> + + <sequence name="main"> + <in> + <!-- transform the custom quote request into a standard quote request expected by the service --> + <script language="py" key="stockquoteScript" function="transformRequest"/> + <send> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </send> + </in> + <out> + <!-- transform the standard response back into the custom format the client expects --> + <script language="py" key="script/stockquoteTransformResponse.py" + function="transformResponse"/> + <send/> + </out> + </sequence> + + </definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Shows how to embed Python scripts in the Synapse configuration itself. + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li> + This sample uses Jython, so first setup support for this in Synapse as described at + <a href="setup/script.html#python">Configuring Jython</a> + </li> + +<li> + Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 + </li> + +<li> + Synapse does not ship with a Jython engine by default. Therefore you should + download the Jython engine from Jython site and copy the downloaded jar file + to the 'lib' directory of Synapse. + </li> + +<li> + Start Synapse using the configuration numbered 355 (repository/conf/sample/synapse_sample_355.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 355<br /> + Windows: synapse.bat -sample 355 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + Run the sample client as follows. + </p> + +<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=customquote</div> + +<p> + The Python scripts will transform the requests and responses. + </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>
