You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ka...@apache.org on 2011/12/23 12:55:09 UTC
svn commit: r1222651 [7/14] - in /synapse/branches/2.1: ./
modules/distribution/ modules/distribution/src/main/assembly/
modules/documentation/ modules/documentation/src/
modules/documentation/src/site/ modules/documentation/src/site/resources/
modules...
Added: synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample2.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample2.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample2.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample2.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,104 @@
+<?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 2</title>
+ </properties>
+ <body>
+ <section name="Sample 2: CBR with Switch Case Mediator">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <sequence name="main">
+ <switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="http://services.samples">
+ <case regex="IBM">
+ <!-- the property mediator sets a local property on the *current* message -->
+ <property name="symbol" value="Great stock - IBM"/>
+ </case>
+ <case regex="MSFT">
+ <property name="symbol" value="Are you sure? - MSFT"/>
+ </case>
+ <default>
+ <!-- it is possible to assign the result of an XPath expression as well -->
+ <property name="symbol" expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)"/>
+ </default>
+ </switch>
+ <log level="custom">
+ <!-- the get-property() XPath extension function allows the lookup of local message properties
+ as well as properties from the Axis2 or Transport contexts (i.e. transport headers) -->
+ <property name="symbol" expression="get-property('symbol')"/>
+ <!-- the get-property() function supports the implicit message headers To/From/Action/FaultTo/ReplyTo -->
+ <property name="epr" expression="get-property('To')"/>
+ </log>
+ <!-- Send the messages where they are destined to (i.e. the 'To' EPR of the message) -->
+ <send/>
+ </sequence>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Introduction to the switch-case mediator and manipulating properties set on the
+ messages.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 2 (repository/conf/sample/synapse_sample_2.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 2<br/>
+ Windows: synapse.bat -sample 2
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Execute the sample Axis2 client in the smart client using different symbols
+ such as IBM, MSFT and SUN.
+ </p>
+ <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</div>
+ <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=MSFT</div>
+ <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=SUN</div>
+
+ <p>
+ When the symbol IBM is requested, viewing the mediation logs you will see that
+ the switch mediator's first case for 'IBM' is executed and a local property named
+ 'symbol' is set to 'Great stock - IBM'. Subsequently this local property value
+ is looked up by the log mediator and logged using the 'get-property()' XPath
+ extension function.
+ </p>
+ <div class="consoleOutput">INFO LogMediator - symbol = Great stock - IBM, epr = http://localhost:9000/axis2/services/SimpleStockQuoteService</div>
+
+ <p>
+ Similarly for the symbol 'MSFT' the second case statement in the switch mediator
+ will be executed which will result in the following log.
+ </p>
+ <div class="consoleOutput">INFO LogMediator - symbol = Are you sure? - MSFT, epr = http://localhost:9000/axis2/services/SimpleStockQuoteService</div>
+ </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/modules/documentation/src/site/xdoc/userguide/samples/sample200.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample200.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample200.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample200.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,102 @@
+<?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 200</title>
+ </properties>
+ <body>
+ <section name="Sample 200: Engaging WS-Security on Proxy Services">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <localEntry key="sec_policy" src="file:repository/conf/sample/resources/policy/policy_3.xml"/>
+
+ <proxy name="StockQuoteProxy">
+ <target>
+ <inSequence>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </inSequence>
+ <outSequence>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ <enableSec/>
+ <policy key="sec_policy"/>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrates how to secure a proxy service using WS-Security and WS-Policy
+ standards
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Download and install the Java Cryptography Extension (JCE) unlimited
+ strength policy files for your JDK
+ </li>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 200 (repository/conf/sample/synapse_sample_200.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 200<br/>
+ Windows: synapse.bat -sample 200
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ The proxy service expects to receive a signed and encrypted message as specified
+ by the security policy. Please see Apache Rampart and Axis2 documentation on the
+ format of the policy file. The element 'enableSec' specifies that Apache Rampart
+ should be engaged on this proxy service. Hence if Rampart rejects any request
+ messages that does not conform to the specified policy, those messages will
+ never reach the 'inSequence' to be processed. To execute the client, send a stock
+ quote request to the proxy service, and sign and encrypt the request by specifying
+ the client side security policy as follows:
+ </p>
+ <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dpolicy=./../../repository/conf/sample/resources/policy/client_policy_3.xml</div>
+ <p>
+ By following through the debug logs or TCPMon output, you can see that the
+ request received by the proxy service is signed and encrypted. Also, looking up
+ the WSDL of the proxy service by requesting the URL http://localhost:8280/services/StockQuoteProxy?wsdl
+ reveals that the security policy is attached to the provided base WSDL. When
+ sending the message to the backend service, you can verify that the security
+ headers are removed. The response received from Axis2 does not use WS-Security,
+ but the response forwarded back to the client is signed and encrypted as
+ expected by the client.
+ </p>
+ </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/modules/documentation/src/site/xdoc/userguide/samples/sample201.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample201.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample201.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample201.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,89 @@
+<?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 201</title>
+ </properties>
+ <body>
+ <section name="Sample 201: Reliable Communication Between the Client and Proxy Services Using WS-ReliableMessaging">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="StockQuoteProxy">
+ <target>
+ <inSequence>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </inSequence>
+ <outSequence>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ <enableRM/>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Show case how to engage WS-ReliableMessaging on proxy services so that the
+ communication between client and the proxy service is reliable
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 201 (repository/conf/sample/synapse_sample_201.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 201<br/>
+ Windows: synapse.bat -sample 201
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ In the above configuration, a proxy service is created with WS-RM enabled using
+ the <enableRM/> tag. Therefore, this proxy service is capable of
+ communicating with a WS-RM client. It also removes the WS-RM headers in the
+ inSequence before the message is sent to the backend server. This is required as
+ the reliable messaging is applicable only between the client and Synapse. Now
+ start the client with WS-RM as follows:
+ </p>
+ <div class="command">ant stockquote -Dsymbol=IBM -Dmode=quote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dwsrm=true</div>
+ <p>
+ In this case, client sends a WS-RM enabled request to Synapse where Synapse sends
+ normal requests to the server. This can be observed by examining the wire level
+ messages between the client and Synapse. These messages would be similar to the
+ wire level messages shown in <a href="sample101.html">sample 101</a>.
+ </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/modules/documentation/src/site/xdoc/userguide/samples/sample202.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample202.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample202.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample202.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,78 @@
+<?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 202</title>
+ </properties>
+ <body>
+ <section name="Sample 202: ">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="StockQuoteProxy">
+ <target>
+ <inSequence>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </inSequence>
+ <outSequence>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ <enableRM/>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 202 (repository/conf/sample/synapse_sample_202.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 202<br/>
+ Windows: synapse.bat -sample 202
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <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>
+ </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/modules/documentation/src/site/xdoc/userguide/samples/sample250.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample250.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample250.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample250.xml Fri Dec 23 11:55:05 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 250</title>
+ </properties>
+ <body>
+ <section name="Sample 250:Introduction to Transport Switching - JMS to HTTP/S ">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="StockQuoteProxy" transports="jms">
+ <target>
+ <inSequence>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ </inSequence>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <outSequence>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ <parameter name="transport.jms.ContentType">
+ <rules>
+ <jmsProperty>contentType</jmsProperty>
+ <default>application/xml</default>
+ </rules>
+ </parameter>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrate the ability of Synapse to perform transport switching (i.e. receiving
+ messages over one transport and forwarding them over a different transport)
+ </p>
+ </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 250 (repository/conf/sample/synapse_sample_250.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 250<br/>
+ Windows: synapse.bat -sample 250
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ In this sample we are using a proxy service exposed over JMS (note the transports=jms
+ attribute). If you check the WSDL of the proxy service using a web browser you
+ will notice that it only has JMS endpoints.
+ </p>
+ <p>
+ Run the sample JMS client by switching to the samples/axis2Client directory and
+ executing the following command.
+ </p>
+ <div class="command">ant jmsclient -Djms_type=pox -Djms_dest=dynamicQueues/StockQuoteProxy -Djms_payload=MSFT</div>
+ <p>
+ This will send a plain XML formatted place order request to a JMS queue named
+ 'StockQuoteProxy'. Synapse will be polling on this queue for any incoming messages
+ so it will pick up the request. If you run Synapse in the DEBUG mode, following
+ entry will be printed on the console.
+ </p>
+ <div class="consoleOutput">[JMSWorker-1] DEBUG ProxyServiceMessageReceiver -Proxy Service StockQuoteProxy received a new message...</div>
+ <p>
+ Then Synapse will mediate the request through the service bus and forward it to
+ the sample Axis2 server over HTTP. Axis2 server will print the following entry
+ on the console when it receives the request.
+ </p>
+ <div class="consoleOutput">Accepted order for : 16517 stocks of MSFT at $ 169.14622538721846</div>
+ <p>
+ Note that the operation is out-only and no response is sent back to the client.
+ The transport.jms.ContentType property is necessary to allow the JMS transport
+ to determine the content type of incoming messages. With the given configuration
+ it will first try to read the content type from the 'contentType' message property
+ and fall back to 'application/xml' (i.e. POX) if this property is not set. Note
+ that the JMS client used in this example doesn't send any content type
+ information.
+ </p>
+ <p>
+ It is also important to note that the name of the source JMS queue is same as the
+ name of the proxy service (StockQuoteProxy). This is the default behavior of
+ Synapse. Each proxy service by default listens on a JMS queue which has the same
+ name as the service. It is possible to instruct a JMS proxy service to listen to
+ an already existing destination without creating a new one. To do this, use the
+ parameter elements on the proxy service definition to specify the destination
+ and connection factory information. An example is given below.
+ </p>
+ <div class="xmlConf"><parameter name="transport.jms.Destination">dynamicTopics/something.TestTopic</parameter></div>
+ <p>
+ With the above parameter in the proxy configuration, proxy service will listen
+ on a JMS topic named 'something.TestTopic' for incoming requests.
+ </p>
+ </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/modules/documentation/src/site/xdoc/userguide/samples/sample251.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample251.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample251.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample251.xml Fri Dec 23 11:55:05 2011
@@ -0,0 +1,101 @@
+<?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 251</title>
+ </properties>
+ <body>
+ <section name="Sample 251: Switching from HTTP/S to JMS">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <proxy name="StockQuoteProxy" transports="http">
+ <target>
+ <endpoint>
+ <address
+ uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
+ </endpoint>
+ <inSequence>
+ <property action="set" name="OUT_ONLY" value="true"/>
+ </inSequence>
+ <outSequence>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ This sample demonstrates receiving messages over HTTP/S and forwarding them to
+ a JMS queue
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Setup and start a JMS broker (Apache ActiveMQ can be used as the
+ JMS broker for this scenario. Refer <a href="setup/jms.html#pre">JMS setup guide</a>
+ for information on how to run ActiveMQ.)
+ </li>
+ <li>
+ Enable the JMS transport receiver of the sample Axis2 server (Refer
+ <a href="setup/jms.html#server">JMS setup guide</a> for details)
+ </li>
+ <li>
+ Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 (Since
+ the JMS receiver is enabled, Axis2 will start polling on a JMS queue)
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 251 (repository/conf/sample/synapse_sample_251.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 251<br/>
+ Windows: synapse.bat -sample 251
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ This Synapse configuration creates a proxy service over HTTP and forwards
+ received messages to a JMS queue. To test this functionality, send a place order
+ request to Synapse over HTTP as follows.
+ </p>
+ <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=placeorder -Dsymbol=MSFT</div>
+ <p>
+ Note that the target endpoint of the proxy service points to a JMS queue in the
+ ActiveMQ broker.
+ </p>
+ <div class="consoleOutput">jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=
+QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&
+java.naming.provider.url=tcp://localhost:61616</div>
+ <p>
+ The sample Axis2 server will pick up the message from the JMS queue and print the
+ following log entry.
+ </p>
+ <div class="consoleOutput">Accepted order for : 18406 stocks of MSFT at $ 83.58806051152119</div>
+ </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/modules/documentation/src/site/xdoc/userguide/samples/sample252.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample252.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample252.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample252.xml Fri Dec 23 11:55:05 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/modules/documentation/src/site/xdoc/userguide/samples/sample253.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample253.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample253.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample253.xml Fri Dec 23 11:55:05 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/modules/documentation/src/site/xdoc/userguide/samples/sample254.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample254.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample254.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample254.xml Fri Dec 23 11:55:05 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/modules/documentation/src/site/xdoc/userguide/samples/sample255.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample255.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample255.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample255.xml Fri Dec 23 11:55:05 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/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml Fri Dec 23 11:55:05 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/modules/documentation/src/site/xdoc/userguide/samples/sample257.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample257.xml?rev=1222651&view=auto
==============================================================================
--- synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample257.xml (added)
+++ synapse/branches/2.1/modules/documentation/src/site/xdoc/userguide/samples/sample257.xml Fri Dec 23 11:55:05 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