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/12/02 01:26:50 UTC
svn commit: r1041226 - in
/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide: samples.xml
samples/sample153.xml samples/sample154.xml samples/sample155.xml
Author: hiranya
Date: Thu Dec 2 00:26:49 2010
New Revision: 1041226
URL: http://svn.apache.org/viewvc?rev=1041226&view=rev
Log:
Sample 153, 154, 155
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample153.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample154.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample155.xml
Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml?rev=1041226&r1=1041225&r2=1041226&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml Thu Dec 2 00:26:49 2010
@@ -83,9 +83,9 @@
<li><a href="samples/sample150.html">Sample 150: Introduction to proxy services</a></li>
<li><a href="samples/sample151.html">Sample 151: Custom sequences and endpoints with proxy services</a></li>
<li><a href="samples/sample152.html">Sample 152: Switching transports and message format from SOAP to REST/POX</a></li>
- <li><a href="">Sample 153: Routing the messages arrived to a proxy service without processing the security headers</a></li>
- <li><a href="">Sample 154: Load Balancing with proxy services</a></li>
- <li><a href="">Sample 155: Dual channel invocation on both client side and server side of Synapse with proxy services</a></li>
+ <li><a href="samples/sample153.html">Sample 153: Routing the messages without processing the security headers</a></li>
+ <li><a href="samples/sample154.html">Sample 154: Load Balancing with proxy services</a></li>
+ <li><a href="samples/sample155.html">Sample 155: Dual channel invocation on client side and server side</a></li>
</ul>
</p>
</subsection>
Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample153.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample153.xml?rev=1041226&r1=1041225&r2=1041226&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample153.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample153.xml Thu Dec 2 00:26:49 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 153</title>
</properties>
<body>
- <section name="Sample 153: ">
+ <section name="Sample 153: Routing the Messages without Processing the Security Headers">
<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="StockQuoteProxy">
@@ -46,14 +46,19 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Demonstrate the ability of Synapse to pass SOAP messages through without removing
+ already processed headers
</p>
</subsection>
<subsection name="Pre-requisites">
<p>
<ul>
<li>
- Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ Download and install the Java Cryptography Extension (JCE) unlimited
+ strength policy files for your JDK
+ </li>
+ <li>
+ Deploy the SecureStockQuoteService in the sample Axis2 server and start Axis2
</li>
<li>
Start Synapse using the configuration numbered 153 (repository/conf/sample/synapse_sample_153.xml)
@@ -66,11 +71,32 @@
</p>
</subsection>
<subsection name="Executing the Client">
- <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
- <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
- <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+ <p>
+ In this sample the proxy service will receive secured messages with security
+ headers which are flagged 'MustUnderstand'. But since the element 'enableSec'
+ is not present in the proxy configuration, Synapse will not engage Apache Rampart
+ on this proxy service. It is expected that a MustUnderstand failure exception
+ on the AxisEngine would occur before the message arrives at mediation engine.
+ But Synapse handles this message and gets it through by setting all the
+ MustUnderstand headers which are not processed as processed. This will enable
+ Synapse to route the messages without reading the Security headers (just routing
+ the messages from client to service, both of which are secured). To execute the
+ client, send a stock quote request to the proxy service, and sign and encrypt
+ the request by specifying the client side security policy as follows:
+ </p>
+ <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dpolicy=./../../repository/conf/sample/resources/policy/client_policy_3.xml</div>
+ <p>
+ By following through the debug logs or TCPMon output, you can see that the
+ request received by the proxy service was signed and encrypted. Also, looking
+ up the WSDL of the proxy service by requesting the URL http://localhost:8280/services/StockQuoteProxy?wsdl
+ reveals that the security policy attachments are not there and security is not engaged.
+ When sending the message to the backend service, you can verify that the security
+ headers were there as in the original message to Synapse from client, and that
+ the response received does use WS-Security, and forwarded back to the client
+ without any modification. You should note that this won't be a security hole
+ because the message inside Synapse is signed and encrypted and can only be
+ forwarded to a secure service.
+ </p>
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>
Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample154.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample154.xml?rev=1041226&r1=1041225&r2=1041226&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample154.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample154.xml Thu Dec 2 00:26:49 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 154</title>
</properties>
<body>
- <section name="Sample 154: ">
+ <section name="Sample 154: Load Balancing with Proxy Services">
<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="LBProxy" transports="http" startOnLoad="true">
@@ -74,14 +74,21 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Demonstrate how to use a proxy service as a load balancer
</p>
</subsection>
<subsection name="Pre-requisites">
<p>
<ul>
<li>
- Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+ Deploy the LoadbalanceFailoverService in the sample Axis2 server (go to
+ samples/axis2Server/src/LoadbalanceFailoverService and run 'ant')
+ </li>
+ <li>
+ Start 3 instances of the Axis2 server on different ports as follows
+ <div class="command">./axis2server.sh -http 9001 -https 9005 -name MyServer1<br/>
+./axis2server.sh -http 9002 -https 9006 -name MyServer2<br/>
+./axis2server.sh -http 9003 -https 9007 -name MyServer3</div>
</li>
<li>
Start Synapse using the configuration numbered 154 (repository/conf/sample/synapse_sample_154.xml)
@@ -94,11 +101,33 @@
</p>
</subsection>
<subsection name="Executing the Client">
- <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
- <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
- <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+ <p>
+ This sample is similar to <a href="sample54.html">sample 54</a>. The only
+ notable difference is the use of a proxy service.
+ </p>
+ <p>
+ Execute the client as follows.
+ </p>
+ <div class="command">ant loadbalancefailover -Dmode=session -Dtrpurl=http://localhost:8280/services/LBProxy</div>
+ <p>
+ You will get an output similar to the following.
+ </p>
+ <div class="consoleOutput">[java] Request: 1 Session number: 1 Response from server: MyServer3
+[java] Request: 2 Session number: 2 Response from server: MyServer2
+[java] Request: 3 Session number: 0 Response from server: MyServer1
+[java] Request: 4 Session number: 2 Response from server: MyServer2
+[java] Request: 5 Session number: 1 Response from server: MyServer3
+[java] Request: 6 Session number: 2 Response from server: MyServer2
+[java] Request: 7 Session number: 2 Response from server: MyServer2
+[java] Request: 8 Session number: 1 Response from server: MyServer3
+[java] Request: 9 Session number: 0 Response from server: MyServer1
+[java] Request: 10 Session number: 0 Response from server: MyServer1
+... </div>
+ <p>
+ You can see that session ID 0 is always directed to the server named MyServer1.
+ That means session ID 0 is bound to MyServer1. Similarly session 1 and 2 are bound
+ to MyServer3 and MyServer2 respectively.
+ </p>
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>
Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample155.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample155.xml?rev=1041226&r1=1041225&r2=1041226&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample155.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample155.xml Thu Dec 2 00:26:49 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 155</title>
</properties>
<body>
- <section name="Sample 155: ">
+ <section name="Sample 155: Dual Channel Invocation on Client Side and Server Side">
<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="StockQuoteProxy">
@@ -43,7 +43,9 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ <a href="sample13.html">Sample 13</a> show cased how to perform dual channel
+ invocations on the client side. This sample demonstrates how to perform dual
+ channel invocations on both client side and server side, using proxy services.
</p>
</subsection>
<subsection name="Pre-requisites">
@@ -63,11 +65,31 @@
</p>
</subsection>
<subsection name="Executing the Client">
- <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
- <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
- <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+ <p>
+ This sample will show the action of the dual channel invocation between client
+ and Synapse as well as between Synapse and the Axis2 server. Note that if you
+ want to enable dual channel invocation you need to set the separateListener
+ attribute to true on the enableAddressing element of the endpoint.
+ </p>
+ <p>
+ Execute the stock quote client in the dual channel mode as follows:
+ </p>
+ <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=dualquote</div>
+ <p>
+ In the above example, the request received is forwarded to the sample service
+ hosted on Axis2 and the endpoint specifies to enable addressing and do the
+ invocation in dual channel mode. If you observe the message flow using TCPmon,
+ you will see that on the channel you send the request to Synapse, the response has
+ been written as HTTP 202 Accepted, where as the real response from Synapse
+ comes over a different channel which cannot be obsesrved unless you use tcpdump
+ to dump all the TCP level messages.
+ </p>
+ <p>
+ At the same time you can observe the behaviour of the invocation between Synapse
+ and the actual Axis2 service, where you can see a 202 Accepted message being
+ delivered to Synapse as the response to the request. The actual response will be
+ delivered to Synapse over a different channel.
+ </p>
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>