Added: synapse/site/userguide/samples/sample470.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample470.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample470.html (added) +++ synapse/site/userguide/samples/sample470.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,540 @@ +<!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 470</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 470: Introduction to the EJB Mediator I - Invoking Stateless Session Beans<a name="Sample_470:_Introduction_to_the_EJB_Mediator_I_-_Invoking_Stateless_Session_Beans"></a></h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + <proxy name="StoreLocatorProxy" transports="https http" startOnLoad="true" trace="disable"> + <target> + <!-- First call StoreLocator#getClosestStore(), then call StoreRegistry#getStoreById() with the result. --> + <inSequence> + <bean action="CREATE" class="samples.bean.Location" var="loc"/> + <bean action="SET_PROPERTY" var="loc" property="latitude" value="{//m:latitude}" xmlns:m="http://services.samples"/> + <bean action="SET_PROPERTY" var="loc" property="longitude" value="{//m:longitude}" xmlns:m="http://services.samples"/> + <ejb class="samples.ejb.StoreLocator" beanstalk="demo" method="getClosestStore" target="store_id" jndiName="StoreLocatorBean/remote"> + <args> + <arg value="{get-property('loc')}"/> + </args> + </ejb> + <ejb class="samples.ejb.StoreRegistry" beanstalk="demo" method="getStoreById" target="store" jndiName="StoreRegistryBean/remote"> + <args> + <arg value="{get-property('store_id')}"/> + </args> + </ejb> + <!-- Prepare the response. --> + <enrich> + <source type="inline" clone="true"> + <getClosestStoreResponse xmlns=""> + <store> + <name>?</name> + <address>?</address> + <phone>?</phone> + </store> + </getClosestStoreResponse> + </source> + <target type="body"/> + </enrich> + <bean action="GET_PROPERTY" var="store" property="name" target="{//store/name/text()}"/> + <bean action="GET_PROPERTY" var="store" property="address" target="{//store/address/text()}"/> + <bean action="GET_PROPERTY" var="store" property="phoneNo" target="{//store/phone/text()}"/> + <!-- Send the response back to the client of the ESB. --> + <respond/> + </inSequence> + </target> + </proxy> +</definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Demonstrate the usage of the EJB mediator for invoking EJB Stateless + Session Beans hosted on a remote EJB Container. + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li> + Build the backend EJB jar to be hosted on the EJB Container by changing + the directory to SYNAPSE_HOME/samples/axis2Server/src/EJBSampleBeans + and invoking: +<div class="command">mvn clean install</div> + </li> + +<li> + Deploy the built EJB jar + (SYNAPSE_HOME/samples/axis2Server/src/EJBSampleBeans/target/synapse-samples-ejb-1.0.0.jar) + in an EJB Container such as JBoss or GlassFish. + </li> + +<li> + Add minimal client JARs of your EJB Container to SYNAPSE_HOME/lib. + E.g. If you are using JBoss 7, it is sufficient to add the + <i>jboss-client.jar</i> file. + </li> + +<li> + Add the <i>synapse-samples-ejb-1.0.0.jar</i> to SYNAPSE_HOME/lib. (Note: adding + only the remote interfaces of the EJBs will suffice. Here we are using + the complete jar file for simplicity.) + </li> + +<li> + Configure a beanstalk named <i>demo</i> in + SYNAPSE_HOME/repository/conf/synapse.properties. You will need to + specify the JNDI properties of your EJB Container in this configuration. + Some example configurations are shown below. <br /> + For JBoss 7: + +<div class="consoleOutput">synapse.beanstalks=demo,foo +# JNDI properties +synapse.beanstalks.demo.java.naming.factory.url.pkgs=org.jboss.ejb.client.naming +# Cache settings +synapse.beanstalks.demo.cache.warn.limit.stateless=256 +synapse.beanstalks.demo.cache.warn.limit.stateful=256 +synapse.beanstalks.demo.cache.timeout.stateless=30 +synapse.beanstalks.demo.cache.timeout.stateful=30 +</div> + <br /> + For JBoss 6: + +<div class="consoleOutput">synapse.beanstalks=demo,foo +# JNDI properties +synapse.beanstalks.demo.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory +synapse.beanstalks.demo.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces +synapse.beanstalks.demo.java.naming.provider.url=localhost:1099 +# Cache settings +synapse.beanstalks.demo.cache.warn.limit.stateless=256 +synapse.beanstalks.demo.cache.warn.limit.stateful=256 +synapse.beanstalks.demo.cache.timeout.stateless=30 +synapse.beanstalks.demo.cache.timeout.stateful=30 +</div> + </li> + +<li> + If the JNDI names assigned to the EJBs by your EJB Container differ from + the JNDI names specified in the sample 470 configuration file + (repository/conf/sample/synapse_sample_470.xml), edit the <i>jndiName</i> + attribute of all < ejb /> mediator invocations in the + <i>synapse_sample_470.xml</i> accordingly. + </li> + +<li> + Start Synapse using the configuration numbered 470 + (repository/conf/sample/synapse_sample_470.xml): + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 470<br /> + Windows: synapse.bat -sample 470 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + Send the following request to http://localhost:8280/services/StoreLocatorProxy + using a tool such at <a class="externalLink" href="http://ws.apache.org/tcpmon/">TCPMon</a> or curl. + </p> + +<div class="xmlConf"><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <getClosestStore xmlns="http://services.samples"> + <latitude>78</latitude> + <longitude>8</longitude> + </getClosestStore> + </soapenv:Body> +</soapenv:Envelope> +</div> + +<p> + When the <i>StoreLocatorProxy</i> receives the request, it first creates an instance of + <i>samples.bean.Location</i> using the Bean mediator. + Then, it sets the properties of the newly created bean with the values + extracted from the incoming SOAP message, again using the Bean mediator. + </p> + +<p> + The subsequent EJB mediator invokes the <i>getClosestStore()</i> method on the remote stateless + session bean, <i>StoreLocator</i>, with the previously populated + Location object as an argument and stores the result in the <i>store_id</i> message context + property. Another EJB mediator that follows calls the <i>getStoreById()</i> method + on a second stateless session bean,<i>StoreRegistry</i>, to obtain store details encapsulated in + a JavaBean (an instance of samples.bean.Store) and stores this resulting bean in a message context + property named <i>store</i>. The <i>demo</i> beanstalk provides all necessary configurations + needed for the two remote EJB invocations. + </p> + +<p> + Finally, Enrich and Bean mediators are used to build the response message extracting properties from + the JavaBean stored in the <i>store</i> message context property. + </p> + +<p>A sample response is shown below.</p> + + +<div class="xmlConf"><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <getClosestStoreResponse> + <store> + <name>Kadawatha</name> + <address>253, Kandy Road, Kadawatha</address> + <phone>0112990789</phone> + </store> + </getClosestStoreResponse> + </soapenv:Body> +</soapenv:Envelope> +</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/userguide/samples/sample471.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample471.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample471.html (added) +++ synapse/site/userguide/samples/sample471.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,513 @@ +<!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 471</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 471: Introduction to the EJB Mediator II - Invoking Stateful Session Beans<a name="Sample_471:_Introduction_to_the_EJB_Mediator_II_-_Invoking_Stateful_Session_Beans"></a></h2> + +<div class="xmlConf"><definitions> + <proxy name="BuyAllProxy" transports="https http" startOnLoad="true" trace="disable"> + <target> + <!-- Iterate over all items in the request and call addItem() on the ShoppingCart EJB for each item. --> + <inSequence> + <property name="SESSION_ID" expression="get-property('MessageID')"/> + <iterate xmlns:m0="http://services.samples" preservePayload="false" + expression="//m0:buyItems/m0:items/m0:item"> + <target> + <sequence> + <ejb class="samples.ejb.ShoppingCart" beanstalk="demo" method="addItem" sessionId="{get-property('SESSION_ID')}" jndiName="ShoppingCartBean/remote"> + <args> + <arg value="{//m:item//m:id}" xmlns:m="http://services.samples"/> + <arg value="{//m:item//m:quantity}" xmlns:m="http://services.samples"/> + </args> + </ejb> + <sequence key="collector"/> + </sequence> + </target> + </iterate> + </inSequence> + </target> + </proxy> + + <!-- Prepare the response once all addItem() calls are finished. --> + <sequence name="collector"> + <aggregate> + <onComplete> + <ejb class="samples.ejb.ShoppingCart" beanstalk="demo" method="getItemCount" sessionId="{get-property('SESSION_ID')}" target="ITEM_COUNT"/> + <ejb class="samples.ejb.ShoppingCart" beanstalk="demo" method="getTotal" sessionId="{get-property('SESSION_ID')}" target="TOTAL" remove="true"/> + <payloadFactory> + <format> + <buyAllResponse xmlns=""> + <itemCount>$1</itemCount> + <total>$2</total> + </buyAllResponse> + </format> + <args> + <arg expression="get-property('ITEM_COUNT')"/> + <arg expression="get-property('TOTAL')"/> + </args> + </payloadFactory> + <respond/> + </onComplete> + </aggregate> + </sequence> + +</definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Demonstrate the usage of the EJB mediator for invoking EJB Stateful + Session Beans hosted on a remote EJB Container. + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li> + Follow steps 1 to 5 in <a href="sample470.html">Sample 470</a> to host the EJBs + in an EJB Container of your choice and to configure the <i>demo</i> beanstalk. + </li> + +<li> + If the JNDI names assigned to the EJBs by your EJB Container differ from + the JNDI names specified in the sample 471 configuration file + (repository/conf/sample/synapse_sample_471.xml), edit the <i>jndiName</i> + attribute of all < ejb /> mediator invocations in the + <i>synapse_sample_471.xml</i> accordingly. + </li> + +<li> + Start Synapse using the configuration numbered 471 + (repository/conf/sample/synapse_sample_471.xml): + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 471<br /> + Windows: synapse.bat -sample 471 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + Send the following request to http://localhost:8280/services/BuyAllProxy + using a tool such at <a class="externalLink" href="http://ws.apache.org/tcpmon/">TCPMon</a> or curl. + </p> + +<div class="xmlConf"><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <buyItems xmlns="http://services.samples"> + <items> + <item> + <id>2150</id> + <quantity>1</quantity> + </item> + <item> + <id>1189</id> + <quantity>2</quantity> + </item> + <item> + <id>890</id> + <quantity>4</quantity> + </item> + </items> + </buyItems> + </soapenv:Body> +</soapenv:Envelope></div> + + +<p> + Each instance of the <i>ShoppingCart</i> stateful session bean hosted on the remote EJB container + maintains a state which keeps track of the number and the total price of the items + added via its <i>addItem(String itemId, int count)</i> method. The <i>float getTotal()</i> and + <i>int getItemCount()</i> methods are used to retrieve this state. + </p> + +<p> + When the <i>BuyAllProxy</i> receives the above request, it iterates over all <item> elements + in the request and calls the <i>addItem()</i> method on the <i>ShoppingCart</i> bean, + once per each <item>, using the EJB mediator. Since the <i>sessionId</i> used for these + invocations is actually the message ID, each request works on a new <i>ShoppingCart</i> instance + which is created at the first EJB mediator invocation in that request's flow. + </p> + +<p> + When all <i>addItem()</i> method calls are finished, <i>getItemCount()</i> and <i>getTotal()</i> methods + are invoked on the same <i>ShoppingCart</i> instance within the <i>collector</i> sequence and + results are stored in two message context properties named <i>ITEM_COUNT</i> and <i>TOTAL</i>. + The last EJB call on the shopping cart sets the EJB mediator attribute <i>remove = "true"</i> + instructing the current stateful bean stub to be removed from the beanstalk. This is because the + same stateful bean instance will not be used again (each request uses a new bean instance). If the + user does not explicitly remove the stub using this attribute, it will be removed automatically + upon timeout as specified by the beanstalk configuration. + </p> + +<p> + Finally, the PayloadFactory mediator is used to build the response message which is sent back to the + client. + </p> + +<p>A sample response is shown below.</p> + + +<div class="xmlConf"><?xml version="1.0" encoding="UTF-8"?> +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <buyAllResponse> + <itemCount>7</itemCount> + <total>807.0</total> + </buyAllResponse> + </soapenv:Body> +</soapenv:Envelope></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/userguide/samples/sample59.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample59.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample59.html (added) +++ synapse/site/userguide/samples/sample59.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,470 @@ +<!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 59</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 59: Weighted Round-Robin loadbalancing between 3 endpoints<a name="Sample_59:_Weighted_Round-Robin_loadbalancing_between_3_endpoints"></a></h2> + +<div class="xmlConf"><?xml version="1.0" encoding="UTF-8"?> +<definitions xmlns="http://ws.apache.org/ns/synapse"> + <sequence name="main" onError="errorHandler"> + <in> + <send> + <endpoint> + <loadbalance + algorithm="org.apache.synapse.endpoints.algorithms.WeightedRoundRobin"> + <endpoint> + <address uri="http://localhost:9001/services/LBService1"> + <enableAddressing/> + <suspendOnFailure> + <initialDuration>20000</initialDuration> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + </address> + <property name="loadbalance.weight" value="1"/> + </endpoint> + <endpoint> + <address uri="http://localhost:9002/services/LBService1"> + <enableAddressing/> + <suspendOnFailure> + <initialDuration>20000</initialDuration> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + </address> + <property name="loadbalance.weight" value="2"/> + </endpoint> + <endpoint> + <address uri="http://localhost:9003/services/LBService1"> + <enableAddressing/> + <suspendOnFailure> + <initialDuration>20000</initialDuration> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + </address> + <property name="loadbalance.weight" value="3"/> + </endpoint> + </loadbalance> + </endpoint> + </send> + <drop/> + </in> + <out> + <send/> + </out> + </sequence> + <sequence name="errorHandler"> + <makefault response="true"> + <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/> + <reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/> + </makefault> + <send/> + </sequence> +</definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Objective: Demonstrate the weighted load balancing among a set of +endpoints + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li>Start ESB with sample configuration 59. (i.e. wso2esb-samples -sn 59) </li> + + +<li>Deploy the LoadbalanceFailoverService and start three instances of sample Axis2 server as mentioned in sample 52.</li> + + +<li>Above configuration sends messages with the weighted loadbalance behaviour. Weight of each leaf + address endpoint is defined by integer value of "loadbalance.weight" property associated with each endpoint. + If weight of a endpoint is x, x number of requests will send to that endpoint before switch to next active endpoint. + <br />To test this, run the loadbalancefailover client to send 100 requests as follows: </li> + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + Invoke the sample client as follows + </p> + +<div class="command">ant loadbalancefailover -Di=100</div> + +<p>This client sends 100 requests to the LoadbalanceFailoverService through + ESB. ESB will distribute the load among the three endpoints mentioned in the + configuration in weighted round-robin manner. LoadbalanceFailoverService appends the + name of the server to the response, so that client can determine which server + has processed the message. If you examine the console output of the client, + you can see that requests are processed by three servers as follows: </p> + +<div class="consoleOutput">[java] Request: 1 ==> Response from server: MyServer1 + [java] Request: 2 ==> Response from server: MyServer2 + [java] Request: 3 ==> Response from server: MyServer2 + [java] Request: 4 ==> Response from server: MyServer3 + [java] Request: 5 ==> Response from server: MyServer3 + [java] Request: 6 ==> Response from server: MyServer3 + [java] Request: 7 ==> Response from server: MyServer1 + [java] Request: 8 ==> Response from server: MyServer2 + [java] Request: 9 ==> Response from server: MyServer2 + [java] Request: 10 ==> Response from server: MyServer3 + [java] Request: 11 ==> Response from server: MyServer3 + [java] Request: 12 ==> Response from server: MyServer3 + ... + </div> + +<p>As logs, endpoint with weight 1 received a 1 request and endpoint with weight 2 received 2 + requests and etc... in a cycle</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/sample61.html URL: http://svn.apache.org/viewvc/synapse/site/userguide/samples/sample61.html?rev=1777276&view=auto ============================================================================== --- synapse/site/userguide/samples/sample61.html (added) +++ synapse/site/userguide/samples/sample61.html Wed Jan 4 10:30:06 2017 @@ -0,0 +1,417 @@ +<!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 61</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 61: Routing message to 3 static recipients<a name="Sample_61:_Routing_message_to_3_static_recipients"></a></h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + <sequence name="errorHandler"> + <makefault response="true"> + <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver" /> + <reason value="COULDN'T SEND THE MESSAGE TO THE SERVER." /> + </makefault> + <send /> + </sequence> + <sequence name="fault"> + <log level="full"> + <property name="MESSAGE" value="Executing default &quot;fault&quot; sequence" /> + <property name="ERROR_CODE" expression="get-property('ERROR_CODE')" /> + <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')" /> + </log> + <drop /> + </sequence> + <sequence name="main" onError="errorHandler"> + <in> + <property name="EP_LIST" value="http://localhost:9001/services/SimpleStockQuoteService,http://localhost:9002/services/SimpleStockQuoteService,http://localhost:9003/services/SimpleStockQuoteService"/> + <property name="OUT_ONLY" value="true" /> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" /> + <send> + <endpoint> + <recipientlist> + <endpoints value="{get-property('EP_LIST')}" max-cache="20" /> + </recipientlist> + </endpoint> + </send> + <drop/> + </in> + </sequence> +</definitions></div> + +<div class="section"> +<h3>Objective<a name="Objective"></a></h3> + +<p> + Objective: Routing message to 3 static recipients + </p> + </div> + +<div class="section"> +<h3>Pre-requisites<a name="Pre-requisites"></a></h3> + +<p> + </p> +<ul> + +<li>Start ESB with sample configuration 61. (i.e. wso2esb-samples -sn 61) </li> + + +<li>Start three instances of the sample Axis2 server on HTTP ports 9001, 9002 and 9003 and give unique names to each server. For instructions on starting the Axis2 server, see Starting the Axis2 server </li> + + </ul> + + </div> + +<div class="section"> +<h3>Executing the Client<a name="Executing_the_Client"></a></h3> + +<p> + Invoke the sample client as follows + </p> + +<div class="command">ant stockquote -Dmode=placeorder -Dtrpurl=http://localhost:8280/</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>
