Author: chathura_ce
Date: Mon May 21 22:57:12 2007
New Revision: 540430

URL: http://svn.apache.org/viewvc?view=rev&rev=540430
Log:
Documented the WS-RM samples. Both client to synapse and synapse to server.

Modified:
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_104.xml
    webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html

Modified: 
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_104.xml
URL: 
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_104.xml?view=diff&rev=540430&r1=540429&r2=540430
==============================================================================
--- 
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_104.xml 
(original)
+++ 
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_104.xml 
Mon May 21 22:57:12 2007
@@ -16,7 +16,7 @@
   ~  specific language governing permissions and limitations
   ~  under the License.
   -->
-<!-- attaching service level WS-Security policies to proxy services -->
+<!-- attaching service level WS-RM policies to proxy services -->
 <definitions xmlns="http://ws.apache.org/ns/synapse";>
     <proxy name="StockQuoteProxy">
         <target>

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=540430&r1=540429&r2=540430
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html 
(original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html Mon 
May 21 22:57:12 2007
@@ -1210,6 +1210,192 @@
    &lt;/m0:request&gt;
 &lt;/m0:getQuote&gt;0</pre>
 
+<h2><a name="Sample53">Sample 53:</a></h2>
+<pre>&lt;!-- RMSequence example --&gt;
+&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;in&gt;
+        &lt;RMSequence single="true" version="1.0"/&gt;
+        &lt;send&gt;
+           &lt;endpoint name="reliable"&gt;
+              &lt;address 
uri="http://localhost:9000/soap/ReliableStockQuoteService"&gt;
+                 &lt;enableRM/&gt;
+                 &lt;enableAddressing/&gt;
+              &lt;/address&gt;
+           &lt;/endpoint&gt;
+        &lt;/send&gt;
+    &lt;/in&gt;
+    &lt;out&gt;
+        &lt;header name="wsrm:SequenceAcknowledgement" action="remove"
+                xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"/&gt;
+        &lt;header name="wsrm:Sequence" action="remove"
+                xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"/&gt;
+        &lt;send/&gt;
+    &lt;/out&gt;
+
+&lt;/definitions&gt;</pre>
+<strong>Objective: Demontrate the message exchange between Synapse and the
+server using WS-ReliableMessaging (WS-RM)</strong> 
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Deploy the ReliableStockQuoteService in the sample Axis2 server by
+switching to the samples/axis2Server/src/ReliableStockQuoteService directory
+and running ant.</p>
+
+<p>Start the sample Axis2 server on port 9000.</p>
+
+<p>Start Synapse with the sample configuration 53 (i.e. synapse -sample
+53).</p>
+
+<p></p>
+
+<p>In the above configuration, WS-RM is engaged to the endpoint using the
+&lt;enableRM/&gt; tag. It is possible to engage WS-RM to both Address and
+WSDL endpoints using this tag. In addition to the RM enabled endpoint,
+RMSequence mediator is specified before the send mediator. This mediator is
+used to specify the set of messages to be sent using a single RM sequence. In
+this sample it is specified as single message per sequence. It also specifies
+the version of the WS-RM to be used. Refer to the Synapse configuration
+language documentation for more information about the RMSequence mediator. RM
+related SOAP headers are removed form the message in the out mediator as
+WS-RM message exchange happens only between the Synapse and the server. Now
+run the sample client using the following command.</p>
+<pre>ant stockquote -Dsymbol=IBM -Dmode=quote 
-Daddurl=http://localhost:8080</pre>
+
+<p>You can observer the client output displaying the quote price for IBM as
+follows:</p>
+<pre>[java] Standard :: Stock price = $189.2521262517493</pre>
+
+<p>There is no difference to be observed between the normal message exchange
+and WS-RM enabled message exchange as far as client and server outputs are
+considered. But if you look at the wire level messages, you would observe
+additional WS-RM messages and WS-RM elements. Synapse, the initiator of the
+RM sequence, first try to create a sequence by sending a message with
+CreateSequence element.</p>
+<pre>...
+&lt;soapenv:Body&gt;
+   &lt;wsrm:CreateSequence 
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"&gt;
+      &lt;wsrm:AcksTo&gt;
+         
&lt;wsa:Address&gt;http://www.w3.org/2005/08/addressing/anonymous&lt;/wsa:Address&gt;
+      &lt;/wsrm:AcksTo&gt;
+      &lt;wsrm:Offer&gt;
+         
&lt;wsrm:Identifier&gt;urn:uuid:546F6F33FB7D8BBE351179807372769&lt;/wsrm:Identifier&gt;
+      &lt;/wsrm:Offer&gt;
+   &lt;/wsrm:CreateSequence&gt;
+&lt;/soapenv:Body&gt;
+...</pre>
+
+<p>Sample Axis2 server responds to CreateSequence request with the following
+message:</p>
+<pre>...
+&lt;soapenv:Body&gt;
+   &lt;wsrm:CreateSequenceResponse 
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"&gt;
+      
&lt;wsrm:Identifier&gt;urn:uuid:879853A6871A66641C1179807373270&lt;/wsrm:Identifier&gt;
+      &lt;wsrm:Accept&gt;
+         &lt;wsrm:AcksTo&gt;
+            
&lt;wsa:Address&gt;http://localhost:9000/soap/ReliableStockQuoteService&lt;/wsa:Address&gt;
+         &lt;/wsrm:AcksTo&gt;
+      &lt;/wsrm:Accept&gt;
+   &lt;/wsrm:CreateSequenceResponse&gt;
+&lt;/soapenv:Body&gt;
+...</pre>
+
+<p>Once the sequence is estabilished, Synapse sends the request to the server
+with the pre-negotiated sequence ID.</p>
+<pre>&lt;soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing";
+                  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
+    &lt;soapenv:Header&gt;
+        
&lt;wsa:To&gt;http://localhost:9000/soap/ReliableStockQuoteService&lt;/wsa:To&gt;
+        
&lt;wsa:MessageID&gt;urn:uuid:DB9A5257B637DDA38B1179807372560712002-1515891720&lt;/wsa:MessageID&gt;
+        &lt;wsa:Action&gt;urn:getQuote&lt;/wsa:Action&gt;
+        &lt;wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm";
+                       soapenv:mustUnderstand="1"&gt;
+            
&lt;wsrm:Identifier&gt;urn:uuid:879853A6871A66641C1179807373270&lt;/wsrm:Identifier&gt;
+            &lt;wsrm:MessageNumber&gt;1&lt;/wsrm:MessageNumber&gt;
+            &lt;wsrm:LastMessage/&gt;
+        &lt;/wsrm:Sequence&gt;
+    &lt;/soapenv:Header&gt;
+    &lt;soapenv:Body&gt;
+        &lt;m0:getQuote xmlns:m0="http://services.samples/xsd"&gt;
+            &lt;m0:request&gt;
+                &lt;m0:symbol&gt;IBM&lt;/m0:symbol&gt;
+            &lt;/m0:request&gt;
+        &lt;/m0:getQuote&gt;
+    &lt;/soapenv:Body&gt;
+&lt;/soapenv:Envelope&gt;</pre>
+
+<p>Synapse keeps on sending above message till the server reponds with a
+valid response message with 200 OK HTTP header. If the server is not ready
+with a response, it will respond with 202 Accepted HTTP header for all
+requests. Once the server is ready with a response it will send the response
+message with sequence ID as follows.</p>
+<pre>&lt;soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing";
+                  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
+    &lt;soapenv:Header&gt;
+        
&lt;wsa:MessageID&gt;urn:uuid:879853A6871A66641C1179807373804&lt;/wsa:MessageID&gt;
+        
&lt;wsa:Action&gt;http://services.samples/ReliableStockQuoteServicePortType/getQuoteResponse
+        &lt;/wsa:Action&gt;
+        
&lt;wsa:RelatesTo&gt;urn:uuid:DB9A5257B637DDA38B1179807372560712002-1515891720&lt;/wsa:RelatesTo&gt;
+        &lt;wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm";
+                       soapenv:mustUnderstand="1"&gt;
+            
&lt;wsrm:Identifier&gt;urn:uuid:546F6F33FB7D8BBE351179807372769&lt;/wsrm:Identifier&gt;
+            &lt;wsrm:MessageNumber&gt;1&lt;/wsrm:MessageNumber&gt;
+            &lt;wsrm:LastMessage/&gt;
+        &lt;/wsrm:Sequence&gt;
+        &lt;wsrm:SequenceAcknowledgement 
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm";
+                                      soapenv:mustUnderstand="1"&gt;
+            
&lt;wsrm:Identifier&gt;urn:uuid:879853A6871A66641C1179807373270&lt;/wsrm:Identifier&gt;
+            &lt;wsrm:AcknowledgementRange Lower="1" Upper="1"/&gt;
+        &lt;/wsrm:SequenceAcknowledgement&gt;
+    &lt;/soapenv:Header&gt;
+    &lt;soapenv:Body&gt;
+        &lt;ns:getQuoteResponse xmlns:ns="http://services.samples/xsd"&gt;
+...</pre>
+
+<p>Now both Synase and the server are done with the actual message exchange.
+Then Synapse sends a request to terminate the sequence as follows:</p>
+<pre>&lt;soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing";
+                  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
+    &lt;soapenv:Header&gt;
+        
&lt;wsa:To&gt;http://localhost:9000/soap/ReliableStockQuoteService&lt;/wsa:To&gt;
+        
&lt;wsa:MessageID&gt;urn:uuid:546F6F33FB7D8BBE351179807379591&lt;/wsa:MessageID&gt;
+        
&lt;wsa:Action&gt;http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence&lt;/wsa:Action&gt;
+        &lt;wsrm:SequenceAcknowledgement 
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm";
+                                      soapenv:mustUnderstand="1"&gt;
+            
&lt;wsrm:Identifier&gt;urn:uuid:546F6F33FB7D8BBE351179807372769&lt;/wsrm:Identifier&gt;
+            &lt;wsrm:AcknowledgementRange Lower="1" Upper="1"/&gt;
+        &lt;/wsrm:SequenceAcknowledgement&gt;
+    &lt;/soapenv:Header&gt;
+    &lt;soapenv:Body&gt;
+        &lt;wsrm:TerminateSequence 
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"&gt;
+            
&lt;wsrm:Identifier&gt;urn:uuid:879853A6871A66641C1179807373270&lt;/wsrm:Identifier&gt;
+        &lt;/wsrm:TerminateSequence&gt;
+    &lt;/soapenv:Body&gt;
+&lt;/soapenv:Envelope&gt;</pre>
+
+<p>Server reponds to the sequence termination message, accepting to terminate
+the sequence as follows.</p>
+<pre>&lt;soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing";
+                  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
+    &lt;soapenv:Header&gt;
+        &lt;wsa:ReplyTo&gt;
+            
&lt;wsa:Address&gt;http://localhost:9000/soap/ReliableStockQuoteService&lt;/wsa:Address&gt;
+        &lt;/wsa:ReplyTo&gt;
+        
&lt;wsa:MessageID&gt;urn:uuid:879853A6871A66641C1179807380190&lt;/wsa:MessageID&gt;
+        
&lt;wsa:Action&gt;http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence&lt;/wsa:Action&gt;
+    &lt;/soapenv:Header&gt;
+    &lt;soapenv:Body&gt;
+        &lt;wsrm:TerminateSequence 
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"&gt;
+            
&lt;wsrm:Identifier&gt;urn:uuid:546F6F33FB7D8BBE351179807372769&lt;/wsrm:Identifier&gt;
+        &lt;/wsrm:TerminateSequence&gt;
+    &lt;/soapenv:Body&gt;
+&lt;/soapenv:Envelope&gt;</pre>
+
+<p>Note that although each of above messages are separate SOAP messages, in
+most cases they will be exchanged in a single socket connection as HTTP
+Keep-Alive header is used.</p>
+
 <h2><a name="Sample54">Sample 54:</a></h2>
 <pre>&lt;!-- demontrates simple session less load balancing between 3 
endpoints --&gt;
 &lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
@@ -1945,6 +2131,57 @@
 that the response received does not use WS-Security, but that the response
 being forwarded back to the client is signed and encrypted as expected by the
 client.</p>
+
+<h2><a name="Sample104">Sample 104:</a></h2>
+<pre>&lt;!-- attaching service level WS-RM policies to proxy services --&gt;
+&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+    &lt;proxy name="StockQuoteProxy"&gt;
+        &lt;target&gt;
+            &lt;inSequence&gt;
+                &lt;header name="wsrm:SequenceAcknowledgement" action="remove"
+                        
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"/&gt;
+                &lt;header name="wsrm:Sequence" action="remove"
+                        
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"/&gt;
+                &lt;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;address 
uri="http://localhost:9000/soap/SimpleStockQuoteService"/&gt;
+                    &lt;/endpoint&gt;
+                &lt;/send&gt;
+            &lt;/inSequence&gt;
+            &lt;outSequence&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+        &lt;publishWSDL 
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/&gt;
+        &lt;enableRM/&gt;
+    &lt;/proxy&gt;
+&lt;/definitions&gt;</pre>
+<strong>Objective: Demontrate the reliable message exchange between the
+client and Synapse using WS-ReliableMessaging (WS-RM)</strong>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Deploy the SimpleStockQuoteService in the sample Axis2 server and start it
+on port 9000.</p>
+
+<p>Start Synapse with the sample configuration number 104 (i.e. synapse
+-sample 104).</p>
+
+<p></p>
+
+<p>In the above configuration, a proxy service is created with WS-RM enabled
+using the &lt;enableRM/&gt; tag. Therefore, this proxy service is capable of
+communicating with a WS-RM client. It also removes the WS-RM headers in the
+In Sequence before the message is sent to the back end server. This is
+required as the reliable messaging is applicable only between the client and
+Synapse. Now start the client with WS-RM as follows:</p>
+<pre>ant stockquote -Dsymbol=IBM -Dmode=quote 
-Daddurl=http://localhost:8081/soap/StockQuoteProxy -Dwsrm=true</pre>
+
+<p>In this case, client sends WS-RM enabled request to Synase where Synapse
+sends normal request to the server. This can be observed by examining the
+wire level messages between the client and Synapse. These messages would be
+similar to the wire level messages shown in sample 53. Each message would
+perform a similar function to the messages discussed in sample 53.</p>
 
 <h1><a name="Transport">Transports</a></h1>
 



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

Reply via email to