Author: hiranya
Date: Sat Sep 25 06:23:32 2010
New Revision: 1001139
URL: http://svn.apache.org/viewvc?rev=1001139&view=rev
Log:
Fixing a sample
Modified:
synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml
synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml?rev=1001139&r1=1001138&r2=1001139&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml Sat Sep 25
06:23:32 2010
@@ -22,15 +22,15 @@
<definitions xmlns="http://synapse.apache.org/ns/2010/04/configuration">
<sequence name="main">
- <switch source="//m0:getQuote/m0:request/m0:symbol">
- <case xmlns:m0="http://services.samples" regex="IBM">
+ <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 xmlns:m0="http://services.samples" regex="MSFT">
+ <case regex="MSFT">
<property name="symbol" value="Are you sure? - MSFT"/>
</case>
- <default xmlns:m0="http://services.samples">
+ <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>
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=1001139&r1=1001138&r2=1001139&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml Sat Sep 25 06:23:32
2010
@@ -411,7 +411,15 @@
<br/>Start the Axis2 server and deploy the SimpleStockQuoteService if not
already deployed</p>
<p>Execute the Dumb Client as: </p>
<pre xml:space="preserve">ant stockquote
-Dtrpurl=http://localhost:8280/services/StockQuote</pre>
-<p>This time you will see Synapse receiving a message for which Synapse was
set as the ultimate receiver of the message. Based on the 'To' EPR of
http://localhost:8280/services/StockQuote, Synapse performs a match to the path
'/StockQuote' and as the request matches the XPath expression of the filter
mediator, the filter mediator's child mediators execute. This sends the message
to a different endpoint as specified by the endpoint definition. The 'drop'
mediator terminates further processing of the current message in a
configuration. During response processing, the filter condition fails, and thus
the implicit 'send' mediator forwards the response back to the client. </p>
+
+<p>This time you will see Synapse receiving a message for which Synapse was
set as the ultimate receiver
+of the message. Based on the 'To' EPR of
http://localhost:8280/services/StockQuote, Synapse performs a
+match to the path '/StockQuote' and as the request matches the XPath
expression of the filter mediator,
+the filter mediator's child mediators execute. This sends the message to a
different endpoint as
+specified by the endpoint definition. The 'drop' mediator terminates further
processing of the current
+message in a configuration. During response processing, the filter condition
fails, and thus the 'send'
+mediator forwards the response back to the client using the implicit 'To'
address. </p>
+
<h2>
<a name="Sample2" id="Sample2">Sample 2: CBR with the Switch-case mediator,
using message properties</a></h2>
<pre xml:space="preserve"><definitions
xmlns="http://synapse.apache.org/ns/2010/04/configuraiton">
@@ -572,7 +580,7 @@
[HttpServerWorker-1] DEBUG MediatorFaultHandler - MediatorFaultHandler ::
handleFault
[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator <fault>
:: mediate()
[HttpServerWorker-1] DEBUG LogMediator - Log mediator :: mediate()
-[HttpServerWorker-1] INFO LogMediator - text = An unexpected error occured,
message = Reference to non-existent endpoint for key : bogus</pre>
+[HttpServerWorker-1] INFO LogMediator text = An unexpected error occured,
message = Couldn't find the endpoint with the key : bogus</pre>
<p>When the 'SUN' quote is requested, a custom sequence 'sunSequence' is
invoked, and it specifies 'sunErrorHandler' as its error handler. Hence when
the send fails, you could see the proper error handler invocation and the
custom error message printed as follows. </p>
<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/ -Dsymbol=SUN</pre>
<pre xml:space="preserve">[HttpServerWorker-1] DEBUG SequenceMediator -
Sequence mediator <sunSequence> :: mediate()
@@ -584,7 +592,7 @@
[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator
<sunErrorHandler> :: mediate()
[HttpServerWorker-1] DEBUG AbstractListMediator - Implicit Sequence
<SequenceMediator> :: mediate()
[HttpServerWorker-1] DEBUG LogMediator - Log mediator :: mediate()
-[HttpServerWorker-1] INFO LogMediator - text = An unexpected error occured
for stock SUN, message = Reference to non-existent endpoint for key :
sunPort</pre>
+[HttpServerWorker-1] INFO LogMediator text = An unexpected error occured for
stock SUN, message = Couldn't find the endpoint with the key : sunPort</pre>
<h2>
<a name="Sample5" id="Sample5">Sample 5: Creating SOAP fault messages and
changing the direction of a message</a></h2>
<pre xml:space="preserve"><definitions
xmlns="http://synapse.apache.org/ns/2010/04/configuraiton">