Author: asankha
Date: Mon Apr 23 11:09:55 2007
New Revision: 531549
URL: http://svn.apache.org/viewvc?view=rev&rev=531549
Log:
fix samples 9,10,11 and 12
Modified:
webservices/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
webservices/synapse/trunk/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml
webservices/synapse/trunk/java/repository/conf/sample/resources/synapse.xml
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_12.xml
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml
webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
Modified:
webservices/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
---
webservices/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
(original)
+++
webservices/synapse/trunk/java/repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
Mon Apr 23 11:09:55 2007
@@ -1 +1,3 @@
-<endpoint xmlns="http://ws.apache.org/ns/synapse" name="simple"><address
uri="http://localhost:9000/soap/SimpleStockQuoteService"/></endpoint>
+<endpoint xmlns="http://ws.apache.org/ns/synapse">
+ <address uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
+</endpoint>
Modified:
webservices/synapse/trunk/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
---
webservices/synapse/trunk/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml
(original)
+++
webservices/synapse/trunk/java/repository/conf/sample/resources/sequence/dynamic_seq_1.xml
Mon Apr 23 11:09:55 2007
@@ -1,7 +1,7 @@
<sequence name="dynamic_sequence" xmlns="http://ws.apache.org/ns/synapse">
<in>
<log level="custom">
- <property name="message" value="*** Test Message 1 ***"/>
+ <property name="message" value="*** Test Message 1 ***"/>
</log>
</in>
<send/>
Modified:
webservices/synapse/trunk/java/repository/conf/sample/resources/synapse.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/resources/synapse.xml?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/resources/synapse.xml
(original)
+++ webservices/synapse/trunk/java/repository/conf/sample/resources/synapse.xml
Mon Apr 23 11:09:55 2007
@@ -19,10 +19,8 @@
<!-- a registry based Synapse configuration -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
-
<log level="custom">
<property name="message" value="This is a dynamic Synapse
configuration"/>
</log>
<send/>
-
</definitions>
Modified:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
(original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
Mon Apr 23 11:09:55 2007
@@ -16,31 +16,20 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-<synapse xmlns="http://ws.apache.org/ns/synapse">
-
- <!-- introduction dynamic endpoints -->
+<!-- introduction dynamic endpoints -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
- <!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
- <parameter name="root">file:./../../repository/</parameter>
- <!-- all resources loaded from the URL registry would
be cached for this number of milli seconds -->
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
<parameter name="cachableDuration">15000</parameter>
</registry>
- <definitions>
- <endpoint name="dynamic_endpoint" key="endpoint/dynamic_endpt_1.xml"/>
- </definitions>
-
- <rules>
- <in>
- <send>
- <endpoint ref="dynamic_endpoint"/>
- </send>
- </in>
- <out>
- <send/>
- </out>
- </rules>
-
-</synapse>
\ No newline at end of file
+ <in>
+ <send>
+ <endpoint key="endpoint/dynamic_endpt_1.xml"/>
+ </send>
+ </in>
+ <out>
+ <send/>
+ </out>
+</definitions>
Modified:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml
(original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml
Mon Apr 23 11:09:55 2007
@@ -16,17 +16,10 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-<synapse xmlns="http://ws.apache.org/ns/synapse">
-
- <!-- a full registry based configuration -->
-
- <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
- <!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
- <parameter name="root">file:./../../repository/</parameter>
- <!-- all resources loaded from the URL registry would be cached for
this number of milli seconds -->
+<!-- a full registry based configuration -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+ <parameter
name="root">file:./repository/conf/sample/resources/</parameter>
<parameter name="cachableDuration">15000</parameter>
</registry>
-
-
-</synapse>
\ No newline at end of file
+</definitions>
\ No newline at end of file
Modified:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_12.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_12.xml?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_12.xml
(original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_12.xml
Mon Apr 23 11:09:55 2007
@@ -16,33 +16,33 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+<!-- MTOM and SwA and message properties to correlate requests and responses
-->
<definitions xmlns="http://ws.apache.org/ns/synapse">
- <in>
- <filter source="get-property('Action')"
regex="urn:uploadFileUsingMTOM">
- <property name="example" value="mtom"/>
- <send>
- <endpoint>
- <address
uri="http://localhost:9001/soap/MTOMSwASampleService" optimize="mtom"/>
- </endpoint>
- </send>
- </filter>
- <filter source="get-property('Action')"
regex="urn:uploadFileUsingSwA">
- <property name="example" value="swa"/>
- <send>
- <endpoint>
- <address
uri="http://localhost:9001/soap/MTOMSwASampleService" optimize="swa"/>
- </endpoint>
- </send>
- </filter>
- </in>
- <out>
- <filter source="get-property('example')" regex="mtom">
- <property name="enableMTOM" value="true" scope="axis2"/>
- </filter>
- <filter source="get-property('example')" regex="swa">
- <property name="enableSwA" value="true" scope="axis2"/>
- </filter>
- <send/>
- </out>
+ <in>
+ <filter source="get-property('Action')"
regex="urn:uploadFileUsingMTOM">
+ <property name="example" value="mtom"/>
+ <send>
+ <endpoint>
+ <address
uri="http://localhost:9000/soap/MTOMSwASampleService" optimize="mtom"/>
+ </endpoint>
+ </send>
+ </filter>
+ <filter source="get-property('Action')" regex="urn:uploadFileUsingSwA">
+ <property name="example" value="swa"/>
+ <send>
+ <endpoint>
+ <address
uri="http://localhost:9000/soap/MTOMSwASampleService" optimize="swa"/>
+ </endpoint>
+ </send>
+ </filter>
+ </in>
+ <out>
+ <filter source="get-property('example')" regex="mtom">
+ <property name="enableMTOM" value="true" scope="axis2"/>
+ </filter>
+ <filter source="get-property('example')" regex="swa">
+ <property name="enableSwA" value="true" scope="axis2"/>
+ </filter>
+ <send/>
+ </out>
</definitions>
Modified:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml
(original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml
Mon Apr 23 11:09:55 2007
@@ -16,23 +16,12 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-<synapse xmlns="http://ws.apache.org/ns/synapse">
-
- <!-- introduction dynamic sequences -->
-
+<!-- introduction dynamic sequences -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
- <!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
- <parameter name="root">file:./../../repository/</parameter>
- <!-- all resources loaded from the URL registry would be cached for
this number of milli seconds -->
+ <parameter
name="root">file:./repository/conf/sample/resources/</parameter>
<parameter name="cachableDuration">15000</parameter>
</registry>
- <definitions>
- <sequence name="dynamic_sequence" key="sequence/dynamic_seq_1.xml"/>
- </definitions>
-
- <rules>
- <sequence ref="dynamic_sequence"/>
- </rules>
-</synapse>
\ No newline at end of file
+ <sequence key="sequence/dynamic_seq_1.xml"/>
+</definitions>
\ No newline at end of file
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?view=diff&rev=531549&r1=531548&r2=531549
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
(original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html Mon
Apr 23 11:09:55 2007
@@ -673,8 +673,7 @@
<p>Execute the custom quote client as 'ant stockquote -Dmode=customquote ..'
and analyze the the Synapse debug log output as shown below</p>
-<pre>ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dtrpurl=http://localhost:8080/ -Dmode=customquote
-</pre>
+<pre>ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dtrpurl=http://localhost:8080/ -Dmode=customquote</pre>
<pre>[HttpServerWorker-1] DEBUG XSLTMediator - Performing XSLT transformation
against property with key : xslt-key-req
[HttpServerWorker-1] DEBUG XSLTMediator - Transformation source :
<m0:CheckPriceRequest
xmlns:m0="http://www.apache-synapse.org/test"><m0:Code>IBM</m0:Code></m0:CheckPriceRequest>
@@ -725,150 +724,208 @@
<p></p>
<h2><a name="Sample9">Sample 9:</a></h2>
-<pre><synapse xmlns="http://ws.apache.org/ns/synapse">
- <!-- introduction dynamic sequences -->
-
+<pre><!-- introduction dynamic sequences -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry
provider="org.apache.synapse.registry.url.SimpleURLRegistry">
- <!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
- <property name="root"
value="file:repository/conf/sample/resources/"/>
- <!-- all resources loaded from the URL registry would be cached for
this number of milli seconds -->
- <property name="cachableDuration" value="15000"/>
+ <parameter
name="root">file:./repository/conf/sample/resources/</parameter>
+ <parameter name="cachableDuration">15000</parameter>
</registry>
- <definitions>
- <sequence name="dynamic_sequence"
key="sequence/dynamic_seq_1.xml"/>
- </definitions>
-
- <rules>
- <sequence ref="dynamic_sequence"/>
- </rules>
-</synapse> </pre>
+ <sequence key="sequence/dynamic_seq_1.xml"/>
+</definitions> </pre>
<p><strong>Objective: Introduction to dynamic sequences with a
Registry</strong></p>
<p><strong>Pre-Requisites:</strong><br>
Start the Synapse configuration numbered 9: i.e. synapse -sample 9<br>
-Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
-above)</p>
+Start the Axis2 server and deploy the SimpleStockQuoteService if not already
+done</p>
<p>This example introduces the dynamic behaviour of Synapse through the use
-of a Registry. Synapse supports dynamic definitions for sequences, the main
-rules, endpoints and as seen before resources and properties. In this example
-we define a Synapse configuration which references a sequence definition
-specified as a registry key. The registry key resolves to the actual content
-of the sequence which would be loaded dynamically by Synapse at runtime, and
-cached accordingly as per its registry definition. Once the cache expires,
+of a Registry. Synapse supports dynamic definitions for sequences &
+endpoints, and as seen before, for resources. In this example we define a
+Synapse configuration which references a sequence definition specified as a
+registry key. The registry key resolves to the actual content of the sequence
+which would be loaded dynamically by Synapse at runtime, and cached
+appropriately as per its definition in the registry. Once the cache expires,
Synapse would recheck the meta information for the definition and re-load the
sequence definition if necessary and re-cache it again.</p>
<p>Once Synapse is started, execute the stock quote client as 'ant
-stockquote'. You will notice that that Synapse fetches the definition of the
-sequence from the registry and executes its rules as follows:</p>
-<pre>DEBUG SequenceMediator - Sequence mediator <anonymous> ::
mediate()<br>INFO SimpleURLRegistry - ==> Repository fetch of resource with
key : sequence/dynamic_seq_1.xml<br>.....<br>INFO LogMediator - message = ***
Test Message 1 ***<br>...</pre>
+stockquote..'. You will notice that that Synapse fetches the definition of
+the sequence from the registry and executes its rules as follows:</p>
+<pre>[HttpServerWorker-1] INFO SimpleURLRegistry - ==> Repository fetch of
resource with key : sequence/dynamic_seq_1.xml
+...
+[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator
<dynamic_sequence> :: mediate()
+...
+[HttpServerWorker-1] INFO LogMediator - message = *** Test Message 1 ***</pre>
<p>Now if you execute the client immidiately (i.e. within 15 seconds of the
last execution) you will notice that the sequence was not reloaded. If you
-now edit the repository/conf/sample/resources/sequence/dynamic_seq_1.xml and
-edit the log message to read as "*** Test Message 2 ***" and execute the
-client again, you will notice that the new message is not yet visible (i.e.
-if you execute this within 15 seconds of loading the resource for the first
-time) However, after 15 seconds have elapsed since the original caching of
-the sequence, you will notice that the new sequence is loaded and executed by
-Synapse from the following log messages:</p>
-<pre>DEBUG SequenceMediator - Sequence mediator <anonymous> ::
mediate()<br>DEBUG AbstractRegistry - Cached object has expired for key :
sequence/dynamic_seq_1.xml<br>DEBUG SimpleURLRegistry - Perform RegistryEntry
lookup for key : sequence/dynamic_seq_1.xml<br>INFO SimpleURLRegistry - ==>
Repository fetch of resource with key :
sequence/dynamic_seq_1.xml<br>...<br>INFO LogMediator - message = *** Test
Message 2 ***<br>...</pre>
+edit the sequence definition in
+repository/conf/sample/resources/sequence/dynamic_seq_1.xml and edit the log
+message to read as "*** Test Message 2 ***" and execute the client again, you
+will notice that the new message is not yet visible (i.e. if you execute this
+within 15 seconds of loading the resource for the first time) However, after
+15 seconds have elapsed since the original caching of the sequence, you will
+notice that the new sequence is loaded and executed by Synapse from the
+following log messages:</p>
+<pre>[HttpServerWorker-1] INFO SimpleURLRegistry - ==> Repository fetch of
resource with key : sequence/dynamic_seq_1.xml
+...
+[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator
<dynamic_sequence> :: mediate()
+...
+[HttpServerWorker-1] INFO LogMediator - message = *** Test Message 2 ***</pre>
<p>The cache timeout could be tuned appropriately by configuring the URL
registry to suite the environment and the needs.</p>
<h2><a name="Sample10">Sample 10:</a></h2>
-<pre><synapse xmlns="http://ws.apache.org/ns/synapse">
- <!-- introduction dynamic endpoints -->
+<pre><!-- introduction dynamic endpoints -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry
provider="org.apache.synapse.registry.url.SimpleURLRegistry">
- <!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
- <property name="root"
value="file:repository/conf/sample/resources/"/>
- <!-- all resources loaded from the URL registry would be cached for
this number of milli seconds -->
- <property name="cachableDuration" value="15000"/>
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
+ <parameter name="cachableDuration">15000</parameter>
</registry>
- <definitions>
- <endpoint name="dynamic_endpoint"
key="endpoint/dynamic_endpt_1.xml"/>
- </definitions>
+ <in>
+ <send>
+ <endpoint key="endpoint/dynamic_endpt_1.xml"/>
+ </send>
+ </in>
+ <out>
+ <send/>
+ </out>
+</definitions> </pre>
- <rules>
- <in>
- <send>
- <endpoint ref="dynamic_endpoint"/>
- </send>
- </in>
- <out>
- <send/>
- </out>
- </rules>
-</synapse> </pre>
-
-<p><strong>Objective: Introduction to dynamic endpoints with a
+<p><strong>Objective: Introduction to dynamic endpoints with the
Registry</strong></p>
<p><strong>Pre-Requisites:</strong><br>
Start the Synapse configuration numbered 10: i.e. synapse -sample 10<br>
-Start the Axis2 server and deploy the SimpleStockQuoteService and the
-SimpleStockQuoteervice1 (Refer steps above)</p>
+Start the Axis2 server and deploy the SimpleStockQuoteService if not already
+done<br>
+Start a second Axis2 server on http port 9001 and https port 9003 as
+follows:</p>
+<pre>./axis2server.sh -http 9001 -https 9003</pre>
<p>This example introduces dynamic endpoints, where the definition of an
-endpoint is stored in a Registry. To follow this example execute the stock
-quote client as 'ant stockquote' and see that the message is routed to the
-SimpleStockQuoteService on the Axis2 instance. Repeat the above example and
-notice that the endpoint is cached and reused by Synapse - similarly to
-example # 8.</p>
-<pre>SimpleStockQuoteService :: Generating quote for : IBM</pre>
+endpoint is stored in the Registry. To follow this example execute the stock
+quote client as 'ant stockquote..' and see that the message is routed to the
+SimpleStockQuoteService on the default Axis2 instance on http port 9000.
+Repeat the above example immidiately again, and notice that the endpoint is
+cached and reused by Synapse - similarly to example # 8.</p>
+<pre>ant stockquote -Dtrpurl=http://localhost:8080/</pre>
<p>Now edit the repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml
definition and update the address to
-"http://localhost:9000/axis2/services/SimpleStockQuoteService1". After the
-cached value expires, the Registry loads the new definition of the endpoint,
-and then the messages can be seen being routed to the
-SimpleStockQuoteService1.</p>
-<pre>SimpleStockQuoteService 1 :: Generating quote for : IBM</pre>
-
-<p></p>
+"http://localhost:9001/soap/SimpleStockQuoteService". After the cached
+expires, the Registry loads the new definition of the endpoint, and then the
+messages can be seen being routed to the second sample Axis2 server on http
+port 9001.</p>
<h2><a name="Sample11">Sample 11:</a></h2>
-<pre><synapse xmlns="http://ws.apache.org/ns/synapse">
-
- <!-- a full registry based configuration -->
-
- <registry
provider="org.apache.synapse.registry.url.SimpleURLRegistry">
- <!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
- <property name="root"
value="file:repository/conf/sample/resources/"/>
- <!-- all resources loaded from the URL registry would be cached for
this number of milli seconds -->
- <property name="cachableDuration" value="15000"/>
+<pre><!-- a full registry based configuration -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+<registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+ <parameter
name="root">file:./repository/conf/sample/resources/</parameter>
+ <parameter name="cachableDuration">15000</parameter>
</registry>
-
-</synapse> </pre>
+</definitions> </pre>
<p><strong>Objective: A full registry based configuration</strong></p>
<p><strong>Pre-Requisites:</strong><br>
Start the Synapse configuration numbered 11: i.e. synapse -sample 11<br>
-Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
-above)</p>
+Start the Axis2 server and deploy the SimpleStockQuoteService if not already
+done</p>
-<p>This example shows a full registry based Synapse configuration. The
-Synapse configuration held on a node hosting Synapse simply points to the
-registry and looks up the actual configuration by requesting the key
-''synapse.xml'. This could be used to host a configuration on a file system
-or http server based registry, and allow a cluster of Synapse instances to
-load the configuration from this registry.</p>
-
-<p>Using 'ant stockquote' you would notice that the 'synapse.xml'
-configuration has been loaded from the root of the Simple URL based
-registry.</p>
+<p>This example shows a full registry based Synapse configuration. Thus it is
+possible to start a remote configuration from multiple instances of Synapse
+in a clustered environment easily, and allow the configuration to be reloaded
+as well. The Synapse configuration held on a node hosting Synapse simply
+points to the registry and looks up the actual configuration by requesting
+the key ''synapse.xml'. </p>
+<pre>ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dtrpurl=http://localhost:8080/</pre>
+<pre>[HttpServerWorker-1] INFO LogMediator - message = This is a dynamic
Synapse configuration</pre>
+
+<p>The actual synapse.xml loaded is:</p>
+<pre><!-- a registry based Synapse configuration -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <log level="custom">
+ <property name="message" value="This is a dynamic Synapse
configuration $$$"/>
+ </log>
+ <send/>
+</definitions></pre>
+
+<h2>Sample 12:</h2>
+<pre><!-- MTOM and SwA and message properties to correlate requests and
responses -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <in>
+ <filter source="get-property('Action')"
regex="urn:uploadFileUsingMTOM">
+ <property name="example" value="mtom"/>
+ <send>
+ <endpoint>
+ <address
uri="http://localhost:9001/soap/MTOMSwASampleService" optimize="mtom"/>
+ </endpoint>
+ </send>
+ </filter>
+ <filter source="get-property('Action')"
regex="urn:uploadFileUsingSwA">
+ <property name="example" value="swa"/>
+ <send>
+ <endpoint>
+ <address
uri="http://localhost:9001/soap/MTOMSwASampleService" optimize="swa"/>
+ </endpoint>
+ </send>
+ </filter>
+ </in>
+ <out>
+ <filter source="get-property('example')" regex="mtom">
+ <property name="enableMTOM" value="true" scope="axis2"/>
+ </filter>
+ <filter source="get-property('example')" regex="swa">
+ <property name="enableSwA" value="true" scope="axis2"/>
+ </filter>
+ <send/>
+ </out>
+</definitions></pre>
-<p></p>
+<p><strong>Objective: MTOM and SwA optimizations and request/response
+correlation</strong></p>
+
+<p><strong>Pre-Requisites:</strong><br>
+Start the Synapse configuration numbered 10: i.e. synapse -sample 10<br>
+Start the Axis2 server and deploy the MTOMSwASampleService if not already
+done</p>
+
+<p>Execute the 'ant optimizeclient' specifying MTOM optimization as
+follows:</p>
+<pre>ant optimizeclient -Dopt_mode=mtom</pre>
+
+<p>The configuration now sets a local message context property, and forwards
+the message to 'http://localhost:9000/soap/MTOMSwASampleService' optimizing
+bindary content as MTOM. By sending this message through TCPMon you would be
+able to see the actual message sent over the http transport if required. Thus
+during response processing, by checking the local message property Synapse
+could identify the past information about the current message context, and
+uses this knowledge to transform the response back to the client in the same
+format as the original request.</p>
+
+<p>When the client executes successfully, it will upload a file containging
+the ASF logo and receive its response back again and save it into a temporary
+file.</p>
+<pre>[java] Sending file :
./../../repository/conf/sample/resources/mtom/asf-logo.gif as MTOM</pre>
+<pre>[java] Saved response to file : /tmp/mtom-36877.gif</pre>
+
+<p>Next try SwA as:</p>
+<pre>ant optimizeclient -Dopt_mode=swa
+[java] Sending file :
./../../repository/conf/sample/resources/mtom/asf-logo.gif as SwA
+[java] Saved response to file : /tmp/swa-47549.gif</pre>
+
+<h1>WS-Security</h1>
-<h1><a name="WSSecurity">WS-Security</a></h1>
+<p><a name="WSSecurity" id="WSSecurity"></a></p>
<h2><a name="Sample50">Sample 50:</a></h2>
<pre><synapse xmlns="http://ws.apache.org/ns/synapse">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]