[prev in list] [next in list] [prev in thread] [next in thread]
List: synapse-dev
Subject: svn commit: r479716 - in /incubator/synapse/trunk/java:
From: asankha () apache ! org
Date: 2006-11-27 18:38:06
Message-ID: 20061127183806.59E8E1A9846 () eris ! apache ! org
[Download RAW message or body]
Author: asankha
Date: Mon Nov 27 10:38:05 2006
New Revision: 479716
URL: http://svn.apache.org/viewvc?view=rev&rev=479716
Log:
Finalize example #105 with a POX sample as well
Modified:
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/GenericJMSClient.java
incubator/synapse/trunk/java/modules/samples/src/main/scripts/build.xml
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_105.xml
incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html
Modified: incubator/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/GenericJMSClient.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/mai \
n/java/samples/userguide/GenericJMSClient.java?view=diff&rev=479716&r1=479715&r2=479716
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/GenericJMSClient.java \
(original)
+++ incubator/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/GenericJMSClient.java \
Mon Nov 27 10:38:05 2006 @@ -45,6 +45,15 @@
app.sendTextMessage(dest, param);
} else if ("binary".equalsIgnoreCase(type)) {
app.sendBytesMessage(dest, getBytesFromFile(param));
+ } else if ("xml".equalsIgnoreCase(type)) {
+ app.sendTextMessage(dest,
+ "<m:placeOrder xmlns:m=\"http://services.samples/xsd\">\n" +
+ " <m:order>\n" +
+ " <m:price>" + getRandom(100, 0.9, true) + "</m:price>\n" +
+ " <m:quantity>" + (int) getRandom(10000, 1.0, true) + \
"</m:quantity>\n" + + " <m:symbol>" + param + "</m:symbol>\n" +
+ " </m:order>\n" +
+ "</m:placeOrder>");
} else {
System.out.println("Unknown JMS message type");
}
Modified: incubator/synapse/trunk/java/modules/samples/src/main/scripts/build.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/main/scripts/build.xml?view=diff&rev=479716&r1=479715&r2=479716
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/main/scripts/build.xml \
(original)
+++ incubator/synapse/trunk/java/modules/samples/src/main/scripts/build.xml Mon Nov \
27 10:38:05 2006 @@ -90,8 +90,8 @@
examples
ant jmsclient
- [-Ddest=dynamicQueues/JMSTextProxy] [-Dtype=text|binary]
- [-Dpayload="24.34 100 IBM" | \
"repository\conf\sample\resources\mtom\asf-logo.gif"] + \
[-Ddest=dynamicQueues/JMSTextProxy] [-Dtype=text|binary|xml] + \
[-Dpayload="24.34 100 IBM | MSFT" | \
"repository\conf\sample\resources\mtom\asf-logo.gif"] </echo>
</target>
Modified: incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_105.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_105.xml?view=diff&rev=479716&r1=479715&r2=479716
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_105.xml \
(original)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_105.xml Mon \
Nov 27 10:38:05 2006 @@ -45,6 +45,13 @@
<endpoint \
address="http://localhost:9000/axis2/services/MTOMSampleService" optimize="mtom"/> \
</send> </sequence>
+
+ <sequence name="pox_proxy">
+ <header name="Action" value="urn:placeOrder"/>
+ <send>
+ <endpoint \
address="http://localhost:9001/axis2/services/SimpleStockQuoteService" force="soap"/> \
+ </send> + </sequence>
</definitions>
<proxies>
@@ -56,9 +63,13 @@
<target inSequence="text_proxy"/>
<property name="transport.jms.Wrapper" \
value="{http://services.samples/xsd}text"/> </proxy>
+ <proxy name="JMSPoxProxy" transports="jms">
+ <target inSequence="pox_proxy"/>
+ </proxy>
</proxies>
<rules>
+ <log level="full"/>
<drop/>
</rules>
Modified: incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html?view=diff&rev=479716&r1=479715&r2=479716
==============================================================================
--- incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html (original)
+++ incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html Mon Nov 27 \
10:38:05 2006 @@ -832,7 +832,6 @@
DEBUG AbstractListMediator - Implicit Sequence <SequenceMediator> :: mediate()
DEBUG LogMediator - Log mediator :: mediate()
INFO LogMediator - message = Executing inside the out sequence
-
</pre>
<h2>Sample 105:</h2>
@@ -845,20 +844,22 @@
Configure the script mediator runtime (Refer notes below)<br>
i.e. make bsf-2.4.0.jar, xbean-2.2.0.jar and js-1.6R2.jar available in lib
folder)<br>
+Configure Synapse and the sample Axis2 server to use MTOM (i.e. set
+enableMTOM parameter to true)<br>
Start the Synapse configuration numbered 105: i.e. synapse -sample 105<br>
Start the Axis2 server and deploy the SimpleStockQuoteService and the
MTOMSampleService (Refer steps above)</p>
-<p>This configuration creates two JMS proxy services named JMSFileUploadProxy
-and JMSTextProxy exposed over JMS queues with the same names. The first part
-of this example demonstrates the pure text message support with JMS, where a
-user sends a text JMS message of the form "<price> <qty>
-<symbol>". Synapse converts this message into a SOAP message and sends
-this to the SimpleStockQuoteServices' placeOrder operation. The mediation
-uses the script mediator to transform the text message into a XML payload.
-The proxy service property named "transport.jms.Wrapper" defines the wrapper
-element QName, to be used when wrapping text/binary content into a SOAP
-envelope. </p>
+<p>This configuration creates three JMS proxy services named
+JMSFileUploadProxy, JMSTextProxy and JMSPoxProxy exposed over JMS queues with
+the same names. The first part of this example demonstrates the pure text
+message support with JMS, where a user sends a text JMS message of the form
+"<price> <qty> <symbol>". Synapse converts this message
+into a SOAP message and sends this to the SimpleStockQuoteServices'
+placeOrder operation. The mediation uses the script mediator to transform the
+text message into a XML payload. The proxy service property named
+"transport.jms.Wrapper" defines the wrapper element QName, to be used when
+wrapping text/binary content into a SOAP envelope.</p>
<p></p>
@@ -875,10 +876,10 @@
<pre><?xml version='1.0' encoding='utf-8'?><soapenv:Envelope \
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header \
/><soapenv:Body><axis2ns3:text \
xmlns:axis2ns3="http://services.samples/xsd">65.05119159089897 6079 \
IBM</axis2ns3:text></soapenv:Body></soapenv:Envelope></pre> \
<pre>..<br></pre> <pre>[JMSWorker-1] DEBUG SendMediator - Sending message to \
endpoint :: name = null resolved address = \
http://localhost:9000/axis2/services/SimpleStockQuoteService
-<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope \
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header \
/><soapenv:Body><m:placeOrder \
xmlns:m="http://services.samples/xsd"><m:order><m:price>65.051191590898 \
97</m:price><m:quantity>6079</m:quantity><m:symbol>IBM</m:s \
ymbol></m:order></m:placeOrder></soapenv:Body></soapenv:Envelope>
-</pre>
+<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope \
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header \
/><soapenv:Body><m:placeOrder \
xmlns:m="http://services.samples/xsd"><m:order><m:price>65.051191590898 \
97</m:price><m:quantity>6079</m:quantity><m:symbol>IBM</m:s \
ymbol></m:order></m:placeOrder></soapenv:Body></soapenv:Envelope></pre>
<p>The next section uses the 'ant jmsclient -Dtype=binary
+-Ddest=dynamicQueues/JMSFileUploadProxy
-Dpayload=.\..\..\repository\conf\sample\resources\mtom\asf-logo.gif" which
sends a JMS bytes message to the defined destination with the content of the
payload file as its body. Synapse receives the bytes message and creates a
@@ -905,6 +906,15 @@
<pre></soapenv:Envelope>--MIMEBoundaryurn_uuid_3FE7ADC48E69671C2211646391275465content-type: \
application/octet-streamcontent-transfer-encoding: binarycontent-id:</pre> \
<pre><1.urn:uuid:3FE7ADC48E69671C2211646391275464@apache.org>GIF89aƒd.... \
;--MIMEBoundaryurn_uuid_3FE7ADC48E69671C2211646391275465-</pre> <pre></pre>
+
+<p>The final section of this example shows a POX JMS message received by
+Synapse and sent to the SimpleStockQuoteService as a SOAP message. Execute
+this scenario as 'ant jmsclient -Dtype=xml -Ddest=dynamicQueues/JMSPoxProxy
+-Dpayload=MSFT' and notice that since the message received by Synapse is POX,
+you need to force a SOAP message out through the endpoint in-order for the
+SimpleStockQuoteService to properly receive its response. In this example
+Synapse wraps the received POX message in a SOAP envelope and processes it
+and routes it to the real endpoint.</p>
<h1><a name="Transports1" id="Transports1">Transports</a></h1>
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic