Author: indika
Date: Mon Jan  7 23:44:16 2008
New Revision: 11978

Log:

add simple sample for callout mediator and update the docs 


Added:
   trunk/esb/java/repository/conf/sample/synapse_sample_430.xml
Modified:
   trunk/esb/java/modules/distribution/src/main/docs/ESB_Samples.html
   trunk/esb/java/pom.xml

Modified: trunk/esb/java/modules/distribution/src/main/docs/ESB_Samples.html
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/docs/ESB_Samples.html  
(original)
+++ trunk/esb/java/modules/distribution/src/main/docs/ESB_Samples.html  Mon Jan 
 7 23:44:16 2008
@@ -215,6 +215,13 @@
             ESB for the actual service</a></li>
         </ul>
       </li>
+      <li><a href="#Callout">Synchronize web service invocation with Callout
+        mediator</a> 
+        <ul>
+          <li><a href="#Sample430">Sample 430: Simple Callout Mediator for
+            Synchronize web service invocation </a></li>
+        </ul>
+      </li>
     </ul>
   </li>
 </ul>
@@ -4068,7 +4075,7 @@
         &lt;/target&gt;
         &lt;publishWSDL 
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
     &lt;/proxy&gt;
-&lt;/definitions&gt;                                                           
  </pre>
+&lt;/definitions&gt; </pre>
 
 <p>This example uses the XQuery mediator to perform transformations. This
 sample behaves the same as sample number 8 and the only difference is that
@@ -4256,8 +4263,58 @@
 the requests will be served by the cache inside ESB. You could observe this
 by looking at the printed line of the axis2 server, as well as by observing a
 constant rate as the response to the client instead of the random rate, which
-changes by each and every 20 seconds.</p>
+changes by each and every 20 seconds.<br>
+</p>
+
+<h2><a name="Callout">Synchronize web service invocation with Callout
+mediator </a></h2>
+
+<p>The Callout mediator does the call for provided service URL with the
+request message which get through source attribute and wait for the response
+and attached received response to the destination which has specified by the
+target. Both of source and target could be a key or a XPath. In the case of
+source ,this key refers to either a message context property or to a local
+entry and for the target this key refers only to a message context property
+.</p>
+
+<h2><a name="Sample430">Sample 430: Simple Callout Mediator for Synchronize
+web service invocation </a></h2>
 
 <p>&#xa0;</p>
+<pre>                                                                 
&#xa0;&#xa0;&lt;!-- Simple callout  mediator --&gt;
+&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+    &lt;callout serviceURL="http://localhost:9000/soap/SimpleStockQuoteService";
+             action="urn:getQuote"&gt;
+        &lt;source xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/";
+                xmlns:s12="http://www.w3.org/2003/05/soap-envelope";
+                xpath="s11:Body/child::*[fn:position()=1] | 
s12:Body/child::*[fn:position()=1]"/&gt;
+        &lt;target xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/";
+                xmlns:s12="http://www.w3.org/2003/05/soap-envelope";
+                xpath="s11:Body/child::*[fn:position()=1] | 
s12:Body/child::*[fn:position()=1]"/&gt;
+    &lt;/callout&gt;
+    &lt;property name="RESPONSE" value="true"/&gt;
+    &lt;header name="To" action="remove"/&gt;
+    &lt;send/&gt;
+    &lt;drop/&gt;
+&lt;/definitions&gt; </pre>
+
+<div>
+<p><strong>Objective:</strong> Demonstrate the use of the Callout mediator
+for the synchronize web service invocation</p>
+
+<p><strong>Prerequisites:</strong>Deploy the SimpleStockQuoteService in
+sample Axis2 server and start it on port 9000.</p>
+
+<p>Start Synapse with the sample configuration 430 (i.e. synapse -sample
+430).</p>
+
+<p>In this sample , Callout mediator does the direct service invocation to
+the StockQuoteService using the client request and the get the response and
+set it as the first child of the SOAP message body. Then using send mediator
+message is sent back to the client. </p>
+
+<p>Invoke the client as follows. </p>
+</div>
+<pre>ant stockquote 
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService 
-Dtrpurl=http://localhost:8080/</pre>
 </body>
 </html>

Modified: trunk/esb/java/pom.xml
==============================================================================
--- trunk/esb/java/pom.xml      (original)
+++ trunk/esb/java/pom.xml      Mon Jan  7 23:44:16 2008
@@ -670,7 +670,7 @@
         <slf4j.version>1.0.1</slf4j.version>
 
         <!-- Synapse and related components -->
-        <synapse.version>1.1.1-SNAPSHOT</synapse.version>
+        <synapse.version>1.1.1</synapse.version>
         
<jakarta.httpcore.nio.version>4.0-alpha7-SNAPSHOT</jakarta.httpcore.nio.version>
         <smack.version>2.2.1</smack.version>
 

Added: trunk/esb/java/repository/conf/sample/synapse_sample_430.xml
==============================================================================
--- (empty file)
+++ trunk/esb/java/repository/conf/sample/synapse_sample_430.xml        Mon Jan 
 7 23:44:16 2008
@@ -0,0 +1,35 @@
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+    <!-- Simple callout  mediator -->
+<definitions xmlns="http://ws.apache.org/ns/synapse";>
+    <callout serviceURL="http://localhost:9000/soap/SimpleStockQuoteService";
+             action="urn:getQuote">
+        <source xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/";
+                xmlns:s12="http://www.w3.org/2003/05/soap-envelope";
+                xpath="s11:Body/child::*[fn:position()=1] | 
s12:Body/child::*[fn:position()=1]"/>
+        <target xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/";
+                xmlns:s12="http://www.w3.org/2003/05/soap-envelope";
+                xpath="s11:Body/child::*[fn:position()=1] | 
s12:Body/child::*[fn:position()=1]"/>
+    </callout>
+    <property name="RESPONSE" value="true"/>
+    <header name="To" action="remove"/>
+    <send/>
+    <drop/>
+</definitions>
\ No newline at end of file

_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to