You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by as...@apache.org on 2007/10/31 12:56:56 UTC
svn commit: r590632 - in /webservices/synapse/trunk/java:
repository/conf/sample/ repository/conf/sample/resources/vfs/
src/site/resources/
Author: asankha
Date: Wed Oct 31 04:56:55 2007
New Revision: 590632
URL: http://svn.apache.org/viewvc?rev=590632&view=rev
Log:
fix https://issues.apache.org/jira/browse/SYNAPSE-166
by applying patch from Upul
Added:
webservices/synapse/trunk/java/repository/conf/sample/resources/vfs/
webservices/synapse/trunk/java/repository/conf/sample/resources/vfs/test.xml
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_115.xml
Modified:
webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html
Added: webservices/synapse/trunk/java/repository/conf/sample/resources/vfs/test.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/resources/vfs/test.xml?rev=590632&view=auto
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/resources/vfs/test.xml (added)
+++ webservices/synapse/trunk/java/repository/conf/sample/resources/vfs/test.xml Wed Oct 31 04:56:55 2007
@@ -0,0 +1,10 @@
+<?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/xsd">
+ <m0:request>
+ <m0:symbol>IBM</m0:symbol>
+ </m0:request>
+ </m0:getQuote>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_115.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_115.xml?rev=590632&view=auto
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_115.xml (added)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_115.xml Wed Oct 31 04:56:55 2007
@@ -0,0 +1,46 @@
+<!--
+ ~ 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.
+ -->
+<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/soap/SimpleStockQuoteService"/>
+ </endpoint>
+ <outSequence>
+ <property name="transport.vfs.ReplyFileName"
+ expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')" scope="transport"/>
+ <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>
Modified: webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html?rev=590632&r1=590631&r2=590632&view=diff
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html (original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html Wed Oct 31 04:56:55 2007
@@ -196,6 +196,10 @@
support with JMS</a></li>
<li><a href="#Sample114">Sample 114: One way bridging from JMS to http
and replying with a 202 Accepted response</a></li>
+ <li><a href="#Sample115">Sample 115: Using the file system as transport
+ medium using VFS transport listener and sender</a></li>
+ <li><a href="#Sample116">Sample 116: Switching from ftp transport listener
+ to mail transport sender</a></li>
</ul>
</li>
<li><ul>
@@ -2700,6 +2704,140 @@
Transfer-Encoding: chunked
0</pre>
+
+
+
+<h2><a name="Sample115">Sample 115:</a></h2>
+
+<pre>
+<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/soap/SimpleStockQuoteService"/>
+ </endpoint>
+ <outSequence>
+ <property name="transport.vfs.ReplyFileName"
+ expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')" scope="transport"/>
+ <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>
+</pre>
+
+<p><strong>Objective: Using the file system as transport medium using VFS
+transport listener and sender</strong></p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService if not already
+done</p>
+
+<p>Create three new directories in a test directory. e.g. in, out, original in /home/user/test.
+Open SYNAPSE_HOME/repository/conf/sample/synapse_sample_115.xml and edit
+the following values. Change transport.vfs.FileURI, transport.vfs.MoveAfterProcess,
+transport.vfs.MoveAfterFailure parameter values to the above in, original, original directories
+respectively. Change outSequence endpoint address uri to out directory with the prefeix <em>vfs:</em>.
+Values you have to change are marked with <!--CHANGE-->.
+</p>
+
+<p>Start the Synapse configuration numbered 115: i.e. synapse -sample 115</p>
+
+<p>Copy SYNAPSE_HOME/repository/conf/sample/resources/vfs/test.xml to the directory
+given in transport.vfs.FileURI above.</p>
+
+<p>test.xml file content is as follows</p>
+
+<pre>
+<?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/xsd">
+ <m0:request>
+ <m0:symbol>IBM</m0:symbol>
+ </m0:request>
+ </m0:getQuote>
+ </soapenv:Body>
+</soapenv:Envelope>
+</pre>
+
+<p>VFS transport listener will pick the file from <em>in</em> directory and send it
+to the Axis2 service. The request XML file will be moved to <em>original</em> directory.
+The response from the Axis2 server will be saved to <em>out</em> directory.</p>
+
+
+
+<h2><a name="Sample116">Sample 116:</a></h2>
+<pre>
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="StockQuoteProxy" transports="vfs">
+ <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>
+
+ <target>
+ <inSequence>
+ <header name="Action" value="urn:getQuote"/>
+ </inSequence>
+ <endpoint>
+ <address uri="http://localhost:9000/soap/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"/>
+ </proxy>
+</definitions>
+</pre>
+
+<p><strong>Objective: Switching from ftp transport listener to mail transport
+sender</strong></p>
+
+<p><strong>Pre-Requisites:</strong><br>
+You will need access to an FTP server and an SMTP server to try this sample.</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService if not already
+done</p>
+
+<p>Enable mail transport sender in the Synapse axis2.xml. See <a href="Synapse_Samples_Setup.html#mailsender">
+Setting up mail transport sender</a>
+</p>
+
+<p>Create a new test directory in the FTP server. Open SYNAPSE_HOME/repository/conf/sample/synapse_sample_116.xml
+and edit the following values. Change transport.vfs.FileURI parameter value point to
+the test directory at the FTP server. Change outSequence endpoint address uri email address
+to a working email address. Values you have to change are marked with <!--CHANGE-->.</p>
+
+<p>Start the Synapse configuration numbered 116: i.e. synapse -sample 116</p>
+
+<p>Copy SYNAPSE_HOME/repository/conf/sample/resources/vfs/test.xml to the ftp directory
+given in transport.vfs.FileURI above.</p>
+
+<p>VFS transport listener will pick the file from the directory in the ftp server and
+send it to the Axis2 service. The file in the ftp directory will be deleted.
+The response will be sent to the given email address.</p>
+
+
<div>
<h1>Database Mediators </h1>
Modified: webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html?rev=590632&r1=590631&r2=590632&view=diff
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html (original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html Wed Oct 31 04:56:55 2007
@@ -422,6 +422,28 @@
<p></p>
+
+<h2 id="mailsender">Setting up mail transport sender</h2>
+
+<p>To enable the mail transport, you need to uncomment the mail transport
+sender configuration in the repository/conf/axis2.xml. Change the mail.smtp.host parameter value
+to a working SMTP host.</p>
+
+<pre>
+ <!-- ================================================= -->
+ <!-- Mail Transport Sender -->
+ <!--Only need to uncomment the sender. Configuration is achieved with every client.
+ At any instant mail host should be given. Sample configuration has been given.
+ http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html-->
+ <!-- ================================================= -->
+ <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+ <parameter name="mail.smtp.host">localhost</parameter>
+ </transportSender>
+</pre>
+
+<p></p>
+
+
<h2 id="script">Configuring Synapse for Script Mediator support</h2>
<p></p>
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org