You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by hi...@apache.org on 2011/12/22 17:16:05 UTC
svn commit: r1222320 [7/13] - in /synapse/branches/2.1/src: ./ site/
site/resources/ site/resources/css/ site/resources/images/ site/xdoc/
site/xdoc/userguide/ site/xdoc/userguide/samples/
site/xdoc/userguide/samples/setup/
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample252.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample252.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample252.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample252.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 252</title>
+ </properties>
+ <body>
+ <section name="Sample 252: Pure Text, Binary and POX Message Support with JMS">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <sequence name="text_proxy">
+ <log level="full"/>
+ <header name="Action" value="urn:placeOrder"/>
+ <script language="js">
+ var args = mc.getPayloadXML().toString().split(" ");
+ mc.setPayloadXML(
+ <placeOrder xmlns="http://services.samples">
+ <order xmlns="http://services.samples/xsd">
+ <price>{args[0]}</price>
+ <quantity>{args[1]}</quantity>
+ <symbol>{args[2]}</symbol>
+ </order>
+ </placeOrder>);
+ </script>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ <log level="full"/>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </sequence>
+
+ <sequence name="mtom_proxy">
+ <log level="full"/>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ <header name="Action" value="urn:oneWayUploadUsingMTOM"/>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/MTOMSwASampleService" optimize="mtom"/>
+ </endpoint>
+ </send>
+ </sequence>
+
+ <sequence name="pox_proxy">
+ <property action="set" name="OUT_ONLY" value="true"/>
+ <header name="Action" value="urn:placeOrder"/>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"
+ format="soap11"/>
+ </endpoint>
+ </send>
+ </sequence>
+
+ <sequence name="out">
+ <send/>
+ </sequence>
+
+ <proxy name="JMSFileUploadProxy" transports="jms">
+ <target inSequence="mtom_proxy" outSequence="out"/>
+ <parameter name="transport.jms.ContentType">
+ <rules>
+ <bytesMessage>application/octet-stream</bytesMessage>
+ </rules>
+ </parameter>
+ <parameter name="Wrapper">{http://services.samples/xsd}element</parameter>
+ </proxy>
+
+ <proxy name="JMSTextProxy" transports="jms">
+ <target inSequence="text_proxy" outSequence="out"/>
+ <parameter name="transport.jms.ContentType">
+ <rules>
+ <textMessage>text/plain</textMessage>
+ </rules>
+ </parameter>
+ <parameter name="Wrapper">{http://services.samples/xsd}text</parameter>
+ </proxy>
+
+ <proxy name="JMSPoxProxy" transports="jms">
+ <target inSequence="pox_proxy" outSequence="out"/>
+ <parameter name="transport.jms.ContentType">application/xml</parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrate the ability of Synapse to receive and mediate plain text, binary and
+ POX (Plain Old XML) messages over JMS.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Setup and start a JMS broker (Apache ActiveMQ can be used as the
+ JMS broker for this scenario. Refer <a href="setup/jms.html#pre">JMS setup guide</a>
+ for information on how to run ActiveMQ.)
+ </li>
+ <li>
+ Enable the JMS transport receiver of Synapse (Refer
+ <a href="setup/jms.html#listener">JMS setup guide</a> for more details)
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 252 (repository/conf/sample/synapse_sample_252.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 252<br/>
+ Windows: synapse.bat -sample 252
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ This configuration creates 3 JMS proxy services named JMSFileUploadProxy,
+ JMSTextProxy and JMSPoxProxy exposed over JMS queues with the same names as the
+ services. The first part of this example demonstrates the pure text message
+ support with JMS, where a user sends a space separated text message over JMS of
+ the form '<price> <qty> <symbol>'. Synapse converts this message
+ into a SOAP message and sends this to the placeOrder operation of the SimpleStockQuoteService.
+ Synapse uses the script mediator to transform the text message into a XML payload
+ using the JavaScript support available to tokenize the string. The proxy service
+ property named 'Wrapper' defines a custom wrapper element QName, to be used when
+ wrapping text/binary content into a SOAP envelope.
+ </p>
+ <p>
+ Execute JMS client as follows. This will post a pure text JMS message with the
+ content defined (e.g. '12.33 1000 ACP') to the specified JMS destination -
+ dynamicQueues/JMSTextProxy.
+ </p>
+ <div class="command">ant jmsclient -Djms_type=text -Djms_payload="12.33 1000 ACP" -Djms_dest=dynamicQueues/JMSTextProxy</div>
+ <p>
+ Following the logs, you will notice that Synapse received the JMS text message
+ and transformed it into a SOAP payload as follows. Notice that the wrapper element
+ '{http://services.samples/xsd}text' has been used to wrap the text message
+ content.
+ </p>
+ <div class="consoleOutput">[jms-Worker-1] INFO LogMediator To: , WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: ID:orcus.veithen.net-50631-1225235276233-1:0:1:1:1, Direction: request,
+Envelope:
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Body>
+ <axis2ns1:text xmlns:axis2ns1="http://services.samples/xsd">12.33 1000 ACP</axis2ns1:text>
+ </soapenv:Body>
+</soapenv:Envelope></div>
+ <p>
+ Then you can see how the script mediator creates a stock quote request by tokenizing
+ the text as follows.
+ </p>
+ <div class="consoleOutput">[jms-Worker-1] INFO LogMediator To: , WSAction: urn:placeOrder, SOAPAction: urn:placeOrder, MessageID: ID:orcus.veithen.net-50631-1225235276233-1:0:1:1:1, Direction: request,
+Envelope:
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Body>
+ <placeOrder xmlns="http://services.samples">
+ <order xmlns="http://services.samples/xsd">
+ <price>12.33</price>
+ <quantity>1000</quantity>
+ <symbol>ACP</symbol>
+ </order>
+ </placeOrder>
+ </soapenv:Body>
+</soapenv:Envelope></div>
+ <p>
+ This SOAP message is then sent to the SimpleStockQuoteService on the sample
+ Axis2 server. The sample Axis2 server will accept the one-way message and print
+ the following log:
+ </p>
+ <div class="consoleOutput">samples.services.SimpleStockQuoteService :: Accepted order for : 1000 stocks of ACP at $ 12.33</div>
+ <p>
+ The next section of this example demonstrates how a pure binary JMS message can
+ be received and processed through Synapse. The configuration creates a proxy
+ service named 'JMSFileUploadProxy' that accepts binary messages and wraps them
+ into a custom element '{http://services.samples/xsd}element'. The received
+ message is then forwarded to the MTOMSwASampleService using the SOAP action
+ 'urn:oneWayUploadUsingMTOM' while optimizing binary content using MTOM. To execute
+ this sample, use the JMS client to publish a pure binary JMS message containing
+ the file './../../repository/conf/sample/resources/mtom/asf-logo.gif' to the JMS
+ destination 'dynamicQueues/JMSFileUploadProxy' as follows:
+ </p>
+ <div class="command">ant jmsclient -Djms_type=binary -Djms_dest=dynamicQueues/JMSFileUploadProxy \
+ -Djms_payload=./../../repository/conf/sample/resources/mtom/asf-logo.gif</div>
+ <p>
+ Examining the Synapse logs will reveal that the binary content was received
+ over JMS and wrapped with the specified element into a SOAP infoset as follows:
+ </p>
+ <div class="consoleOutput">[jms-Worker-1] INFO LogMediator To: , WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: ID:orcus.veithen.net-50702-1225236039556-1:0:1:1:1, Direction: request,
+Envelope:
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Body>
+ <axis2ns1:element xmlns:axis2ns1="http://services.samples/xsd">R0lGODlhgw...AAOw==</axis2ns1:element>
+ </soapenv:Body>
+</soapenv:Envelope></div>
+ <p>
+ Thereafter the message is sent as a MTOM optimized message as specified by the
+ 'format=mtom' attribute of the endpoint, to the MTOMSwASampleService using the
+ SOAP action 'urn:oneWayUploadUsingMTOM'. Once received by the sample service,
+ it is saved into a temporary file and could be verified for correctness.
+ </p>
+ <div class="consoleOutput">Wrote to file : ./../../work/temp/sampleServer/mtom-4417.gif</div>
+ <p>
+ The final section of this example shows how a POX JMS message is received by Synapse
+ and sent to the SimpleStockQuoteService as a SOAP message. Use the JMS client as
+ follows to create a POX (Plain Old XML) message with a stock quote request payload
+ (without a SOAP envelope), and send it to the JMS destination 'dynamicQueues/JMSPoxProxy'
+ as follows:
+ </p>
+ <div class="command">ant jmsclient -Djms_type=pox -Djms_dest=dynamicQueues/JMSPoxProxy -Djms_payload=MSFT</div>
+ <p>
+ Synapse converts the POX message into a SOAP payload and sends to the
+ SimpleStockQuoteService after setting the SOAP action as 'urn:placeOrder'.
+ The sample Axis2 server displays a successful message on the receipt of the
+ message as:
+ </p>
+ <div class="consoleOutput">samples.services.SimpleStockQuoteService :: Accepted order for : 19211 stocks of MSFT at $ 172.39703010684752</div>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample253.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample253.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample253.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample253.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 253</title>
+ </properties>
+ <body>
+ <section name="Sample 253: One-way Bridging from JMS to HTTP and Replying with a 202 Accepted Response">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="JMStoHTTPStockQuoteProxy" transports="jms">
+ <target>
+ <inSequence>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ </inSequence>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <outSequence>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+
+ <proxy name="OneWayProxy" transports="http">
+ <target>
+ <inSequence>
+ <log level="full"/>
+ </inSequence>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <outSequence>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ This sample demonstrates the ability of Synapse to perform transport switching
+ between JMS and HTTP. It also shows how to configure a one-way HTTP proxy in
+ Synapse.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Setup and start a JMS broker (Apache ActiveMQ can be used as the
+ JMS broker for this scenario. Refer <a href="setup/jms.html#pre">JMS setup guide</a>
+ for information on how to run ActiveMQ.)
+ </li>
+ <li>
+ Enable the JMS transport receiver of Synapse (Refer
+ <a href="setup/jms.html#listener">JMS setup guide</a> for more details)
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 253 (repository/conf/sample/synapse_sample_253.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 253<br/>
+ Windows: synapse.bat -sample 253
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ This example invokes the one-way 'placeOrder' operation on the SimpleStockQuoteService
+ using the Axis2 ServiceClient.fireAndForget() API at the client. To test this,
+ run the sample client as follows and you will notice the one-way JMS message
+ flowing through Synapse into the sample Axis2 server instance over HTTP, and Axis2
+ acknowledging it with a HTTP 202 Accepted response.
+ </p>
+ <div class="command">ant stockquote -Dmode=placeorder -Dtrpurl="jms:/JMStoHTTPStockQuoteProxy?\
+transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory\
+&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory\
+&java.naming.provider.url=tcp://localhost:61616\
+&transport.jms.ContentTypeProperty=Content-Type&transport.jms.DestinationType=queue"</div>
+ <p>
+ The second example shows how Synapse could be made to respond with a HTTP 202
+ Accepted response to a request received. The proxy service simply logs the message
+ received and acknowledges it. To try this out, run the sample client as follows.
+ </p>
+ <div class="command">ant stockquote -Dmode=placeorder -Dtrpurl=http://localhost:8280/services/OneWayProxy</div>
+ <p>
+ On the Synapse console you could see the logged message, and if TCPMon was used
+ at the client, you would see the 202 Accepted response sent back to the client
+ from Synapse.
+ </p>
+ <div class="consoleOutput">HTTP/1.1 202 Accepted
+Content-Type: text/xml; charset=UTF-8
+Host: 127.0.0.1
+SOAPAction: "urn:placeOrder"
+Date: Sun, 06 May 2007 17:20:19 GMT
+Server: Synapse-HttpComponents-NIO
+Transfer-Encoding: chunked
+
+0</div>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample254.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample254.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample254.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample254.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 254</title>
+ </properties>
+ <body>
+ <section name="Sample 254: Using File System as the Transport Medium (Reading/Writing Files)">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="StockQuoteProxy" transports="vfs">
+ <parameter name="transport.vfs.FileURI">file:///home/user/test/in</parameter> <!--CHANGE-->
+ <parameter name="transport.vfs.ContentType">text/xml</parameter>
+ <parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
+ <parameter name="transport.PollInterval">15</parameter>
+ <parameter name="transport.vfs.MoveAfterProcess">file:///home/user/test/original</parameter> <!--CHANGE-->
+ <parameter name="transport.vfs.MoveAfterFailure">file:///home/user/test/original</parameter> <!--CHANGE-->
+ <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
+ <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
+
+ <target>
+ <endpoint>
+ <address format="soap12"
+ uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <outSequence>
+ <property name="transport.vfs.ReplyFileName"
+ expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')"
+ scope="transport"/>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ <send>
+ <endpoint>
+ <address uri="vfs:file:///home/user/test/out"/> <!--CHANGE-->
+ </endpoint>
+ </send>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Synapse can access the local file system using its VFS (Virtual File System)
+ transport receiver and sender. This way Synapse can read files in the local file
+ system as well as write to the local file system. This sample show cases the
+ Synapse VFS transport in action.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Create 3 new directories (folders) named 'in', 'out' and 'original' in a
+ suitable location in the local file system (eg: /home/user/test).
+ </li>
+ <li>
+ Open the repository/conf/sample/synapse_sample_254.xml file in a text
+ editor and. Then change the transport.vfs.FileURI, transport.vfs.MoveAfterProcess,
+ transport.vfs.MoveAfterFailure parameter values to the above in, original
+ and original directories respectively. Note that both 2nd and 3rd parameters
+ are pointed to the 'original' directory.
+ </li>
+ <li>
+ Change the endpoint in the out-sequence to point to the 'out' directory.
+ The prefix 'vfs' in the endpoint URL must not be removed or changed.
+ </li>
+ <li>
+ Enable the VFS transport receiver and sender for Synapse (refer VFS
+ setup guide for more information)
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 254 (repository/conf/sample/synapse_sample_254.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 254<br/>
+ Windows: synapse.bat -sample 254
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Copy the test.xml file in the repository/conf/sample/resources/vfs directory to
+ the directory given in transport.vfs.FileURI above (i.e the 'in' directory). This
+ file contains a simple stock quote request in XML/SOAP format.
+ </p>
+ <div class="consoleOutput"><?xml version='1.0' encoding='UTF-8'?>
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <soapenv:Body>
+ <m0:getQuote xmlns:m0="http://services.samples">
+ <m0:request>
+ <m0:symbol>IBM</m0:symbol>
+ </m0:request>
+ </m0:getQuote>
+ </soapenv:Body>
+</soapenv:Envelope></div>
+ <p>
+ VFS transport listener will pick the file from 'in' directory and send it to the
+ Axis2 service over HTTP. The request XML file will be backed up in the 'original'
+ directory. The response from the Axis2 server will be saved to the 'out' directory.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample255.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample255.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample255.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample255.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 255</title>
+ </properties>
+ <body>
+ <section name="Sample 255: Switching from File Transport (FTP) to the Mail Transport">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="StockQuoteProxy" transports="vfs">
+
+ <target>
+ <inSequence>
+ <header name="Action" value="urn:getQuote"/>
+ </inSequence>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <outSequence>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ <send>
+ <endpoint>
+ <address uri="mailto:user@host"/> <!--CHANGE-->
+ </endpoint>
+ </send>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+
+ <parameter name="transport.vfs.FileURI">vfs:ftp://guest:guest@localhost/test?vfs.passive=true</parameter> <!--CHANGE-->
+ <parameter name="transport.vfs.ContentType">text/xml</parameter>
+ <parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
+ <parameter name="transport.PollInterval">15</parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ In <a href="sample254.html">sample 254</a> we looked at how the VFS transport
+ can be used to read files from the local file system. VFS transport can also be
+ used to read files from FTP, SFTP and CIFS sites. This sample illustrates how to
+ read from a remote FTP site and send the content to a remote client as an e-mail.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
+
+ <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
+
+ <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div> <li>
+ This sample requires access to a FTP site and an e-mail account.
+ </li>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Enable the VFS transport listener for Synapse (refer VFS setup guide for
+ more details).
+ </li>
+ <li>
+ Enable the mail transport sender for Synapse
+ (refer <a href="setup/mail.html#mailTransportSender"> Mail transport setup</a>
+ guide for more details).
+ </li>
+ <li>
+ Create a new test directory in the FTP site.
+ </li>
+ <li>
+ Open the repository/conf/sample/synapse_sample_255.xml and edit the
+ transport.vfs.FileURI parameter to point to the test directory in the FTP
+ server. Also change the endpoint in the out sequence to point to your
+ e-mail account.
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 255 (repository/conf/sample/synapse_sample_255.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 255<br/>
+ Windows: synapse.bat -sample 255
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Copy the test.xml file in the repository/conf/sample/resources/vfs directory to
+ the directory given in transport.vfs.FileURI above (i.e the test directory in
+ FTP server). This file contains a simple stock quote request in XML/SOAP format.
+ </p>
+ <div class="consoleOutput"><?xml version='1.0' encoding='UTF-8'?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <soapenv:Body>
+ <m0:getQuote xmlns:m0="http://services.samples">
+ <m0:request>
+ <m0:symbol>IBM</m0:symbol>
+ </m0:request>
+ </m0:getQuote>
+ </soapenv:Body>
+</soapenv:Envelope></div>
+ <p>
+ VFS transport will pick up the file from the FTP site and send the content to
+ the stock quote service in Axis2 over HTTP. Response from Axis2 will be sent to
+ the mail endpoint as an e-mail. It should show up in the configured e-mail account
+ after a few seconds.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample256.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample256.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample256.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample256.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 256</title>
+ </properties>
+ <body>
+ <section name="Sample 256: Proxy Services with the Mail Transport">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="StockQuoteProxy" transports="mailto">
+
+ <target>
+ <inSequence>
+ <property name="senderAddress" expression="get-property('transport', 'From')"/>
+ <log level="full">
+ <property name="Sender Address" expression="get-property('senderAddress')"/>
+ </log>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </inSequence>
+ <outSequence>
+ <property name="Subject" value="Custom Subject for Response" scope="transport"/>
+ <header name="To" expression="fn:concat('mailto:', get-property('senderAddress'))"/>
+ <log level="full">
+ <property name="message" value="Response message"/>
+ <property name="Sender Address" expression="get-property('senderAddress')"/>
+ </log>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+
+ <parameter name="transport.mail.Address">synapse.demo.1@gmail.com</parameter>
+ <parameter name="transport.mail.Protocol">pop3</parameter>
+ <parameter name="transport.PollInterval">5</parameter>
+ <parameter name="mail.pop3.host">pop.gmail.com</parameter>
+ <parameter name="mail.pop3.port">995</parameter>
+ <parameter name="mail.pop3.user">synapse.demo.1</parameter>
+ <parameter name="mail.pop3.password">mailpassword</parameter>
+ <parameter name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
+ <parameter name="mail.pop3.socketFactory.fallback">false</parameter>
+ <parameter name="mail.pop3.socketFactory.port">995</parameter>
+ <parameter name="transport.mail.ContentType">application/xml</parameter>
+
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ This sample show cases the mail transport of Synapse. The mail transport allows
+ Synapse to receive and send e-mails using common protocols like POP, IMAP and
+ SMTP.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ You need access to an e-mail account to try out this sample
+ </li>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Enable the mail transport listener and mail transport sender for Synapse
+ (refer <a href="setup/mail.html#mailTransportSender">Mail transport setup</a>
+ guide for more details)
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 256 (repository/conf/sample/synapse_sample_256.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 256<br/>
+ Windows: synapse.bat -sample 256
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Send an e-mail to <a href="mailto:synapse.demo.1@gmail.com">synapse.demo.1@gmail.com</a>
+ with the following payload.
+ </p>
+ <div class="xmlConf"><getQuote xmlns="http://services.samples">
+ <request xmlns="http://services.samples/xsd">
+ <symbol>IBM</symbol>
+ </request>
+</getQuote></div>
+ <p>
+ Synapse will be polling on the above e-mail account for any incoming requests. When
+ your mail arrives at this account, Synapse will pick it up and send the payload to
+ Axis2 over HTTP. The response will be mailed back to your e-mail account. Synapse
+ retrieves the sender information from the original request to determine the recipient
+ of the response mail.
+ </p>
+ <p>
+ Note that in this sample we used the transport.mail.ContentType property to make
+ sure that the transport parses the request message as POX. If you remove this
+ property, you may still be able to send requests using a standard mail client if
+ instead of writing the XML in the body of the message, you add it as an attachment.
+ In that case, you should use .xml as a suffix for the attachment and format the
+ request as a SOAP 1.1 message. Indeed, for a file with suffix .xml the mail client
+ will most likely use text/xml as the content type, exactly as required for SOAP 1.1.
+ Sending a POX message using this approach will be a lot trickier, because most
+ standard mail clients don't allow the user to explicitly set the content type.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample257.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample257.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample257.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample257.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 257</title>
+ </properties>
+ <body>
+ <section name="Sample 257: Proxy Services with the FIX Transport">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="OrderProcesserProxy40" transports="fix">
+ <target>
+ <endpoint>
+ <address
+ uri="fix://localhost:19876?BeginString=FIX.4.0&SenderCompID=SYNAPSE&TargetCompID=EXEC"/>
+ </endpoint>
+ <inSequence>
+ <log level="full"/>
+ </inSequence>
+ <outSequence>
+ <log level="full"/>
+ <send/>
+ </outSequence>
+ </target>
+
+ <parameter name="transport.fix.AcceptorConfigURL">
+ file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter name="transport.fix.AcceptorMessageStore">file</parameter>
+ <parameter name="transport.fix.InitiatorConfigURL">
+ file:repository/conf/sample/resources/fix/synapse-sender.cfg
+ </parameter>
+ <parameter name="transport.fix.InitiatorMessageStore">file</parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ This sample demonstrates the FIX (Financial Information eXchange) transport of
+ Synapse. FIX transport allows Synapse to connect to remote FIX acceptors and
+ initiators and exchange finance data.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ You need a <a href="http://www.quickfixj.org">Quickfix/J</a> installation
+ to try out FIX samples. Please download and extract a Quickfix/J distribution
+ into your local machine.
+ </li>
+ <li>
+ Configure the Executor sample FIX application (shipped with Quickfix/J)
+ to receive messages from Synapse and start it (refer
+ <a href="setup/fix.html#exec">FIX setup guide</a> for more details).
+ </li>
+ <li>
+ Enable the FIX transport listener and sender for Synapse (refer
+ <a href="setup/fix.html#synapse">FIX setup guide</a> for details).
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 257 (repository/conf/sample/synapse_sample_257.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 257<br/>
+ Windows: synapse.bat -sample 257
+ </div>
+ If Executor is properly configured, Synapse should establish a FIX session
+ with the Executor upon startup. You should see some log entries confirming
+ the session logon event on Synapse console as well as Executor console.
+ </li>
+ <li>
+ Configure Banzai sample FIX application (shipped with Quickfix/J) to send
+ messages to Synapse and start it (refer <a href="setup/fix.html#banzai">FIX setup guide</a>
+ for more details). If Banzai was properly configured, it should establish
+ a FIX session with Synapse upon startup. You should see some session
+ logon messages on Synapse console and Banzai console.
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Send some FIX messages from Banzai to Synapse. Synapse will forward all requests
+ to Executor and get them processes. Responses from Executor will be routed back
+ to Banzai.
+ </p>
+ <p>
+ Synapse converts all received FIX messages into SOAP format. You can view these
+ SOAP messages from the Synapse log. When SOAP messages are sent to FIX endpoints,
+ Synapse converts them back into valid FIX messages. While FIX messages are flowing
+ through the service bus, you can perform various transformations and content based
+ routing on the FIX messages using the existing mediators like XSLT, XQuery, Filter
+ and Switch.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample258.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample258.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample258.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample258.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 258</title>
+ </properties>
+ <body>
+ <section name="Sample 258: Switching from HTTP to FIX">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="FIXProxy" transports="http">
+ <target>
+ <endpoint>
+ <address
+ uri="fix://localhost:19876?BeginString=FIX.4.0&SenderCompID=SYNAPSE&TargetCompID=EXEC"/>
+ </endpoint>
+
+ <inSequence>
+ <property name="transport.fix.ServiceName" value="FIXProxy" scope="axis2-client"/>
+ <log level="full"/>
+ </inSequence>
+
+ <outSequence>
+ <log level="full"/>
+ <send/>
+ </outSequence>
+ </target>
+
+ <parameter name="transport.fix.InitiatorConfigURL">
+ file:repository/conf/sample/resources/fix/synapse-sender.cfg
+ </parameter>
+ <parameter name="transport.fix.InitiatorMessageStore">file</parameter>
+ <parameter name="transport.fix.SendAllToInSequence">false</parameter>
+ <parameter name="transport.fix.DropExtraResponses">true</parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrates how to use the FIX transport in a transport switching scenario with
+ HTTP.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ You need a <a href="http://www.quickfixj.org">Quickfix/J</a> installation
+ to try out FIX samples. Please download and extract a Quickfix/J distribution
+ into your local machine.
+ </li>
+ <li>
+ Configure the Executor sample FIX application (shipped with Quickfix/J)
+ to receive messages from Synapse and start it (refer
+ <a href="setup/fix.html#exec">FIX setup guide</a> for more details).
+ </li>
+ <li>
+ Enable the FIX transport sender for Synapse (refer
+ <a href="setup/fix.html#synapse">FIX setup guide</a> for details).
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 258 (repository/conf/sample/synapse_sample_258.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 258<br/>
+ Windows: synapse.bat -sample 258
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Go to the samples/axis2Client directory and invoke the sample FIX/HTTP client as
+ follows.
+ </p>
+ <div class="command">ant fixclient -Dsymbol=IBM -Dqty=5 -Dmode=buy -Daddurl=http://localhost:8280/services/FIXProxy</div>
+ <p>
+ This command sends a HTTP request to the FIXProxy on Synapse. The message is
+ converted into a FIX message and sent to the Executor sample application. Executor
+ will send two responses for this request (receive ack and the execution report) and
+ Synapse will send the first response back to the HTTP client. (Synapse can't send
+ both responses back, since HTTP does not allow sending two responses to the same
+ request)
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample259.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample259.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample259.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample259.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 259</title>
+ </properties>
+ <body>
+ <section name="Sample 259: Switch from FIX to HTTP">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <localEntry key="xslt-key-req"
+ src="file:repository/conf/sample/resources/transform/transform_fix_to_http.xslt"/>
+
+ <proxy name="FIXProxy" transports="fix">
+ <target>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <inSequence>
+ <log level="full"/>
+ <xslt key="xslt-key-req"/>
+ <log level="full"/>
+ </inSequence>
+ <outSequence>
+ <log level="full"/>
+ </outSequence>
+ </target>
+ <parameter name="transport.fix.AcceptorConfigURL">
+ file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter name="transport.fix.AcceptorMessageStore">file</parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ In <a href="sample258.html">sample 258</a> we looked at how to forward HTTP
+ requests over a FIX session. This sample demonstrates how to send a FIX message
+ to an HTTP endpoint.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ You need a <a href="http://www.quickfixj.org">Quickfix/J</a> installation
+ to try out FIX samples. Please download and extract a Quickfix/J distribution
+ into your local machine.
+ </li>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Enable the FIX transport receiver for Synapse (refer
+ <a href="setup/fix.html#synapse">FIX setup guide</a> for details)
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 259 (repository/conf/sample/synapse_sample_259.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 259<br/>
+ Windows: synapse.bat -sample 259
+ </div>
+ </li>
+ <li>
+ Configure Banzai sample FIX application (shipped with Quickfix/J) to send
+ messages to Synapse and start it (refer <a href="setup/fix.html#banzai">FIX setup guide</a>
+ for more details). If Banzai was properly configured, it should establish
+ a FIX session with Synapse upon startup. You should see some session logon
+ messages on Synapse console and Banzai console.
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ This sample expects a Limit order from Banzai to be received by Synapse and
+ transformed into a place order request in SOAP format. To try it out send a
+ 'Limit' order request from Banzai to Synapse. Synapse will convert it into a
+ place order request and send to the Axis2 server over HTTP. The stock quote
+ service in Axis2 will print the following log when it receives the in-only
+ place order request.
+ </p>
+ <div class="consoleOutput">Accepted order for : 18406 stocks of MSFT at $ 83.58806051152119</div>
+ <p>
+ Note that the request sent from Banzai must be of type 'Limit'. Otherwise the
+ XSLT transformation will not work as expected and Axis2 will receive an invalid
+ request. Also since the place order requests are one-way messages, Banzai is not
+ supposed to receive any response in this case.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample260.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample260.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample260.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample260.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 260</title>
+ </properties>
+ <body>
+ <section name="Sample 260:Switch from FIX to AMQP">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="FIXProxy" transports="fix">
+ <target>
+ <endpoint>
+ <address
+ uri="jms:/QpidStockQuoteService?transport.jms.ConnectionFactoryJNDIName=qpidConnectionfactory&java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/sample/resources/fix/conn.properties&transport.jms.ReplyDestination=replyQueue"/>
+ </endpoint>
+ <inSequence>
+ <log level="full"/>
+ </inSequence>
+ <outSequence>
+ <property name="transport.fix.ServiceName" value="FIXProxy" scope="axis2-client"/>
+ <log level="full"/>
+ <send/>
+ </outSequence>
+ </target>
+ <parameter name="transport.fix.AcceptorConfigURL">
+ file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter name="transport.fix.AcceptorMessageStore">
+ file
+ </parameter>
+ </proxy>
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrate the capability of switching between FIX and AMQP protocols
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ You will need the sample FIX blotter that comes with Quickfix/J (Banzai). Configure the blotter to establish sessions with Synapse. (refer
+ <a href="setup/fix.html#synapse">FIX setup guide</a> for details)
+ </li>
+ <li>
+ Configure the AMQP transport for Synapse. See Configure Synapse for <a href="setup/jms.html#amqp"> AMQP Transport setup</a> for detail
+ </li>
+ <li>
+ To get an idea about the various transport parameters being used in this sample see FIX Transport Parameters .
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Start the AMQP consumer, by switching to samples/axis2Client directory and running the consumer using the following command. Consumer will listen to the queue 'QpidStockQuoteService', accept the orders and reply to the queue 'replyQueue'.
+ </p>
+ <div class="command">ant amqpconsumer -Dpropfile=$SYNAPSE_HOME/repository/conf/sample/resources/fix/direct.properties</div>
+ <p>
+ Open up the SYNAPSE_HOME/repository/conf/sample/synapse_sample_260.xml file
+ and make sure that the transport.fix.AcceptorConfigURL property points
+ to the fix-synapse.cfg file you created. Once done you can start the
+ Synapse configuration numbered 260: i.e. synapse -sample 260. Note that
+ Synapse creates a new FIX session with Banzai at this point.
+ </p>
+ <p>
+ Send an order request from Banzai to Synapse. e.g. Buy DELL 1000 @ MKT.
+ </p>
+ <p>
+ Synapse will forward the order request by binding it to a JMS message payload and sending it to the AMQP consumer. AMQP consumer will send a execution back to Banzai.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample261.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample261.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample261.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample261.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 261</title>
+ </properties>
+ <body>
+ <section name="Sample 261: Switch Between Different FIX Versions">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="OrderProcesserProxy41" transports="fix">
+ <target>
+ <endpoint>
+ <address
+ uri="fix://localhost:19877?BeginString=FIX.4.1&SenderCompID=SYNAPSE&TargetCompID=EXEC"/>
+ </endpoint>
+ <inSequence>
+ <log level="full"/>
+ </inSequence>
+ <outSequence>
+ <log level="full"/>
+ <send/>
+ </outSequence>
+ </target>
+ <parameter name="transport.fix.AcceptorConfigURL">
+ file:repository/conf/sample/resources/fix/fix-synapse-m40.cfg
+ </parameter>
+ <parameter name="transport.fix.AcceptorMessageStore">file</parameter>
+ <parameter name="transport.fix.InitiatorConfigURL">
+ file:repository/conf/sample/resources/fix/synapse-sender-m.cfg
+ </parameter>
+ <parameter name="transport.fix.InitiatorMessageStore">file</parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrate the ability of Synapse to switch between FIX versions (eg: FIX 4.0
+ to FIX 4.1)
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ You need a <a href="http://www.quickfixj.org">Quickfix/J</a> installation
+ to try out FIX samples. Please download and extract a Quickfix/J distribution
+ into your local machine.
+ </li>
+ <li>
+ Enable the FIX transport listener and sender for Synapse (refer
+ <a href="setup/fix.html#synapse">FIX setup guide</a> for details).
+ </li>
+ <li>
+ Configure the Executor sample FIX application (shipped with Quickfix/J)
+ to receive messages from Synapse and start it (refer <a href="setup/fix.html#exec">FIX setup guide</a>
+ for more details). In previous samples we only had a FIX 4.0 session configured
+ for Executor. For this sample we should configure a FIX 4.1 session for
+ Executor. Therefore before starting it add the following entries to the
+ configuration file of Executor (executor.cfg).
+ <div class="consoleOutput">[session]
+BeginString=FIX.4.1
+SocketAcceptPort=19877</div>
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 261 (repository/conf/sample/synapse_sample_261.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 261<br/>
+ Windows: synapse.bat -sample 261
+ </div>
+ If Executor is properly configured, Synapse should establish a FIX 4.1 session
+ with the Executor upon startup. You should see some log entries confirming
+ the session logon event on Synapse console as well as Executor console.
+ </li>
+ <li>
+ Configure Banzai sample FIX application (shipped with Quickfix/J) to send
+ messages to Synapse and start it (refer <a href="setup/fix.html#banzai">FIX setup guide</a>
+ for more details). You should also add the following entry to the Banzai
+ configuration file before starting it (replace $SYNAPSE_HOME with the
+ actual path to Synapse home).
+ <div class="consoleOutput">DataDictionary=$SYNAPSE_HOME/repository/conf/sample/resources/fix/FIX40-synapse.xml</div>
+ If Banzai was properly configured, it should establish a FIX 4.0 session with
+ Synapse upon startup. You should see some session logon messages on Synapse
+ console and Banzai console.
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Send some FIX messages from Banzai to Synapse. Synapse will forward all requests
+ to Executor and get them processes. Responses from Executor will be routed back
+ to Banzai.
+ </p>
+ <p>
+ Note that the session between Banzai and Synapse is a FIX 4.0 session whereas
+ the session between Synapse and Execurot is a FIX 4.1 session. Synapse receives
+ FIX 4.0 messages and simply forwards them to the FIX 4.1 endpoint.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample262.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample262.xml?rev=1222320&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample262.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample262.xml Thu Dec 22 16:16:02 2011
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 262</title>
+ </properties>
+ <body>
+ <section name="Sample 262: Content Based Routing of FIX Messages">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <sequence name="CBR_SEQ">
+ <in>
+ <switch source="//message/body/field[@id='55']">
+ <case regex="GOOG">
+ <send>
+ <endpoint>
+ <address
+ uri="fix://localhost:19876?BeginString=FIX.4.0&SenderCompID=SYNAPSE&TargetCompID=EXEC"/>
+ </endpoint>
+ </send>
+ </case>
+ <case regex="MSFT">
+ <send>
+ <endpoint>
+ <address
+ uri="fix://localhost:19877?BeginString=FIX.4.1&SenderCompID=SYNAPSE&TargetCompID=EXEC"/>
+ </endpoint>
+ </send>
+ </case>
+ <default/>
+ </switch>
+ </in>
+ <out>
+ <send/>
+ </out>
+ </sequence>
+
+ <proxy name="FIXProxy" transports="fix">
+ <target inSequence="CBR_SEQ"/>
+ <parameter name="transport.fix.AcceptorConfigURL">
+ file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter name="transport.fix.AcceptorMessageStore">
+ file
+ </parameter>
+ <parameter name="transport.fix.InitiatorConfigURL">
+ file:repository/conf/sample/resources/fix/synapse-sender.cfg
+ </parameter>
+ <parameter name="transport.fix.InitiatorMessageStore">
+ file
+ </parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Show case the ability of Synapse to route FIX messages based on the content they
+ carry.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ You need a <a href="http://www.quickfixj.org">Quickfix/J</a> installation
+ to try out FIX samples. Please download and extract a Quickfix/J distribution
+ into your local machine.
+ </li>
+ <li>
+ Configure the Executor sample FIX application (shipped with Quickfix/J)
+ to receive messages from Synapse and start it (refer <a href="setup/fix.html#exec">FIX setup guide</a>
+ for more details). In previous samples we only had a FIX 4.0 session configured
+ for Executor. For this sample we should also configure a FIX 4.1 session for
+ Executor. Therefore before starting it add the following entries to the
+ configuration file of Executor. (Do not remove or change the FIX 4.0
+ configuration already available in this file)
+ <div class="consoleOutput">[session]
+BeginString=FIX.4.1
+SocketAcceptPort=19877</div>
+ </li>
+ <li>
+ Enable the FIX transport listener and sender for Synapse (refer
+ <a href="setup/fix.html#synapse">FIX setup guide</a> for details).
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 262 (repository/conf/sample/synapse_sample_262.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 262<br/>
+ Windows: synapse.bat -sample 262
+ </div>
+ If the Executor was configured properly Synapse should establish 2 sessions
+ with Executor upon startup (FIX 4.0 session and FIX 4.1 session)
+ </li>
+ <li>
+ Configure Banzai sample FIX application (shipped with Quickfix/J) to send
+ messages to Synapse and start it (refer <a href="setup/fix.html#banzai">FIX setup guide</a>
+ for more details). You should also add the following entry to the Banzai
+ configuration file before starting it (replace $SYNAPSE_HOME with the actual
+ path to Synapse home).
+ <div class="consoleOutput">DataDictionary=$SYNAPSE_HOME/repository/conf/sample/resources/fix/FIX40-synapse.xml</div>
+ If Banzai was properly configured, it should establish a FIX 4.0 session with
+ Synapse upon startup. You should see some session logon messages on Synapse
+ console and Banzai console.
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Send some order requests from Banzai to Synapse containing the synbols 'GOOG' and
+ 'MSFT'. Synapse will forward the messages with the symbol 'GOOG' to the FIX 4.0
+ session. Messages containing the symbol 'MSFT' will be sent to the FIX 4.1 session.
+ Any other messages will be simply dropped by the service bus since the default case
+ of the switch mediator has been kept empty.
+ </p>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file