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 00:57:46 UTC
svn commit: r1041215 - in
/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide: samples.xml
samples/sample150.xml samples/sample151.xml samples/sample152.xml
Author: hiranya
Date: Wed Dec 1 23:57:46 2010
New Revision: 1041215
URL: http://svn.apache.org/viewvc?rev=1041215&view=rev
Log:
sample 150, 151, 152
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample150.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample151.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample152.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=1041215&r1=1041214&r2=1041215&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 Wed Dec 1 23:57:46 2010
@@ -80,9 +80,9 @@
<subsection name="Proxy Services">
<p>
<ul>
- <li><a href="">Sample 150: Introduction to proxy services</a></li>
- <li><a href="">Sample 151: Custom sequences and endpoints with proxy services</a></li>
- <li><a href="">Sample 152: Switching transports and message format from SOAP to REST/POX</a></li>
+ <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>
Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample150.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample150.xml?rev=1041215&r1=1041214&r2=1041215&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample150.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample150.xml Wed Dec 1 23:57:46 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 150</title>
</properties>
<body>
- <section name="Sample 150: ">
+ <section name="Sample 150: Introduction to Proxy Services">
<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="StockQuoteProxy">
@@ -41,7 +41,7 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Introduce the concept of proxy services in Synapse
</p>
</subsection>
<subsection name="Pre-requisites">
@@ -61,11 +61,26 @@
</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>
+ <p>
+ Execute the stock quote client as follows and invoke the proxy service:
+ </p>
+ <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy</div>
- <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+ <p>
+ The 'inSequence' or 'endpoint' or both of these would decide how the message
+ would be handled after the proxy service receives the message. In the above
+ example, the request received is forwarded to the sample service hosted on Axis2.
+ The 'outSequence' defines how the response is handled before it is sent back to
+ the client. By default, a proxy service is exposed over all transportss
+ configured for Synapse, unless these are specifically mentioned through the
+ 'transports' attribute.
+ </p>
+ <p>
+ You can also view the WSDL of the proxy service by launching a web browser and
+ navigating to the following URL:
+ </p>
+ <div class="command">http://localhost:8280/services/StockQuoteProxy?wsdl</div>
+
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>
Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample151.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample151.xml?rev=1041215&r1=1041214&r2=1041215&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample151.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample151.xml Wed Dec 1 23:57:46 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 151</title>
</properties>
<body>
- <section name="Sample 151: ">
+ <section name="Sample 151: Custom Sequences and Endpoints with Proxy Services">
<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
<localEntry key="proxy_wsdl"
@@ -58,7 +58,7 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Demonstrate how to use predefined endpoints and sequences in a proxy service
</p>
</subsection>
<subsection name="Pre-requisites">
@@ -78,11 +78,19 @@
</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 configuration creates two proxy services. The first proxy service
+ 'StockQuoteProxy1' uses the sequence named 'proxy_1' to process incoming
+ messages and the sequence named 'out' to process outgoing responses. The second
+ proxy service, 'StockQuoteProxy2' is set to directly forward messages to the
+ endpoint named 'proxy_2_endpoint' without any mediation.
+ </p>
+ <p>
+ You can send a stock quote request to each of these proxy services and receive
+ the reply generated by the actual service hosted on the Axis2 server instance.
+ </p>
+ <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy1
+<br/>ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy2</div>
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>
Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample152.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample152.xml?rev=1041215&r1=1041214&r2=1041215&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample152.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample152.xml Wed Dec 1 23:57:46 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 152</title>
</properties>
<body>
- <section name="Sample 152: ">
+ <section name="Sample 152: Switching Transports and Message Format from SOAP to REST/POX">
<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="StockQuoteProxy" transports="https">
@@ -41,7 +41,8 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Demonstrate implementing simple transport switching and message format switching
+ scenarios using proxy services
</p>
</subsection>
<subsection name="Pre-requisites">
@@ -61,11 +62,69 @@
</p>
</subsection>
<subsection name="Executing the Client">
- <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
+ <p>
+ This configuration demonstrates how a proxy service can be exposed on a subset
+ of available transports, and how it could switch from one transport to another.
+ This example exposes the created proxy service only on HTTPS, and thus if the
+ user tries to access it over HTTP, it would result in a fault.
+ </p>
+ <div class="consoleOutput">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy
+...
+ [java] org.apache.axis2.AxisFault: The service cannot be found for the endpoint reference (EPR) /soap/StockQuoteProxy</div>
+
+ <p>
+ Accessing this over HTTPS causes the proxy service to access the SimpleStockQuoteService
+ on the sample Axis2 server using REST/POX.
+ </p>
+ <div class="command">ant stockquote -Dtrpurl=https://localhost:8243/services/StockQuoteProxy</div>
+
+ <p>
+ TCPMon can be used to trace the actual REST/POX messages exchanged between Synapse
+ and the sample Axis2 server. Synapse converts the POX response back to SOAP before
+ sending it back to the client.
+ </p>
+ <div class="consoleOutput">POST /services/SimpleStockQuoteService HTTP/1.1
+Host: 127.0.0.1
+SOAPAction: urn:getQuote
+Content-Type: application/xml; charset=UTF-8;action="urn:getQuote";
+Transfer-Encoding: chunked
+Connection: Keep-Alive
+User-Agent: Synapse-HttpComponents-NIO
+
+75
+<m0:getQuote xmlns:m0="http://services.samples">
+ <m0:request>
+ <m0:symbol>IBM</m0:symbol>
+ </m0:request>
+</m0:getQuote></div>
+
+ <div class="consoleOutput">HTTP/1.1 200 OK
+Content-Type: application/xml; charset=UTF-8;action="http://services.samples/SimpleStockQuoteServicePortType/getQuoteResponse";
+Date: Tue, 24 Apr 2007 14:42:11 GMT
+Server: Synapse-HttpComponents-NIO
+Transfer-Encoding: chunked
+Connection: Keep-Alive
- <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
+2b3
+<ns:getQuoteResponse xmlns:ns="http://services.samples/xsd">
+ <ns:return>
+ <ns:change>3.7730036841862384</ns:change>
+ <ns:earnings>-9.950236235550818</ns:earnings>
+ <ns:high>-80.23868444613285</ns:high>
+ <ns:last>80.50750970812187</ns:last>
+ <ns:lastTradeTimestamp>Tue Apr 24 20:42:11 LKT 2007</ns:lastTradeTimestamp>
+ <ns:low>-79.67368355714606</ns:low>
+ <ns:marketCap>4.502043663670823E7</ns:marketCap>
+ <ns:name>IBM Company</ns:name>
+ <ns:open>-80.02229531286982</ns:open>
+ <ns:peRatio>25.089295161182022</ns:peRatio>
+ <ns:percentageChange>4.28842665653824</ns:percentageChange>
+ <ns:prevClose>87.98107059692451</ns:prevClose>
+ <ns:symbol>IBM</ns:symbol>
+ <ns:volume>19941</ns:volume>
+ </ns:return>
+</ns:getQuoteResponse></div>
- <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>