You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by hi...@apache.org on 2010/09/26 08:12:09 UTC

svn commit: r1001366 - in /synapse/branches/2.0: repository/conf/sample/synapse_sample_362.xml src/site/xdoc/Synapse_Samples.xml

Author: hiranya
Date: Sun Sep 26 06:12:09 2010
New Revision: 1001366

URL: http://svn.apache.org/viewvc?rev=1001366&view=rev
Log:
Fixing a sample


Modified:
    synapse/branches/2.0/repository/conf/sample/synapse_sample_362.xml
    synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml

Modified: synapse/branches/2.0/repository/conf/sample/synapse_sample_362.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.0/repository/conf/sample/synapse_sample_362.xml?rev=1001366&r1=1001365&r2=1001366&view=diff
==============================================================================
--- synapse/branches/2.0/repository/conf/sample/synapse_sample_362.xml (original)
+++ synapse/branches/2.0/repository/conf/sample/synapse_sample_362.xml Sun Sep 26 06:12:09 2010
@@ -68,8 +68,9 @@
                 </connection>
                 <statement>
                     <sql>select * from company where name =?</sql>
-                    <parameter xmlns:m0="http://services.samples/xsd"
-                               expression="//m0:return/m0:symbol/child::text()" type="VARCHAR"/>
+                    <parameter xmlns:m1="http://services.samples/xsd"
+                               xmlns:m0="http://services.samples"
+                               expression="//m0:return/m1:symbol/child::text()" type="VARCHAR"/>
                     <result name="stock_price" column="price"/>
                 </statement>
             </dblookup>

Modified: synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml
URL: http://svn.apache.org/viewvc/synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml?rev=1001366&r1=1001365&r2=1001366&view=diff
==============================================================================
--- synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/branches/2.0/src/site/xdoc/Synapse_Samples.xml Sun Sep 26 06:12:09 2010
@@ -3240,7 +3240,7 @@ require 'rexml/document'
 include REXML
 
 def transformRequest(mc)
-   newRequest= Document.new '&lt;m:getQuote xmlns:m=&quot;http://services.samples/xsd&quot;&gt;'&lt;&lt;
+   newRequest= Document.new '&lt;m:getQuote xmlns:m=&quot;http://services.samples&quot;&gt;'&lt;&lt;
       '&lt;m:request&gt;&lt;m:symbol&gt;&lt;/m:symbol&gt;&lt;/m:request&gt;&lt;/m:getQuote&gt;'
    newRequest.root.elements[1].elements[1].text = mc.getPayloadXML().root.elements[1].get_text
    mc.setPayloadXML(newRequest)
@@ -3274,7 +3274,7 @@ end
             &lt;![CDATA[
                 require 'rexml/document'
                 include REXML
-                newRequest= Document.new '&lt;m:getQuote xmlns:m=&quot;http://services.samples/xsd&quot;&gt;&lt;m:request&gt;&lt;m:symbol&gt;...test...&lt;/m:symbol&gt;&lt;/m:request&gt;&lt;/m:getQuote&gt;'
+                newRequest= Document.new '&lt;m:getQuote xmlns:m=&quot;http://services.samples&quot;&gt;&lt;m:request&gt;&lt;m:symbol&gt;...test...&lt;/m:symbol&gt;&lt;/m:request&gt;&lt;/m:getQuote&gt;'
                 newRequest.root.elements[1].elements[1].text = $mc.getPayloadXML().root.elements[1].get_text
                 $mc.setPayloadXML(newRequest)
             ]]&gt;
@@ -3485,10 +3485,11 @@ end
 <div>
 <p>
 <strong>Objective:Introduction to the dbreport mediator</strong> </p>
+<p>
 <strong>Prerequisites:</strong>
 <br/>Setting up Derby database as above.
 <br/>Start the Synapse configuration numbered 361: i.e. synapse -sample 361
-<br/>Start the Axis2 server and deploy the SimpleStockQuoteService if not already done</div>
+<br/>Start the Axis2 server and deploy the SimpleStockQuoteService if not already done</p></div>
 <p>This sample demonstrates simple database write operations. The dbreport mediator writes (i.e. inserts one row) to a table using the message details. It works the same as the dblookup mediator. In this sample , dbreport mediator is used for updating the stock price of the company using the last quote value which is calculated by evaluating an XPath against the response message. After running this sample, user can check the company table using the Derby client tool. It will show the inserted value by the dbreport mediator. </p>
 <p>Run the client using, </p>
 <pre xml:space="preserve">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</pre>
@@ -3499,63 +3500,64 @@ end
 <p/>
 <h2>
 <a name="Sample362" id="Sample362">Sample 362: Action of dbreport and dblookup mediators together</a></h2>
-<pre xml:space="preserve">&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+<pre xml:space="preserve">&lt;definitions xmlns="http://synapse.apache.org/ns/2010/04/configuration"&gt;
 
-    &lt;sequence name=&quot;main&quot;&gt;
+    &lt;sequence name="main" trace="enable"&gt;
         &lt;in&gt;
             &lt;send&gt;
                 &lt;endpoint&gt;
-                    &lt;address uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
+                    &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&gt;
                 &lt;/endpoint&gt;
             &lt;/send&gt;
         &lt;/in&gt;
 
         &lt;out&gt;
-            &lt;log level=&quot;custom&quot;&gt;
-                &lt;property name=&quot;text&quot;
-                          value=&quot;** Reporting to the Database **&quot;/&gt;
+            &lt;log level="custom"&gt;
+                &lt;property name="text" value="** Reporting to the Database **"/&gt;
             &lt;/log&gt;
 
-            &lt;dbreport xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+            &lt;dbreport&gt;
                 &lt;connection&gt;
                     &lt;pool&gt;
-                        &lt;driver&gt;org.apache.derby.jdbc.ClientDriver&lt;/driver&gt;
-                        &lt;url&gt;jdbc:derby://localhost:1527/synapsedb;create=false&lt;/url&gt;
-                        &lt;user&gt;synapse&lt;/user&gt;
-                        &lt;password&gt;synapse&lt;/password&gt;
+                        &lt;driver&gt;com.mysql.jdbc.Driver&lt;/driver&gt;
+                        &lt;url&gt;jdbc:mysql://localhost:3306/synapsedb&lt;/url&gt;
+                        &lt;user&gt;root&lt;/user&gt;
+                        &lt;password&gt;root123&lt;/password&gt;
                     &lt;/pool&gt;
                 &lt;/connection&gt;
                 &lt;statement&gt;
                     &lt;sql&gt;update company set price=? where name =?&lt;/sql&gt;
-                    &lt;parameter expression=&quot;//m0:return/m0:last/child::text()&quot;
-                               xmlns:m0=&quot;http://services.samples/xsd&quot; type=&quot;DOUBLE&quot;/&gt;
-                    &lt;parameter expression=&quot;//m0:return/m0:symbol/child::text()&quot;
-                               xmlns:m0=&quot;http://services.samples/xsd&quot; type=&quot;VARCHAR&quot;/&gt;
+                    &lt;parameter xmlns:m1="http://services.samples/xsd"
+                               xmlns:m0="http://services.samples"
+                               expression="//m0:return/m1:last/child::text()" type="DOUBLE"/&gt;
+                    &lt;parameter xmlns:m1="http://services.samples/xsd"
+                               xmlns:m0="http://services.samples"
+                               expression="//m0:return/m1:symbol/child::text()" type="VARCHAR"/&gt;
                 &lt;/statement&gt;
             &lt;/dbreport&gt;
-            &lt;log level=&quot;custom&quot;&gt;
-                &lt;property name=&quot;text&quot;
-                          value=&quot;** Looking up from the Database **&quot;/&gt;
+            &lt;log level="custom"&gt;
+                &lt;property name="text" value="** Looking up from the Database **"/&gt;
             &lt;/log&gt;
-            &lt;dblookup xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+            &lt;dblookup&gt;
                 &lt;connection&gt;
                     &lt;pool&gt;
-                        &lt;driver&gt;org.apache.derby.jdbc.ClientDriver&lt;/driver&gt;
-                        &lt;url&gt;jdbc:derby://localhost:1527/synapsedb;create=false&lt;/url&gt;
-                        &lt;user&gt;synapse&lt;/user&gt;
-                        &lt;password&gt;synapse&lt;/password&gt;
+                        &lt;driver&gt;com.mysql.jdbc.Driver&lt;/driver&gt;
+                        &lt;url&gt;jdbc:mysql://localhost:3306/synapsedb&lt;/url&gt;
+                        &lt;user&gt;root&lt;/user&gt;
+                        &lt;password&gt;root123&lt;/password&gt;
                     &lt;/pool&gt;
                 &lt;/connection&gt;
                 &lt;statement&gt;
                     &lt;sql&gt;select * from company where name =?&lt;/sql&gt;
-                    &lt;parameter expression=&quot;//m0:return/m0:symbol/child::text()&quot;
-                               xmlns:m0=&quot;http://services.samples/xsd&quot; type=&quot;VARCHAR&quot;/&gt;
-                    &lt;result name=&quot;stock_price&quot; column=&quot;price&quot;/&gt;
+                    &lt;parameter xmlns:m1="http://services.samples/xsd"
+                               xmlns:m0="http://services.samples"
+                               expression="//m0:return/m1:symbol/child::text()" type="VARCHAR"/&gt;
+                    &lt;result name="stock_price" column="price"/&gt;
                 &lt;/statement&gt;
             &lt;/dblookup&gt;
-            &lt;log level=&quot;custom&quot;&gt;
-                &lt;property name=&quot;text&quot;
-                          expression=&quot;fn:concat('Stock price - ',get-property('stock_price'))&quot;/&gt;
+            &lt;log level="custom"&gt;
+                &lt;property name="text"
+                          expression="fn:concat('Stock price - ',get-property('stock_price'))"/&gt;
             &lt;/log&gt;
             &lt;send/&gt;
         &lt;/out&gt;