Author: asankha
Date: Wed Mar 14 09:18:26 2007
New Revision: 518202
URL: http://svn.apache.org/viewvc?view=rev&rev=518202
Log:
minor updates checking in temporarily
Modified:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml
webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
Modified:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml?view=diff&rev=518202&r1=518201&r2=518202
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml
(original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml
Wed Mar 14 09:18:26 2007
@@ -20,60 +20,39 @@
<!-- introduction to error handling -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
- <!-- define an endpoint for the stock quote service -->
- <endpoint name="simple">
- <address
uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
- </endpoint>
-
- <!-- define a non-existent host to test error handling (runtime exception
for invalid host)-->
- <endpoint name="bogusHost">
- <address
uri="http://bogus:9000/axis2/services/NonExistentStockQuoteService"/>
- </endpoint>
-
- <!-- define a non-existent port to test error handling (error handling) -->
- <endpoint name="bogusPort">
- <address
uri="http://localhost:9009/axis2/services/NonExistentStockQuoteService"/>
- </endpoint>
-
<!-- the default fault handling sequence used by Synapse - named 'fault'
-->
<sequence name="fault">
- <!-- Log the error -->
<log level="custom">
<property name="text" value="An unexpected error occured"/>
<property name="message"
expression="get-property('ERROR_MESSAGE')"/>
- <!--<property name="detail"
expression="get-property('ERROR_DETAIL')"/>-->
</log>
+ <drop/>
+ </sequence>
- <!-- create a custom fault message -->
- <makefault>
- <code value="tns:Receiver"
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
- <reason expression="get-property('ERROR_MESSAGE')"/>
- </makefault>
-
- <property name="RESPONSE" value="true"/>
- <header name="To" expression="get-property('ReplyTo')"/>
- <send/>
+ <sequence name="sunErrorHandler">
+ <log level="custom">
+ <property name="text" value="An unexpected error occured for stock
SUN"/>
+ <property name="message"
expression="get-property('ERROR_MESSAGE')"/>
+ </log>
+ <drop/>
</sequence>
<!-- default message handling sequence used by Synapse - named 'main' -->
<sequence name="main">
<in>
- <switch source="//m0:getQuote/m0:request/m0:symbol"
- xmlns:m0="http://services.samples/xsd">
+ <switch source="//m0:getQuote/m0:request/m0:symbol"
xmlns:m0="http://services.samples/xsd">
<case regex="IBM">
<send>
- <endpoint key="simple"/>
+ <endpoint><address
uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/></endpoint>
</send>
</case>
<case regex="MSFT">
<send>
- <endpoint key="bogusHost"/>
+ <endpoint key="bogus"/>
</send>
</case>
<case regex="SUN">
- <send>
- <endpoint key="bogusPort"/>
- </send>
+ <sequence key="sunSequence"/>
</case>
</switch>
<drop/>
@@ -84,4 +63,10 @@
</out>
</sequence>
-</definitions>
+ <sequence name="sunSequence" onError="sunErrorHandler">
+ <send>
+ <endpoint key="sunPort"/>
+ </send>
+ </sequence>
+
+</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=518202&r1=518201&r2=518202
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
(original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html Wed
Mar 14 09:18:26 2007
@@ -458,66 +458,43 @@
for "version" defines a simple text/string registry entry for that is visible
to all messages that passes through Synapse.</p>
-<h2><a name="Sample4">HERE___</a></h2>
-
<h2><a name="Sample41" id="Sample41">Sample 4:</a></h2>
<pre><!-- introduction to error handling -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
- <!-- define an endpoint for the stock quote service -->
- <endpoint name="simple">
- <address
uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
- </endpoint>
-
- <!-- define a non-existent host to test error handling (runtime
exception for invalid host)-->
- <endpoint name="bogusHost">
- <address
uri="http://bogus:9000/axis2/services/NonExistentStockQuoteService"/>
- </endpoint>
-
- <!-- define a non-existent port to test error handling (error handling)
-->
- <endpoint name="bogusPort">
- <address
uri="http://localhost:9009/axis2/services/NonExistentStockQuoteService"/>
- </endpoint>
-
<!-- the default fault handling sequence used by Synapse - named
'fault' -->
<sequence name="fault">
- <!-- Log the error -->
<log level="custom">
<property name="text" value="An unexpected error occured"/>
<property name="message"
expression="get-property('ERROR_MESSAGE')"/>
- <!-- # pick stack trace # <property name="detail"
expression="get-property('ERROR_DETAIL')"/>-->
</log>
+<drop/>
+ </sequence>
- <!-- create a custom fault message -->
- <makefault>
- <code value="tns:Receiver"
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
- <reason expression="get-property('ERROR_MESSAGE')"/>
- </makefault>
-
- <property name="RESPONSE" value="true"/>
- <header name="To" expression="get-property('ReplyTo')"/>
- <send/>
+<sequence name="sunErrorHandler">
+ <log level="custom">
+ <property name="text" value="An unexpected error occured for
stock SUN"/>
+ <property name="message"
expression="get-property('ERROR_MESSAGE')"/>
+ </log>
+<drop/>
</sequence>
<!-- default message handling sequence used by Synapse - named 'main'
-->
<sequence name="main">
<in>
- <switch source="//m0:getQuote/m0:request/m0:symbol"
- xmlns:m0="http://services.samples/xsd">
+ <switch source="//m0:getQuote/m0:request/m0:symbol"
xmlns:m0="http://services.samples/xsd">
<case regex="IBM">
<send>
- <endpoint key="simple"/>
+ <endpoint><address
uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/></endpoint>
</send>
</case>
<case regex="MSFT">
<send>
- <endpoint key="bogusHost"/>
+ <endpoint key="bogus"/>
</send>
</case>
<case regex="SUN">
- <send>
- <endpoint key="bogusPort"/>
- </send>
+<sequence key="sunSequence"/>
</case>
</switch>
<drop/>
@@ -528,12 +505,17 @@
</out>
</sequence>
-</definitions>
+<sequence name="sunSequence" onError="sunErrorHandler">
+ <send>
+ <endpoint key="sunPort"/>
+ </send>
+</sequence>
+</definitions>
</pre>
-<p><strong>Objective: Introduction to error handling with the try and
-makefault mediators</strong></p>
+<p><strong>Objective: Introduction to error handling with the 'fault'
+sequence</strong></p>
<p><strong>Pre-Requisites:</strong><br>
Start the Synapse configuration numbered 4: i.e. synapse -sample 4<br>
@@ -561,63 +543,77 @@
mediator on encountering an exception. At the client end, you would see the
custom SOAP fault message instead of a stock quote.</p>
-<h2><a name="Sample5">Sample 5:</a></h2>
-<pre><synapse xmlns="http://ws.apache.org/ns/synapse">
+<h2><a name="Sample5">HERE___</a></h2>
- <!-- error handling within a sequence using the 'onError' sequence
-->
- <definitions>
+<h2><a name="Sample51" id="Sample51">Sample 5:</a></h2>
+<pre><!-- introduction to error handling -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
- <!-- define an endpoint for the stock quote service -->
- <endpoint name="simple"
-
address="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
-
- <!-- define a non-existent endpoint to test error handling -->
- <endpoint name="bogus"
-
address="http://localhost:9009/axis2/services/NonExistentStockQuoteService"/>
+ <!-- define an endpoint for the stock quote service -->
+ <endpoint name="simple">
+ <address
uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
+ </endpoint>
- <!-- demonstrate the specification of an error handler sequence for
a sequence -->
- <sequence name="stockquote" onError="errorHandler">
+ <!-- define a non-existent host to test error handling (runtime
exception for invalid host)-->
+ <endpoint name="bogusHost">
+ <address
uri="http://bogus:9000/axis2/services/NonExistentStockQuoteService"/>
+ </endpoint>
+
+ <!-- define a non-existent port to test error handling (error handling)
-->
+ <endpoint name="bogusPort">
+ <address
uri="http://localhost:9009/axis2/services/NonExistentStockQuoteService"/>
+ </endpoint>
+
+ <!-- the default fault handling sequence used by Synapse - named
'fault' -->
+ <sequence name="myFaultHandler">
+ <!-- Log the error -->
+ <log level="custom">
+ <property name="text" value="An unexpected error occured"/>
+ <property name="message"
expression="get-property('ERROR_MESSAGE')"/>
+ <!-- # pick stack trace # <property name="detail"
expression="get-property('ERROR_DETAIL')"/>-->
+ </log>
+
+ <!-- create a custom fault message -->
+ <makefault>
+ <code value="tns:Receiver"
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
+ <reason expression="get-property('ERROR_MESSAGE')"/>
+ </makefault>
+
+ <property name="RESPONSE" value="true"/>
+ <header name="To" expression="get-property('ReplyTo')"/>
+ <send/>
+ </sequence>
+
+ <!-- default message handling sequence used by Synapse - named 'main'
-->
+ <sequence name="main" onError="myFaultHandler">
+ <in>
<switch source="//m0:getQuote/m0:request/m0:symbol"
xmlns:m0="http://services.samples/xsd">
<case regex="IBM">
<send>
- <endpoint ref="simple"/>
+ <endpoint key="simple"/>
</send>
</case>
<case regex="MSFT">
<send>
- <endpoint ref="bogus"/>
+ <endpoint key="bogusHost"/>
+ </send>
+ </case>
+ <case regex="SUN">
+ <send>
+ <endpoint key="bogusPort"/>
</send>
</case>
</switch>
- </sequence>
-
- <!-- define a sequence to be used for error handling -->
- <sequence name="errorHandler">
-
- <!-- Log the error -->
- <log level="custom">
- <property name="text" value="An unexpected error
occured"/>
- <property name="message"
expression="get-property('ERROR_MESSAGE')"/>
- <property name="detail"
expression="get-property('ERROR_DETAIL')"/>
- </log>
-
- <!-- create a custom fault message -->
- <makefault>
- <code value="tns:Receiver"
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
- <reason expression="get-property('ERROR_MESSAGE')"/>
- </makefault>
+ <drop/>
+ </in>
+ <out>
<send/>
- </sequence>
-
- </definitions>
+ </out>
+ </sequence>
- <rules>
- <sequence ref="stockquote"/>
- <send/>
- </rules>
-</synapse> </pre>
+</definitions> </pre>
<p><strong>Objective: Introduction to error handling within a sequence using
the 'onError' sequence</strong></p>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]