Hi,

I revised the script mediator samples with the current configuration
language. i modified the Synapse_Samples.html and attached the patch 
with this. Please review it and apply the patch.

Thanks,
Kasun
Index: Synapse_Samples.html
===================================================================
--- Synapse_Samples.html	(revision 532180)
+++ Synapse_Samples.html	(working copy)
@@ -1820,41 +1820,41 @@
 directory which are required. </p>
 
 <h2><a name="Sample500">Sample 500:</a></h2>
-<pre>&lt;synapse xmlns="http://ws.apache.org/ns/synapse"&gt;
+<pre>&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;!-- Introduction to the script mediator --&gt;
 
-    &lt;definitions&gt;
+    
 
         &lt;!-- define a static property for the JavaScript source code file --&gt;
-        &lt;set-property name="stockquoteScript" src="file:repository/conf/sample/resources/script/stockquoteTransform.js"/&gt;
+        &lt;localEntry key="stockquoteScript" src="file:repository/conf/sample/resources/script/stockquoteTransform.js"/&gt;
 
         &lt;!-- define a reuseable endpoint definition and use it within config --&gt;
-        &lt;endpoint name="stockquote" address="http://localhost:9000/axis2/services/SimpleStockQuoteService"/&gt;
+        &lt;endpoint name="stockquote"&gt;
+               &lt;address uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/&gt;
+        &lt;/endpoint&gt;
+    
 
-    &lt;/definitions&gt;
-
-    &lt;rules&gt;
         &lt;in&gt;
             &lt;!-- transform the custom quote request into a standard quote request expected by the service --&gt;
-            &lt;script key="stockquoteScript" function="transformRequest"/&gt;
+            &lt;script language="js" key="stockquoteScript" function="transformRequest"/&gt;
 
             &lt;!-- send message to real endpoint referenced by name "stockquote" and stop --&gt;
             &lt;send&gt;
-                &lt;endpoint ref="stockquote"/&gt;
+                &lt;endpoint key="stockquote"/&gt;
             &lt;/send&gt;
         &lt;/in&gt;
 
         &lt;out&gt;
             &lt;!-- transform the standard response back into the custom format the client expects --&gt;
-            &lt;script key="stockquoteScript" function="transformResponse"/&gt;
+            &lt;script language="js" key="stockquoteScript" function="transformResponse"/&gt;
 
             &lt;!-- now send the custom response back to the client and stop --&gt;
             &lt;send/&gt;
         &lt;/out&gt;
-    &lt;/rules&gt;
+    
 
-&lt;/synapse&gt; </pre>
+&lt;/definitions&gt; </pre>
 
 <p><strong>Objective: Introduction to script mediators</strong></p>
 
@@ -1900,21 +1900,18 @@
 message processing.</p>
 
 <h2><a name="Sample501">Sample 501:</a></h2>
-<pre>&lt;synapse xmlns="http://ws.apache.org/ns/synapse"&gt;
+<pre>&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;!-- Introduction to the script mediator using in-line scripts --&gt;
 
-    &lt;definitions&gt;
+    &lt;!-- define a reuseable endpoint definition and use it within config --&gt;
+    &lt;endpoint name="stockquote"&gt;
+            &lt;address uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/&gt;
+    &lt;/endpoint&gt;
 
-        &lt;!-- define a reuseable endpoint definition and use it within config --&gt;
-        &lt;endpoint name="stockquote" address="http://localhost:9000/axis2/services/SimpleStockQuoteService"/&gt;
-
-    &lt;/definitions&gt;
-
-    &lt;rules&gt;
-        &lt;in&gt;
+    &lt;in&gt;
             &lt;!-- transform the custom quote request into a standard quote requst expected by the service --&gt;
-            &lt;script.js&gt;&lt;![CDATA[
+            &lt;script language="js"&gt;&lt;![CDATA[
                var symbol = mc.getPayloadXML()..*::Code.toString();
                mc.setPayloadXML(
                   &lt;m:getQuote xmlns:m="http://services.samples/xsd"&gt;
@@ -1922,17 +1919,17 @@
                         &lt;m:symbol&gt;{symbol}&lt;/m:symbol&gt;
                      &lt;/m:request&gt;
                   &lt;/m:getQuote&gt;);
-            ]]&gt;&lt;/script.js&gt;
+            ]]&gt;&lt;/script&gt;
 
             &lt;!-- send message to real endpoint referenced by name "stockquote" and stop --&gt;
             &lt;send&gt;
-                &lt;endpoint ref="stockquote"/&gt;
+                &lt;endpoint key="stockquote"/&gt;
             &lt;/send&gt;
-        &lt;/in&gt;
+     &lt;/in&gt;
 
-        &lt;out&gt;
+     &lt;out&gt;
             &lt;!-- transform the standard response back into the custom format the client expects --&gt;
-            &lt;script.js&gt;&lt;![CDATA[
+            &lt;script language="js"&gt;&lt;![CDATA[
                var symbol = mc.getPayloadXML()..*::symbol.toString();
                var price = mc.getPayloadXML()..*::last.toString();
                mc.setPayloadXML(
@@ -1940,14 +1937,14 @@
                &lt;m:Code&gt;{symbol}&lt;/m:Code&gt;
                &lt;m:Price&gt;{price}&lt;/m:Price&gt;
                   &lt;/m:CheckPriceResponse&gt;);
-            ]]&gt;&lt;/script.js&gt;
+            ]]&gt;&lt;/script&gt;
 
             &lt;!-- now send the custom response back to the client and stop --&gt;
             &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/rules&gt;
+     &lt;/out&gt;
+    
 
-&lt;/synapse&gt; </pre>
+&lt;/definitions&gt;  </pre>
 
 <p><strong>Objective: Introduction to in-line script mediators</strong></p>
 
@@ -1985,41 +1982,41 @@
 message processing.</p>
 
 <h2><a name="Sample503">Sample 503:</a></h2>
-<pre>&lt;synapse xmlns="http://ws.apache.org/ns/synapse"&gt;
+<pre>&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;!-- Introduction to the script mediator with Ruby scripts--&gt;
 
-    &lt;definitions&gt;
+    &lt;!-- define a static property for the JRuby source code file --&gt;
+    &lt;localEntry key="stockquoteScript"&gt;
+          &lt;address  src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/&gt;
+    &lt;/localEntry&gt;
 
-        &lt;!-- define a static property for the JRuby source code file --&gt;
-        &lt;set-property name="stockquoteScript" src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/&gt;
+    &lt;!-- define a reuseable endpoint definition and use it within config --&gt;
+    &lt;endpoint name="stockquote"&gt;
+          &lt;address  uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/&gt;
+    &lt;/endpoint&gt;
+    
 
-        &lt;!-- define a reuseable endpoint definition and use it within config --&gt;
-        &lt;endpoint name="stockquote" address="http://localhost:9000/axis2/services/SimpleStockQuoteService"/&gt;
-
-    &lt;/definitions&gt;
-
-    &lt;rules&gt;
-        &lt;in&gt;
+    &lt;in&gt;
             &lt;!-- transform the custom quote request into a standard quote request expected by the service --&gt;
-            &lt;script key="stockquoteScript" function="transformRequest"/&gt;
+            &lt;script language="rb" key="stockquoteScript" function="transformRequest"/&gt;
 
             &lt;!-- send message to real endpoint referenced by name "stockquote" and stop --&gt;
             &lt;send&gt;
-                &lt;endpoint ref="stockquote"/&gt;
+                &lt;endpoint key="stockquote"/&gt;
             &lt;/send&gt;
-        &lt;/in&gt;
+    &lt;/in&gt;
 
-        &lt;out&gt;
+    &lt;out&gt;
             &lt;!-- transform the standard response back into the custom format the client expects --&gt;
-            &lt;script key="stockquoteScript" function="transformResponse"/&gt;
+            &lt;script language="rb" key="stockquoteScript" function="transformResponse"/&gt;
 
             &lt;!-- now send the custom response back to the client and stop --&gt;
             &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/rules&gt;
+    &lt;/out&gt;
+    
 
-&lt;/synapse&gt; </pre>
+&lt;/definitions&gt; </pre>
 
 <p><strong>Objective: Script mediators using Ruby</strong></p>
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to