Author: hiranya
Date: Thu May 20 10:27:40 2010
New Revision: 946588
URL: http://svn.apache.org/viewvc?rev=946588&view=rev
Log:
Fixing SYNAPSE-655 (Adding a sample for the UDP transport)
Added:
synapse/trunk/java/repository/conf/sample/synapse_sample_266.xml
Modified:
synapse/trunk/java/repository/conf/axis2.xml
synapse/trunk/java/repository/conf/sample/resources/misc/client/axis2.xml
synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml
Modified: synapse/trunk/java/repository/conf/axis2.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/axis2.xml?rev=946588&r1=946587&r2=946588&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/axis2.xml (original)
+++ synapse/trunk/java/repository/conf/axis2.xml Thu May 20 10:27:40 2010
@@ -234,6 +234,9 @@
<parameter name="port">6060</parameter>
</transportReceiver>-->
+ <!--Uncomment this for UDP transport support
+ <transportReceiver name="udp"
class="org.apache.axis2.transport.udp.UDPListener"/>
+
<!-- ================================================= -->
<!-- Transport Outs -->
<!-- ================================================= -->
@@ -310,6 +313,9 @@
<!--Uncomment this for TCP transport support
<transportSender name="tcp"
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>-->
+ <!--Uncomment this for UDP transport support
+ <transportSender name="udp"
class="org.apache.axis2.transport.udp.UDPSender"/>
+
<!-- ================================================= -->
<!-- Global Modules -->
<!-- ================================================= -->
Modified:
synapse/trunk/java/repository/conf/sample/resources/misc/client/axis2.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/resources/misc/client/axis2.xml?rev=946588&r1=946587&r2=946588&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/resources/misc/client/axis2.xml
(original)
+++ synapse/trunk/java/repository/conf/sample/resources/misc/client/axis2.xml
Thu May 20 10:27:40 2010
@@ -209,6 +209,8 @@
<!-- transportSender name="tcp"
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+ <transportSender name="udp"
+ class="org.apache.axis2.transport.udp.UDPSender"/>
<transportSender name="local"
class="org.apache.axis2.transport.local.LocalTransportSender"/ -->
<transportSender name="http"
Added: synapse/trunk/java/repository/conf/sample/synapse_sample_266.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_266.xml?rev=946588&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_266.xml (added)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_266.xml Thu May 20
10:27:40 2010
@@ -0,0 +1,34 @@
+<!--
+ ~ 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.
+ -->
+
+<!-- Switching from UDP to HTTP/S -->
+<proxy xmlns="http://synapse.apache.org/ns/2010/04/configuration"
name="StockQuoteProxy" transports="udp">
+ <target>
+ <endpoint>
+ <address
uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <inSequence>
+ <log level="full"/>
+ <property name="OUT_ONLY" value="true"/>
+ </inSequence>
+ </target>
+ <parameter name="transport.udp.port">9999</parameter>
+ <parameter name="transport.udp.contentType">text/xml</parameter>
+ <publishWSDL
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+</proxy>
\ No newline at end of file
Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml?rev=946588&r1=946587&r2=946588&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml Thu May 20 10:27:40
2010
@@ -224,7 +224,9 @@
<li>
<a href="#Sample264">Sample 264: Transport switching - HTTP/S to JMS two way
messages</a></li>
<li>
-<a href="#Sample266">Sample 265: Switching from TCP to HTTP/S</a></li>
+<a href="#Sample265">Sample 265: Switching from TCP to HTTP/S</a></li>
+<li>
+<a href="#Sample266">Sample 266: Switching from UDP to HTTP/S</a></li>
</ul></li>
<li>
<a href="#Task">Introduction to Synapse tasks</a>
@@ -2907,7 +2909,7 @@ it will first try to read the content ty
<p>
<strong>Prerequisites:</strong>
<br/>You need to configure Synpase to use the TCP transport. The sample
Axis2 client should also
- be setup to send TCP requests. Refer <a
href="Synapse_Samples_Setup.html#tcptransport">Setting
+ be setup to send TCP requests. Refer <a
href="Synapse_Samples_Setup.html#tcp">Setting
Up the TCP Transport</a> section in the sample setup guide for more
details.
</p>
<p>
@@ -2930,6 +2932,47 @@ it will first try to read the content ty
<pre xml:space="preserve">Thu May 20 12:25:01 IST 2010
samples.services.SimpleStockQuoteService :: Accepted order #1 for : 17621
stocks of IBM at $ 73.48068475255796
</pre>
+ <h2>
+ <a name="Sample266" id="Sample266">Sample 266: Switching from UDP to
HTTP/S</a>
+ </h2>
+ <pre xml:space="preserve"><proxy
xmlns="http://synapse.apache.org/ns/2010/04/configuration"
name="StockQuoteProxy" transports="udp">
+ <target>
+ <endpoint>
+ <address
uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ <inSequence>
+ <log level="full"/>
+ <property name="OUT_ONLY" value="true"/>
+ </inSequence>
+ </target>
+ <parameter name="transport.udp.port">9999</parameter>
+ <parameter name="transport.udp.contentType">text/xml</parameter>
+ <publishWSDL
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+</proxy></pre>
+ <p>
+ <strong>Objective: Demonstrate receiving SOAP messages over UDP and
forwarding them over HTTP</strong>
+ </p>
+ <p>
+ <strong>Prerequisites:</strong>
+ <br/>You need to configure Synpase to use the UDP transport. The sample
Axis2 client should also
+ be setup to send UDP requests. Refer <a
href="Synapse_Samples_Setup.html#udp">Setting
+ Up the UDP Transport</a> section in the sample setup guide for more
details.
+ </p>
+ <p>
+ This sample is similar to <a href="#Sample265">Sample 265</a>. Only
difference is instead of the TCP transport
+ we will be using the UDP transport to receive messages.
+ </p>
+ <p>Start Synpase using sample 266.</p>
+ <pre xml:space="preserve">synapse.bat/synapse.sh -sample 266</pre>
+ <p>Start Axis2 server with SimpleStockService deployed</p>
+ <p>Invoke the stockquote client using the following command. Note the UDP
URL in the command.</p>
+ <pre xml:space="preserve">ant stockquote
-Daddurl=udp://localhost:9999?contentType=text/xml -Dmode=placeorder</pre>
+ <p>Since we have configured the content type as text/xml for the proxy
service, incoming messages will be processed
+ as SOAP 1.1 messages.</p>
+ <p>The sample Axis2 server console will print a message indicating that it
has received the request: </p>
+ <pre xml:space="preserve">Thu May 20 12:25:01 IST 2010
samples.services.SimpleStockQuoteService :: Accepted order #1 for : 17621
stocks of IBM at $ 73.48068475255796
+</pre>
+
<h1>
<a name="Task" id="Task">Introduction to Synapse Tasks</a> </h1>
<h2>
Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml?rev=946588&r1=946587&r2=946588&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml Thu May 20
10:27:40 2010
@@ -734,6 +734,23 @@ synapse.sh -sample <n></pre>
transport sender configuration in the
samples/axis2Client/client_repo/conf/axis2.xml file.
</p>
<p/>
+ <h2 id="udp">
+ Setting up the UDP Transport
+ </h2>
+ <p>
+ To enable the UDP transport for samples first you need to download the
Axis2 UDP transport
+ jar and copy it to the lib directory of Synapse. Then open up the
axis2.xml file and uncomment
+ the UDP transport receiver and sender configurations:
+ </p>
+ <pre xml:space="preserve">
+ <transportReceiver name="udp"
class="org.apache.axis2.transport.udp.UDPListener"/>
+
+ <transportSender name="udp"
class="org.apache.axis2.transport.udp.UDPSender"/></pre>
+ <p>
+ If you wish to use the sample Axis2 client to send UDP messages, you have
to uncomment the UDP
+ transport sender configuration in the
samples/axis2Client/client_repo/conf/axis2.xml file.
+ </p>
+ <p/>
<h2 id="script">
Configuring Synapse for Script Mediator Support
</h2>