Author: asankha
Date: Mon Nov 20 21:02:00 2006
New Revision: 477504
URL: http://svn.apache.org/viewvc?view=rev&rev=477504
Log:
fix sample 103 to sign and encrypt the response from the proxy service back to
the client as per policy
add sample documentation and convert README.txt into Synapse_Samples.html to
make it more readable and to allow it to be extended easily for more samples in
future
Added:
incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html
incubator/synapse/trunk/java/src/site/resources/sample_103_1.txt
incubator/synapse/trunk/java/src/site/resources/sample_103_2.txt
Removed:
incubator/synapse/trunk/java/modules/samples/src/main/scripts/README.txt
Modified:
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
incubator/synapse/trunk/java/src/main/assembly/bin.xml
incubator/synapse/trunk/java/src/site/site.xml
Modified:
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java?view=diff&rev=477504&r1=477503&r2=477504
==============================================================================
---
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
(original)
+++
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
Mon Nov 20 21:02:00 2006
@@ -27,10 +27,7 @@
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.client.OperationClient;
import org.apache.axis2.client.Options;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.context.*;
import org.apache.axis2.description.*;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.util.UUIDGenerator;
@@ -110,7 +107,6 @@
new QName(AnonymousServiceFactory.DYNAMIC_OPERATION));
Options clientOptions = new Options();
-
clientOptions.setTransportInProtocol(org.apache.axis2.Constants.TRANSPORT_HTTP);
// if RM is requested,
if (wsRMEnabled) {
@@ -135,7 +131,8 @@
getPolicy(synapseOutMessageContext, wsSecPolicyKey));
}
}
-
+ OperationContext originalOpCtx = axisOutMsgCtx.getOperationContext();
+
OperationClient mepClient = axisAnonymousOperation.createClient(
serviceCtx, clientOptions);
mepClient.addMessageContext(axisOutMsgCtx);
@@ -153,6 +150,10 @@
MessageContext response = mepClient.getMessageContext(
WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+
+ response.setOperationContext(originalOpCtx);
+ response.setAxisMessage(
+
originalOpCtx.getAxisOperation().getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
// set properties on response
response.setServerSide(true);
Modified: incubator/synapse/trunk/java/src/main/assembly/bin.xml
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/src/main/assembly/bin.xml?view=diff&rev=477504&r1=477503&r2=477504
==============================================================================
--- incubator/synapse/trunk/java/src/main/assembly/bin.xml (original)
+++ incubator/synapse/trunk/java/src/main/assembly/bin.xml Mon Nov 20 21:02:00
2006
@@ -85,10 +85,11 @@
</includes>
</fileSet>
<fileSet>
- <directory>modules/samples/src/main/scripts</directory>
+ <directory>src/site/resources</directory>
<outputDirectory>synapse-${synapse.version}/docs</outputDirectory>
<includes>
- <include>README.txt</include>
+ <include>Synapse_Samples.html</include>
+ <include>sample_*.txt</include>
</includes>
</fileSet>
<fileSet>
Added: incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html?view=auto&rev=477504
==============================================================================
--- incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html (added)
+++ incubator/synapse/trunk/java/src/site/resources/Synapse_Samples.html Mon
Nov 20 21:02:00 2006
@@ -0,0 +1,913 @@
+<html>
+<head>
+ <meta http-equiv="content-type" content="">
+ <title></title>
+</head>
+
+<body>
+<h1>Running the Synapse Samples</h1>
+
+<h2>Overview</h2>
+
+<p>To run the samples bundled with the Synapse distribution you will need Ant
+1.5 or later. Ant can be downloaded from http://ant.apache.org. The samples
+now come with a built in Axis2 server to host the service endpoints used in
+the samples, along with simple ant scripts to build and deploy the services
+into this Axis2 instance.</p>
+
+<h2>Starting Axis2</h2>
+
+<p>To start the bundled Axis2 server, go to the samples/axis2Server directory
+and execute the axis2server.sh or axis2server.bat script. This starts the
+Axis2 server with the HTTP transport listner on port 9000.</p>
+
+<p></p>
+
+<p>The sample services are available in the samples/axis2Server/src
+directory. To deploy these services go the the selected directory and run
+'ant'. This will build the service archive file (aar) and deploy it into the
+Axis2 server. (i.e. copy it to the
+samples/axis2Server/repository\services)</p>
+
+<p></p>
+
+<p>e.g.</p>
+<pre>To deploy the SimpleStockQuoteService service go to the
samples/axis2Server/src/SimpleStockQuoteService and execute 'ant' without any
arguments as follows:</pre>
+<pre>C:\Java\SynapseDist\synapse-0.90-SNAPSHOT\samples\axis2Server\src\SimpleStockQuoteService>ant</pre>
+<pre>Buildfile: build.xml</pre>
+<pre>...</pre>
+<pre>[jar] Building jar:
C:\Java\SynapseDist\synapse-0.90-SNAPSHOT\samples\axis2Server\repository</pre>
+<pre>\services\SimpleStockQuoteService.aar</pre>
+<pre>BUILD SUCCESSFUL</pre>
+
+<p></p>
+
+<h2>Descriptions of sample Services</h2>
+
+<p>1. SimpleStockQuoteService</p>
+
+<p>This service has two operations, getQuote (in/out) and placeOrder
+(in-only). It will generate a sample stock quote for a given symbol.</p>
+
+<p></p>
+
+<p>2. SimpleStockQuoteService1 - This has the same functionality as the
+SimpleStockQuoteService service, but exists to make available a different
+service instance/EPR to demonstrating routing</p>
+
+<p></p>
+
+<p>3. SimpleStockQuoteService2 - Same as the SimpleStockQuoteService2 (Refer
+above) </p>
+
+<p></p>
+
+<p>4. SecureStockQuoteService1 - Simple stock quote service using WS-Security
+with timestamps and username token authentication</p>
+
+<p><br>
+5. SecureStockQuoteService3 - Stock quote service using WS-Security
+signatures and encryption</p>
+
+<p></p>
+
+<h2>Starting Synapse</h2>
+
+<p>To start Synapse with the default configuration execute the synapse.bat or
+synapse.sh script in the bin directory. This starts up an instance of Synapse
+using the Synapse and Axis2 configuration files located at repository/conf</p>
+
+<p></p>
+
+<p>To start specific sample configurations of Synapse, use the -sample
+<number> switch as follows:</p>
+
+<p>e.g.</p>
+<pre>bin\synapse.bat -sample <number> on a Windows system will use the
sample synapse.xml</pre>
+
+<p>configuration file located at
+repository\conf\sample\synapse_sample_<number>.xml</p>
+
+<p></p>
+
+<h2>Invoking the sample clients</h2>
+
+<p>The clients are located in the samples/axis2Client directory, and should
+be executed with the ant script supplied. (e.g. ant stockquote) The ant
+script expects an argument to select the client scenario to be executed. The
+samples/axis2Client/client_repo directory contains an Axis2 client repository
+along with the necessary modules and dependencies to make available
+WS-Addressing, WS-Security (Rampart) and WS-Reliable Messaging (Sandesha2) on
+the client side.</p>
+
+<p></p>
+
+<h1>Sample Scenarios</h1>
+
+<h2>Sample 0:</h2>
+
+<p><strong>Objective: Introduction to Synapse. Shows how a message could be
+made to pass through Synapse </strong><strong>and logged before it is
+delivered to its ultimate receiver.</strong></p>
+
+<p></p>
+
+<p>A client could interact with Synapse in one of three modes as follows:</p>
+
+<p></p>
+
+<h3>1. Smart Client mode</h3>
+
+<p>In this mode, the client addresses its messages to the ultimate receiver
+of the message using WS-Addressing, but specifies the transport URL to
+Synapse. This results in the messages reaching Synapse with the WS-Addressing
+information which could be used to route the message as appropriate.</p>
+
+<p></p>
+
+<h3>2. Synapse as a Proxy</h3>
+
+<p>In this mode, the client sets Synapse as an HTTP Proxy but sets the
+destination EPR to indicate the ultimate receiver of the message. This forces
+all outgoing HTTP messages to flow into Synapse, which will then send the
+messages as appropriate.</p>
+
+<p></p>
+
+<h3>3. Dumb Client</h3>
+
+<p>In this mode, the client expects Synapse to decide on the destination of
+the message through appropriate routing rules using the content of the
+message.</p>
+
+<p></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 0: i.e. synapse -sample 0</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p><strong>Execute the Smart Client as 'ant stockquote'</strong></p>
+
+<p>Client: samples.userguide.StockQuoteClient</p>
+
+<p></p>
+
+<p>If you follow through the execution of Synapse mediation rules while
+looking at the configuration used synapse_sample_0.xml you will notice that
+the client request arrived at Synapse with a WS-Addressing 'To' EPR of
+http://localhost:9000/axis2/services/SimpleStockQuoteService</p>
+
+<p></p>
+
+<p>The Synapse configuration logs the message at the highest log level as the
+configuration specifies the log level as 'full'. Then Synapse sends the
+message using the implicit 'To' address of the message - which is
+http://localhost:9000/axis2/services/SimpleStockQuoteService</p>
+
+<p></p>
+
+<p>Then you will see on the Axis2 server console, a message similar to the
+following</p>
+<pre>Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote
for : IBM</pre>
+
+<p></p>
+
+<p>This shows that Synapse forwarded the message to the intended recepient
+after logging the message and then the actual service received and processed
+it. The response message generated is again received at Synapse, and flows
+through the same mediation rules, which logs the message and then sends it -
+this time back to the client.</p>
+
+<p></p>
+
+<p>On the client console you should see an output similar to the following
+based on the message received by the client.</p>
+<pre>Standard :: Stock price = $95.26454380258552</pre>
+
+<p></p>
+
+<p><strong>Execute the Proxy client as 'ant proxystockquote'</strong></p>
+
+<p>Client: samples.userguide.ProxyStockQuoteClient</p>
+
+<p></p>
+
+<p>You will see the exact same behaviour as per the previous example when you
+run this scenario. However this time the difference is at the client and
+would be noticable only if one looks at the source code of the example class
+samples.userguide.ProxyStockQuoteClient</p>
+
+<p></p>
+
+<p><strong>Execute the Proxy client as 'ant proxystockquote'</strong></p>
+
+<p>Client: samples.userguide.ProxyStockQuoteClient</p>
+
+<p></p>
+
+<p>You will see the exact same behaviour as per the previous example when you
+run this scenario. However this time the difference is at the client and
+would be noticable only if one looks at the source code of the example class
+samples.userguide.ProxyStockQuoteClient</p>
+
+<p></p>
+
+<h2>Sample 1:</h2>
+
+<p><strong>Objective: Introduction to simple content based routing. Shows how
+a message could be made to pass through Synapse using the Dumb Client mode,
+where Synapse acts as a gateway to accept all messages and then perform
+mediation and routing.</strong></p>
+
+<p></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 1: i.e. synapse -sample 1</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>Execute the Dumb Client as 'ant dumbstockquote'</p>
+
+<p>Client: samples.userguide.DumbStockQuoteClient</p>
+
+<p></p>
+
+<p>This time you will notice that Synapse received a message for which
+Synapse was set as the ultimate receiver of the message. Based on the 'To'
+EPR, Synapse performed a match to the given path '/StockQuote' and as the
+request matched the XPath expression of the filter mediator, the filter
+mediators' child mediators executes, and thereby semding the message to a
+different endpoint as specified by the [reusable] endpoint definition.</p>
+
+<p></p>
+
+<h2>Sample 2:</h2>
+
+<p>Objective: Introduce switch-case mediator and writing and reading of local
+properties on a message</p>
+
+<p></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 2: i.e. synapse -sample 2</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>Execute the 'ant stockquote' request again, and by following through the
+mediation rules executed you will see that the case statements' first case
+for 'IBM' executed and a local property named 'symbol' was set to 'Great
+stock - IBM'. Subsequently this local property value is looked up by the log
+mediator and logged. The message flowes through to Axis2 and then the reply
+back to the client.</p>
+
+<p></p>
+
+<h2>Sample 3:</h2>
+
+<p><strong>Objective: Illustrates simple properties, and reusable endpoints
+and sequences</strong></p>
+
+<p></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 3: i.e. synapse -sample 3</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>Execute the 'ant stockquote' request again. Following through the
+mediation logs you will see that once the filter and switch statments are
+through, the sequence named 'stockquote' is referenced and invoked. Also the
+log mediator dumps a string property, and two XPath evaluation results. The
+first expression fetches a local static string lieral property named
+'version'. This is a global property applicable to all messages passing
+through Synapse, and available for reading from any reusable sequence or the
+main rules. The second expression fetches the local message property named
+'symbol' which was set within the switch mediator, using the set-property
+mediator. However, for both expressions the 'get-property()' XPath extension
+function has been used. This function will first look for a given property
+within the local message, and if a property with the name cannot be found, it
+performs a lookup over all global properties. In addition, the get-property()
+function supports the special cases 'To', 'From', 'Action', 'FaultTo' and
+'ReplyTo', which fetches the appropriate values from the current message
+context.</p>
+
+<p></p>
+
+<h2>Sample 4:</h2>
+
+<p><strong>Objective: Introduction to error handling with the try and
+makefault mediators</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 4: i.e. synapse -sample 4</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>When you execute 'ant stockquote', the default stock symbol queried is
+'IBM'. However you could use the 'symbol' system property and pass it into
+the above (e.g. ant stockquote -Dsymbol=MSFT) to query another symbol.</p>
+
+<p></p>
+
+<p>When the IBM stock quote is requested, the configuration routes it to the
+endpoint defined as the 'simple' endpoint, which routes the message to the
+SimpleStockQuoteService on the local Axis2 instance. Hence a valid response
+message is shown at the client.</p>
+
+<p></p>
+
+<p>If you lookup a stock quote for 'MSFT', Synapse is instructed to route the
+message to the endpoint defined as the 'bogus' endpoint, which tries to
+deliver the message to a non existing service. Hence the method encounters a
+connection exception, which gets handled by the enclosing try mediator. When
+an error is encountered within the scope of a try mediator, it executes the
+mediation logic specified in its 'onError' segment. In this example, the
+sequence named 'errorHandler' is invoked, and it logs the error message as
+well as the error detail, and then creates a custom fault message reading the
+property named 'ERROR_MESSAGE' which is set on the current message by the try
+mediator on encountering an exception. At the client end, you would see the
+custom SOAP fault message instead of a stock quote.</p>
+
+<p></p>
+
+<h2>Sample 5:</h2>
+
+<p><strong>Objective: Introduction to error handling within a sequence using
+the 'onError' sequence</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 5: i.e. synapse -sample 5</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>This sample demonstrates the ability to assign an existing sequence as the
+error handling sequence of another. The 'onError' attribute of a sequence
+calls on the named sequence specified when an exception is encountered during
+the processing. You could request for IBM and MSFT quotes using the same
+client and experience the same behaviour from Synapse.</p>
+
+<p></p>
+
+<h2>Sample 6:</h2>
+
+<p><strong>Objective: Introduction to header, in and out
+mediators</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 6: i.e. synapse -sample 6</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService1 (Refer
+steps above)</p>
+
+<p></p>
+
+<p>In this example we use the same stockquote client which sets the 'To' EPR
+of the message to the SimpleStockQuoteService service. However, if this
+request is for the IBM stock, the configuration invokes the header mediator
+and sets the 'To' value to the SimpleStockQuoteService1. Hence if you request
+for the IBM stock, you should see the header mediator changing the
+WS-Addressing header in the log message, and on the Axis2 server console you
+would notice that the SimpleStockQuoteService1 service indeed received and
+processed the response. You will also see that the mediation rules now use
+the in and out mediators - which executes the mediators within them depending
+on whether the message is an incoming request from a client, or a response
+message being sent to a client from Synapse. The log message 'sending back
+the response' prints only during the processing of the response message.</p>
+
+<p></p>
+
+<p>If a request is made for any other stock, Synapse is instructed to drop
+the message and hence the client will not receive any response. The drop
+mediator aborts further processing of a message and may be used to discard
+and reject unwanted messages.</p>
+
+<p></p>
+
+<h2>Sample 7:</h2>
+
+<p><strong>Objective: Introduction to the extension mediators, static XML
+properties and the validate mediator</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Download Xerces2-j 2.8.0 or later, and copy the xml-apis.jar and
+xercesImpl.jar into the lib/endorsed folder</p>
+
+<p>Start the Synapse configuration numbered 7: i.e. synapse -sample 7</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>The validate mediator is bundled as an extension mediator as it depends on
+the Xerces2-j parser for schema validation, to keep the core Synapse
+distribution compact. Hence to try this example you will first need to
+download the Xerces parser and place its jar files into the lib folder to
+make it available to the validate mediator.</p>
+
+<p></p>
+
+<p>This example shows how an XML fragment could be made available to Synapse
+as a property. Such a property is called an inline XML property and is static
+since its content never changes after initiation. Hence a Schema is made
+available to the configuration as a property named 'validate_schema'.</p>
+
+<p></p>
+
+<p>Synapse supports string, inline text, inline xml and URL source properties
+which are static properties. In addition it supports dynamic registry based
+properties as introduced later.</p>
+
+<p></p>
+
+<p>In this example the request messages are filtered using a boolean XPath
+expression which checks if the request is a getQuote request. If so the
+'customsequence' sequence is invoked, which in-turn calls on the validate
+mediator passing it the property key 'validate_schema'. The validate mediator
+by default operates on the first child element of the SOAP body. You may
+specify an XPath expression using an attribute 'source' to override this
+behaviour. The validate mediator now uses the 'validate_schema' property to
+validate the incoming message, and if the message is in error invokes on the
+'on-fail' sequence of mediators.</p>
+
+<p></p>
+
+<p>If you send a standard stockquote request using 'ant stockquote' you will
+now get a fault back with a message 'Invalid custom quote request' as the
+schema validation failed. This is because the schema used in the example
+expects a slightly different message than what is created by the stock quote
+client. (i.e. expects a 'stocksymbol' element instead of 'symbol' to specify
+thestock symbol)</p>
+
+<p></p>
+
+<h2>Sample 8:</h2>
+
+<p><strong>Objective: Introduction to URL source properties, registry based
+properties and the XSLT mediator</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Download Xalan-J version 2.7.0 or later, and copy xalan.jar and
+serializer.jar into the Synapse lib folder. Copy xercesImpl.jar and
+xml-apis.jar (of Xerces-J) into the lib/endorsed folder.</p>
+
+<p>Start the Synapse configuration numbered 8: i.e. synapse -sample 8</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>This example uses the XSLT mediator to perform transformations, and the
+xslt tranformation is specified as a property, similar to the way the a
+schema was specified to the validate mediator. The first resource
+'xslt-key-req' is specified by specifying its URL. The URL could be any valid
+URL, for e.g. http://someserver/path/resource.xslt or a file:// URL etc. The
+second resource 'xslt-key-resp' is specified using a 'key' attribute.</p>
+
+<p></p>
+
+<p>In this example you will notice the new 'registry' definition. Synapse
+comes with a simple URL based registry called SimpleURLRegistry. During
+initialization of the registry, the SimpleURLRegistry expects to find a
+property named 'root', which specifies a prefix for the registry keys used
+later. When the SimpleURLRegistry is used, this root is prefixed to the
+property key to form the complete URL for the resource being looked up. The
+registry caches a resource once requested, and caches it internally for a
+specified duration. Once this period expires, it will reload the meta
+information about the resource and reload its cached copy if required, the
+next time the resource is requested.</p>
+
+<p></p>
+
+<p>Hence the second XSLT resource key 'transform/transform_back.xslt'
+concatenated with the 'root' of the SimpleUTLRegistry
+'file:repository/conf/sample/resources/' forms the complete URL of the
+resource as
+'file:repository/conf/sample/resources/transform/transform_back.xslt' and
+caches its value for a period of 15000 seconds.</p>
+
+<p></p>
+
+<p>Execute the custom quote client as 'ant customquote' and check analyze the
+the Synapse debug log output as shown below</p>
+
+<p></p>
+<pre>DEBUG XSLTMediator - Transformation source :</pre>
+<pre><m0:CheckPriceRequest
xmlns:m0="http://www.apache-synapse.org/test"></pre>
+<pre><m0:Code>IBM</m0:Code></m0:CheckPriceRequest></pre>
+<pre>DEBUG XSLTMediator - Transformation result :</pre>
+<pre><m:getQuote xmlns:m="http://services.samples/xsd"></pre>
+<pre><m:request><m:symbol>IBM</m:symbol></m:request></m:getQuote></pre>
+
+<p></p>
+
+<p></p>
+
+<p>The incoming message is now transformed into a standard stock quote
+request as expected by the SimpleStockQuoteService deployed on the local
+Axis2 instance by the XSLT mediator. The XSLT mediator uses Xalan-J to
+perform the transformations, and hence the necessary Xalan-J and Xerces-J
+libraries needs to be made available to Synapse. The response from the
+SimpleStockQuoteService is converted into the custom format as expected by
+the client during the out message processing.</p>
+
+<p></p>
+
+<p>During the response processing you could notice the SimpleURLRegistry
+fetching the resource as shown by the debug logs below</p>
+
+<p></p>
+<pre>INFO SimpleURLRegistry - ==> Repository fetch of resource with key :
transform/transform_back.xslt</pre>
+
+<p></p>
+
+<p>If you re-run the client again immidiately (i.e within 15 seconds of the
+first request) you will not see the resource being re-loaded by the registry
+as the cached value would be still valid.</p>
+
+<p></p>
+
+<p>However if you leave the system idle for 15 seconds or more and then retry
+the same request, you will now notice that the registry noticed the cache
+expiry and checked the meta information about the resource to check if the
+resource itself has changes and requires a fresh fetch from the source
+URL.</p>
+
+<p></p>
+<pre>DEBUG AbstractRegistry - Cached object has expired for key :
transform/transransform_back.xslt</pre>
+<pre>DEBUG SimpleURLRegistry - Perform RegistryEntry lookup for key :
transform/transform_back.xslt</pre>
+<pre>DEBUG AbstractRegistry - Expired version number is same as current
version in registry</pre>
+<pre>DEBUG AbstractRegistry - Renew cache lease for another 15s</pre>
+
+<p></p>
+
+<p>Now edit the
+repository/conf/sample/resources/transform/transform_back.xslt file and add a
+blank line at the end. Now when you run the client again, and if the cache is
+expired, the resource would be re-fetched from its URL by the registry and
+this can be seen by the following debug log messages</p>
+
+<p></p>
+<pre>DEBUG AbstractRegistry - Cached object has expired for key :
transform/transform_back.xslt</pre>
+<pre>DEBUG SimpleURLRegistry - Perform RegistryEntry lookup for key :
transform/transform_back.xslt</pre>
+<pre>INFO SimpleURLRegistry - ==> Repository fetch of resource with key :
transform/transform_back.xslt</pre>
+
+<p></p>
+
+<p>Thus the SimpleURLRegistry allows resource to be cached, and updates
+detected so that changes could be reloaded without restarting the Synapse
+instance.</p>
+
+<p></p>
+
+<h1>Proxy services</h1>
+
+<h2>Sample 100:</h2>
+
+<p><strong>Objective: Introduction to Synapse proxy services</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 100: i.e. synapse -sample 100</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>Once Synapse starts, you could go to
+http://localhost:8080/axis2/services/StockQuoteProxy?wsdl and view the WSDL
+for the proxy service defined in the configuration. This WSDL is based on the
+source WSDL supplied in the proxy service definition, and is updated to
+reflect the proxy service EPR. If a proxy service definition does not specify
+a target for its messages, the Synapse mediation rules are applied to route
+messages.</p>
+
+<p></p>
+
+<p>Execute the stock quote client by requesting for a stock quote on the
+proxy service as follows:</p>
+<pre>ant stockquote
-Durl=http://localhost:8080/axis2/services/StockQuoteProxy</pre>
+
+<p></p>
+
+<p>You will now notice that the Synapse mediation rules were applied and the
+request was routed to the SimpleStockQuoteService service on the local Axis2
+instance. The response message is mediated using the same rules, as an
+outgoing sequence is not specified in this example either. The client should
+receive a stock quote reply from the proxy service. Also the client could get
+the WSDL for the proxy service by requesting for
+http://localhost:8080/axis2/services/StockQuoteProxy?wsdl</p>
+
+<p></p>
+
+<h2>Sample 101:</h2>
+
+<p><strong>Objective: Using custom sequences and endpoints for message
+mediation with proxy services</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 101: i.e. synapse -sample 101</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>This configuration creates two proxy services with different behaviour.
+The first proxy service 'StockQuoteProxy1' uses the sequence named 'proxy_1'
+as its main mediation sequence for messages it receives. The second proxy
+service 'StockQuoteProxy2' is set to directly forward messages that are
+received to the endpoint named 'proxy_2_endpoint' without any mediation.</p>
+
+<p></p>
+
+<p>You could send a stock quote request to each of these proxy services and
+receive the reply generated by the actual service hosted on the Axis2
+instance. Use the -Durl=<EPR> property when executing the client as per
+example 100, to request on the two proxy services.</p>
+
+<p></p>
+
+<h2>Sample 102:</h2>
+
+<p><strong>Objective: Attaching service level WS-Security policies to proxy
+services</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Synapse configuration numbered 102: i.e. synapse -sample 102</p>
+
+<p>Copy the Apache Rampart module (e.g. rampart-1.1-SNAPSHOT.mar) into the
+modules directories of both the sample Axis2 client and server:
+samples/axis2Client/client_repo/modules and
+samples/axis2Server/repository/modules. The Rampart module could be found at
+repository\modules and is not duplicated in the distributions due to its
+large file size.</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>To execute the sample use the stock quote client with the 'secpolicy' and
+'url' system properties passed in as follows:</p>
+
+<p>e.g.</p>
+<pre>ant stockquote
-Durl=http://localhost:8080/axis2/services/StockQuoteProxy</pre>
+<pre>-Dsecpolicy=..\..\repository\conf\sample\resources\policy\policy_1.xml</pre>
+
+<p></p>
+
+<p>The sample security policy policy_1.xml uses timestamps and username token
+tuhentication on the stock quote request. Following the debug logs on the
+Synapse server you could notice the presence of WS-Security headers on the
+incoming message. By requesting the WSDL of the proxy service you could also
+see that the supplied policy file has been attached to the specified WSDL as
+well.</p>
+
+<p>e.g. http://localhost:8080/axis2/services/StockQuoteProxy?wsdl</p>
+
+<p></p>
+
+<p>A proxy service with an attached policy - such as a WS-Security policy -
+ensures that messages which goes through mediation have satisfied the
+constraints as specified by the supplied policy. i.e. for example, if any
+WS-Security validations fail, the message will not reach Synapse mediation,
+but the client would get an appropriate error message from the Apache Rampart
+module directly.</p>
+
+<p></p>
+
+<p>The mediation shows the header mediator used to strip out the
+wsse:Security header from the current message before being forwarded to the
+SimpleStockQuoteService. Hence the message sent to the stock quote service
+EPR is without any WS-Security headers as can be seen from the log
+messages.</p>
+
+<p></p>
+
+<p>Note: If you wish to engage the default WS-Security policy of Rampart on a
+proxy service, you could use the <enableSec/> option on a proxy service
+alone. This will be similar in function to 'engaging' Rampart on an Axis2
+service.</p>
+
+<p></p>
+
+<h2>Sample 103:</h2>
+
+<p><strong>Objective: Using WS-Security signing and encryption with proxy
+services through WS-Policy</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Download and copy the BouncyCastle JAR file into your Synapse lib
+directory. (Note: the exact JAR you need to install depends on your JDK - for
+JDK 1.4 I have used bcprov-jdk13-132.jar)</p>
+
+<p>Start the Synapse configuration numbered 103: i.e. synapse -sample 103</p>
+
+<p>Copy the Apache Rampart module (e.g. rampart-1.1-SNAPSHOT.mar) into the
+modules directory of the sample Axis2 client
+samples/axis2Client/client_repo/modules. The Rampart module could be found at
+repository\modules and is not duplicated within the distributions due to its
+large file size.</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p></p>
+
+<p>To execute the sample use the dumb stock quote client with the 'secpolicy'
+and 'gatewayurl' system properties passed in as follows:</p>
+
+<p>e.g.</p>
+<pre>ant dumbstockquote
-Dsecpolicy=..\..\repository\conf\sample\resources\policy\client_policy_3.xml</pre>
+<pre>-Dgatewayurl=http://localhost:8080/axis2/services/StockQuoteProxy</pre>
+
+<p></p>
+
+<p>The sample security policy client_policy_3.xml ensures signed and
+encrypted messages which request for the stock quotes. Following the debug
+logs on the Synapse server you could notice the presence of WS-Security
+headers on the incoming message. By requesting the WSDL of the proxy service
+you could also see that the supplied policy file has been attached to the
+specified WSDL as well.</p>
+
+<p>e.g. http://localhost:8080/axis2/services/StockQuoteProxy?wsdl</p>
+
+<p></p>
+
+<p>By following through the Synapse log messages you could see that the proxy
+service received and decrypted the secured SOAP envelope. (If you sent the
+client request to Synapse through a TCP monitor you would be able to see the
+raw encrypted message in transit) and forwarded this to the simple stockquote
+service, and once the response was received, signed it and encrypted it
+before sending it back to the client.</p>
+
+<p></p>
+
+<p>Using TCPMon, a sample request sent from the client to the WS-Security
+enabled proxy service has been captured as follows:</p>
+
+<p><a href="sample_103_1.txt">sample_103_1.txt</a></p>
+
+<p>Synapse removes the wsse:Security header from this message and forwards it
+to the endpoint. The response received is now signed and encrypted and sent
+back to the client as follows:</p>
+
+<p><a href="sample_103_2.txt">sample_103_2.txt</a></p>
+<pre></pre>
+
+<h2>Sample 110:</h2>
+
+<p><strong>Objective: Introduction to switching transports with proxy
+services</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p>Download, install and start a JMS server, and configure Synapse to listen
+on JMS (refer notes below)</p>
+
+<p>Start the Synapse configuration numbered 110: i.e. synapse -sample 110</p>
+
+<p></p>
+
+<p>For this example we would use ActiveMQ as the JMS provider. Once ActiveMQ
+is installed and started you should get a message as follows:</p>
+<pre>INFO BrokerService - ActiveMQ JMS Message Broker (localhost) started</pre>
+
+<p></p>
+
+<p>You will now need to configure the Axis2 instance used by Synapse (not the
+sample Axis2 server) to enable JMS support using the above provider. Refer to
+the Axis2 documentation on setting up JMS for more details
+(http://ws.apache.org/axis2/1_1/jms-transport.html). You will also need to
+copy the ActiveMQ client jar files activeio-core-3.0-beta1.jar,
+activemq-core-4.0-RC2.jar and geronimo-j2ee-management_1.0_spec-1.0.jar into
+the lib directory to allow Synapse to connect to the JMS provider.</p>
+
+<p></p>
+
+<p>For a default ActiveMQ v4.0 installation, you may uncomment the Axis2
+transport listener configuration found at repository/conf/axis2.xml as</p>
+<pre><transportReceiver name="jms"
class="org.apache.axis2.transport.jms.JMSListener"> ...</pre>
+
+<p></p>
+
+<p>Once you start the Synapse configuration and request for the WSDL of the
+proxy service you will notice that its exposed only on the JMS transport.
+This is because the configuration specified this requirement in the proxy
+service definition.</p>
+
+<p></p>
+
+<p>Now lets send a stock quote request on JMS, using the dumb stock quote
+client as follows:</p>
+<pre>ant dumbstockquote
-Dgatewayurl="jms:/StockQuoteProxy?transport.jms.ConnectionFactoryJNDIName=</pre>
+<pre>QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.</pre>
+<pre>ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616"</pre>
+
+<p></p>
+
+<p>On the Synapse debug log you will notice that the JMS listener received
+the request message as:</p>
+<pre>[JMSWorker-1] DEBUG ProxyServiceMessageReceiver -</pre>
+<pre>Proxy Service StockQuoteProxy received a new message...</pre>
+
+<p></p>
+
+<p>Synapse forwarded this message to the HTTP EPR of the simple stock quote
+service hosted on the sample Axis2 server, and returned the reply back to the
+client through a JMS temporary queue.</p>
+
+<p></p>
+
+<p>Note: It is possible to instruct a JMS proxy service to listen to an
+already existing destination without creating a new one. To do this, use the
+property elements on the proxy service definition to specify the destination
+and connection factory etc.</p>
+
+<p>e.g.</p>
+<pre><property name="transport.jms.Destination"
value="dynamicTopics/something.TestTopic"/></pre>
+
+<p></p>
+
+<h2>Sample 111:</h2>
+
+<p><strong>Objective: Demonstrate switching from HTTP to JMS</strong></p>
+
+<p><strong>Pre-Requisites:</strong></p>
+
+<p>Download, install and start a JMS server, and configure Synapse to listen
+on JMS (refer notes below)</p>
+
+<p>Configure sample Axis2 server for JMS (refer notes above)</p>
+
+<p>Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps
+above)</p>
+
+<p>Configure JMS transport for Synapse (refer notes above - sample 110)</p>
+
+<p>Start the Synapse configuration numbered 111: i.e. synapse -sample 111</p>
+
+<p></p>
+
+<p>To switch from HTTP to JMS, edit the
+samples/axis2Server/repository/conf/axis2.xml for the sample Axis2 server and
+enable JMS (refer notes above), and restart the server. You should now see
+that the simple stock quote service is available over JMS as well at an
+address as the one shown below, by looking at the WSDL of the service.</p>
+
+<p></p>
+<pre>jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&</pre>
+<pre>java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&</pre>
+<pre>java.naming.provider.url=tcp://localhost:61616</pre>
+
+<p></p>
+
+<p>This Synapse configuration creates a proxy service over HTTP and forwards
+received messages to the above EPR using JMS, and sends back the response to
+the client over HTTP once the simple stock quote service responds with the
+stock quote reply over JMS to the Synapse server.</p>
+
+<p></p>
+
+<p></p>
+
+<p></p>
+</body>
+</html>
Added: incubator/synapse/trunk/java/src/site/resources/sample_103_1.txt
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/src/site/resources/sample_103_1.txt?view=auto&rev=477504
==============================================================================
--- incubator/synapse/trunk/java/src/site/resources/sample_103_1.txt (added)
+++ incubator/synapse/trunk/java/src/site/resources/sample_103_1.txt Mon Nov 20
21:02:00 2006
@@ -0,0 +1,70 @@
+POST /axis2/services/StockQuoteProxy HTTP/1.1
+SOAPAction: "urn:getQuote"
+User-Agent: Axis2
+Host: 127.0.0.1:8081
+Transfer-Encoding: chunked
+Content-Type: text/xml; charset=UTF-8
+
+14ab
+<?xml version='1.0' encoding='UTF-8'?>
+ <soapenv:Envelope xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header>
+ <wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soapenv:mustUnderstand="1">
+ <wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-13080585">
+ <wsu:Created>2006-11-21T04:39:49.171Z</wsu:Created>
+ <wsu:Expires>2006-11-24T15:59:49.171Z</wsu:Expires>
+ </wsu:Timestamp>
+ <xenc:EncryptedKey Id="EncKeyId-13878947">
+ <xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" />
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <wsse:SecurityTokenReference>
+ <wsse:KeyIdentifier
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">Xeg55vRyK3ZhAEhEf+YT0z986L0=</wsse:KeyIdentifier>
+ </wsse:SecurityTokenReference>
+ </ds:KeyInfo>
+ <xenc:CipherData>
+
<xenc:CipherValue>PASyzbvheknnUZhHgpb8uU1sfGHrOJlSa/xknxIx2MqMkvM2UL5vFeZmFAXy97jm2SqE8zl0PPxhT4kSH/Jhp9ECYXqfvV3QsIf28sRs7bW6dOmHt9SjJJnbwvS3f3xWLJ0l7P0Lgjx+xEUFSS6OguynbXNWBiryaPLMOowhgxQ=</xenc:CipherValue>
+ </xenc:CipherData>
+ <xenc:ReferenceList>
+ <xenc:DataReference URI="#EncDataId-3916915" />
+ </xenc:ReferenceList>
+ </xenc:EncryptedKey>
+ <wsse:BinarySecurityToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="CertId-1776694">MIIDDDCCAfSgAwIBAgIQM6YEf7FVYx/tZyEXgVComTANBgkqhkiG9w0BAQUFADAwMQ4wDAYDVQQKDAVPQVNJUzEeMBwGA1UEAwwVT0FTSVMgSW50ZXJvcCBUZXN0IENBMB4XDTA1MDMxOTAwMDAwMFoXDTE4MDMxOTIzNTk1OVowQjEOMAwGA1UECgwFT0FTSVMxIDAeBgNVBAsMF09BU0lTIEludGVyb3AgVGVzdCBDZXJ0MQ4wDAYDVQQDDAVBbGljZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAoqi99By1VYo0aHrkKCNT4DkIgPL/SgahbeKdGhrbu3K2XG7arfD9tqIBIKMfrX4Gp90NJa85AV1yiNsEyvq+mUnMpNcKnLXLOjkTmMCqDYbbkehJlXPnaWLzve+mW0pJdPxtf3rbD4PS/cBQIvtpjmrDAU8VsZKT8DN5Kyz+EZsCAwEAAaOBkzCBkDAJBgNVHRMEAjAAMDMGA1UdHwQsMCowKKImhiRodHRwOi8vaW50ZXJvcC5iYnRlc3QubmV0L2NybC9jYS5jcmwwDgYDVR0PAQH/BAQDAgSwMB0GA1UdDgQWBBQK4l0TUHZ1QV3V2Qtl
LNDm+PoxiDAfBgNVHSMEGDAWgBTAnSj8wes1oR3WqqqgHBpNwkkPDzANBgkqhkiG9w0BAQUFAAOCAQEABTqpOpvW+6yrLXyUlP2xJbEkohXHI5OWwKWleOb9hlkhWntUalfcFOJAgUyH30TTpHldzx1+vK2LPzhoUFKYHE1IyQvokBN2JjFO64BQukCKnZhldLRPxGhfkTdxQgdf5rCK/wh3xVsZCNTfuMNmlAM6lOAg8QduDah3WFZpEA0s2nwQaCNQTNMjJC8tav1CBr6+E5FAmwPXP7pJxn9Fw9OXRyqbRA4v2y7YpbGkG2GI9UvOHw6SGvf4FRSthMMO35YbpikGsLix3vAsXWWi4rwfVOYzQK0OFPNi9RMCUdSH06m9uLWckiCxjos0FQODZE9l4ATGy9s9hNVwryOJTw==</wsse:BinarySecurityToken>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
Id="Signature-26443833" wsu:Id="Id-27337877">
+ <ds:SignedInfo>
+ <ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ <ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+ <ds:Reference URI="#Id-3916915">
+ <ds:Transforms>
+ <ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ </ds:Transforms>
+ <ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+
<ds:DigestValue>VC7M4QMD7DMowKoGIqunpHk95XM=</ds:DigestValue>
+ </ds:Reference>
+ <ds:Reference URI="#Timestamp-13080585">
+ <ds:Transforms>
+ <ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ </ds:Transforms>
+ <ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+
<ds:DigestValue>Y1vyfyE36IRRtS0ShtjdNzHLrHY=</ds:DigestValue>
+ </ds:Reference>
+ </ds:SignedInfo>
+
<ds:SignatureValue>CZ2+LbcBE748u9wDct0O+NZtnXfw2rfFo/r9+pYPdF3gsQxOaLJb/mmi5rOS3vDmrssb1Et4ZA3eHN5EZfMQVzFAgj3CrZFd1E+9LzSRGqHX+ohdBXX3O8vCeBeVjl2OlYgVWqaDGWTpJ59N5Pg2DD5vqmO6CrG/9e3pW4WTt54=</ds:SignatureValue>
+ <ds:KeyInfo Id="KeyId-8728760">
+ <wsse:SecurityTokenReference wsu:Id="STRId-28036099">
+ <wsse:Reference URI="#CertId-1776694"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
/>
+ </wsse:SecurityTokenReference>
+ </ds:KeyInfo>
+ </ds:Signature>
+ </wsse:Security>
+ </soapenv:Header>
+ <soapenv:Body
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Id-3916915">
+ <xenc:EncryptedData Id="EncDataId-3916915"
Type="http://www.w3.org/2001/04/xmlenc#Content">
+ <xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
+ <xenc:CipherData>
+
<xenc:CipherValue>p+S79NwOCGttYRRkGqgtaPVr0z2uZI1h6CW3b18tgOhCC6QU6YZPaF8Bz8OXRKF5NQ3ylMjoCRPsjT3T8USSOBwb6bdyBS0kRoPe7crj+Y+mbU1dzAeFaPuwcLSHQySrGtFqQdwnb137pm9xGCfxkN93dCIrusIHqAUBqNah6wWycbxmec8aQgK1cNqVqLUOu3qLtUGM9CeUwtZ2incX7dmN5a1gPinBSR4AxY68kqc2Zo8VZ4mv6srRySShnIIcG9Lu89CoTRo+U8yhYvEtplPM/1IjQo4Km96Zvol/RY/yOW6mlezdCK/oXkFaPInONBtj+JbpenZOaq1S1GraPUCQHiC4ddnIxI2OSiEqJWMbf0eO6YTlNJoOl4rY3bKoi4a8OP2flBuZEKtDMoVN4YWDKbKgA1mwd3GpampjZG9A/d72zdl2AiiQaInaYK1Q</xenc:CipherValue>
+ </xenc:CipherData>
+ </xenc:EncryptedData>
+ </soapenv:Body>
+ </soapenv:Envelope>
+0
+
Added: incubator/synapse/trunk/java/src/site/resources/sample_103_2.txt
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/src/site/resources/sample_103_2.txt?view=auto&rev=477504
==============================================================================
--- incubator/synapse/trunk/java/src/site/resources/sample_103_2.txt (added)
+++ incubator/synapse/trunk/java/src/site/resources/sample_103_2.txt Mon Nov 20
21:02:00 2006
@@ -0,0 +1,70 @@
+POST /axis2/services/StockQuoteProxy HTTP/1.1
+SOAPAction: "urn:getQuote"
+User-Agent: Axis2
+Host: 127.0.0.1:8081
+Transfer-Encoding: chunked
+Content-Type: text/xml; charset=UTF-8
+
+14ab
+<?xml version='1.0' encoding='UTF-8'?>
+ <soapenv:Envelope xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Header>
+ <wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soapenv:mustUnderstand="1">
+ <wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-13080585">
+ <wsu:Created>2006-11-21T04:39:49.171Z</wsu:Created>
+ <wsu:Expires>2006-11-24T15:59:49.171Z</wsu:Expires>
+ </wsu:Timestamp>
+ <xenc:EncryptedKey Id="EncKeyId-13878947">
+ <xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" />
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <wsse:SecurityTokenReference>
+ <wsse:KeyIdentifier
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">Xeg55vRyK3ZhAEhEf+YT0z986L0=</wsse:KeyIdentifier>
+ </wsse:SecurityTokenReference>
+ </ds:KeyInfo>
+ <xenc:CipherData>
+
<xenc:CipherValue>PASyzbvheknnUZhHgpb8uU1sfGHrOJlSa/xknxIx2MqMkvM2UL5vFeZmFAXy97jm2SqE8zl0PPxhT4kSH/Jhp9ECYXqfvV3QsIf28sRs7bW6dOmHt9SjJJnbwvS3f3xWLJ0l7P0Lgjx+xEUFSS6OguynbXNWBiryaPLMOowhgxQ=</xenc:CipherValue>
+ </xenc:CipherData>
+ <xenc:ReferenceList>
+ <xenc:DataReference URI="#EncDataId-3916915" />
+ </xenc:ReferenceList>
+ </xenc:EncryptedKey>
+ <wsse:BinarySecurityToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="CertId-1776694">MIIDDDCCAfSgAwIBAgIQM6YEf7FVYx/tZyEXgVComTANBgkqhkiG9w0BAQUFADAwMQ4wDAYDVQQKDAVPQVNJUzEeMBwGA1UEAwwVT0FTSVMgSW50ZXJvcCBUZXN0IENBMB4XDTA1MDMxOTAwMDAwMFoXDTE4MDMxOTIzNTk1OVowQjEOMAwGA1UECgwFT0FTSVMxIDAeBgNVBAsMF09BU0lTIEludGVyb3AgVGVzdCBDZXJ0MQ4wDAYDVQQDDAVBbGljZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAoqi99By1VYo0aHrkKCNT4DkIgPL/SgahbeKdGhrbu3K2XG7arfD9tqIBIKMfrX4Gp90NJa85AV1yiNsEyvq+mUnMpNcKnLXLOjkTmMCqDYbbkehJlXPnaWLzve+mW0pJdPxtf3rbD4PS/cBQIvtpjmrDAU8VsZKT8DN5Kyz+EZsCAwEAAaOBkzCBkDAJBgNVHRMEAjAAMDMGA1UdHwQsMCowKKImhiRodHRwOi8vaW50ZXJvcC5iYnRlc3QubmV0L2NybC9jYS5jcmwwDgYDVR0PAQH/BAQDAgSwMB0GA1UdDgQWBBQK4l0TUHZ1QV3V2Qtl
LNDm+PoxiDAfBgNVHSMEGDAWgBTAnSj8wes1oR3WqqqgHBpNwkkPDzANBgkqhkiG9w0BAQUFAAOCAQEABTqpOpvW+6yrLXyUlP2xJbEkohXHI5OWwKWleOb9hlkhWntUalfcFOJAgUyH30TTpHldzx1+vK2LPzhoUFKYHE1IyQvokBN2JjFO64BQukCKnZhldLRPxGhfkTdxQgdf5rCK/wh3xVsZCNTfuMNmlAM6lOAg8QduDah3WFZpEA0s2nwQaCNQTNMjJC8tav1CBr6+E5FAmwPXP7pJxn9Fw9OXRyqbRA4v2y7YpbGkG2GI9UvOHw6SGvf4FRSthMMO35YbpikGsLix3vAsXWWi4rwfVOYzQK0OFPNi9RMCUdSH06m9uLWckiCxjos0FQODZE9l4ATGy9s9hNVwryOJTw==</wsse:BinarySecurityToken>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
Id="Signature-26443833" wsu:Id="Id-27337877">
+ <ds:SignedInfo>
+ <ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ <ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+ <ds:Reference URI="#Id-3916915">
+ <ds:Transforms>
+ <ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ </ds:Transforms>
+ <ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+
<ds:DigestValue>VC7M4QMD7DMowKoGIqunpHk95XM=</ds:DigestValue>
+ </ds:Reference>
+ <ds:Reference URI="#Timestamp-13080585">
+ <ds:Transforms>
+ <ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ </ds:Transforms>
+ <ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+
<ds:DigestValue>Y1vyfyE36IRRtS0ShtjdNzHLrHY=</ds:DigestValue>
+ </ds:Reference>
+ </ds:SignedInfo>
+
<ds:SignatureValue>CZ2+LbcBE748u9wDct0O+NZtnXfw2rfFo/r9+pYPdF3gsQxOaLJb/mmi5rOS3vDmrssb1Et4ZA3eHN5EZfMQVzFAgj3CrZFd1E+9LzSRGqHX+ohdBXX3O8vCeBeVjl2OlYgVWqaDGWTpJ59N5Pg2DD5vqmO6CrG/9e3pW4WTt54=</ds:SignatureValue>
+ <ds:KeyInfo Id="KeyId-8728760">
+ <wsse:SecurityTokenReference wsu:Id="STRId-28036099">
+ <wsse:Reference URI="#CertId-1776694"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
/>
+ </wsse:SecurityTokenReference>
+ </ds:KeyInfo>
+ </ds:Signature>
+ </wsse:Security>
+ </soapenv:Header>
+ <soapenv:Body
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Id-3916915">
+ <xenc:EncryptedData Id="EncDataId-3916915"
Type="http://www.w3.org/2001/04/xmlenc#Content">
+ <xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
+ <xenc:CipherData>
+
<xenc:CipherValue>p+S79NwOCGttYRRkGqgtaPVr0z2uZI1h6CW3b18tgOhCC6QU6YZPaF8Bz8OXRKF5NQ3ylMjoCRPsjT3T8USSOBwb6bdyBS0kRoPe7crj+Y+mbU1dzAeFaPuwcLSHQySrGtFqQdwnb137pm9xGCfxkN93dCIrusIHqAUBqNah6wWycbxmec8aQgK1cNqVqLUOu3qLtUGM9CeUwtZ2incX7dmN5a1gPinBSR4AxY68kqc2Zo8VZ4mv6srRySShnIIcG9Lu89CoTRo+U8yhYvEtplPM/1IjQo4Km96Zvol/RY/yOW6mlezdCK/oXkFaPInONBtj+JbpenZOaq1S1GraPUCQHiC4ddnIxI2OSiEqJWMbf0eO6YTlNJoOl4rY3bKoi4a8OP2flBuZEKtDMoVN4YWDKbKgA1mwd3GpampjZG9A/d72zdl2AiiQaInaYK1Q</xenc:CipherValue>
+ </xenc:CipherData>
+ </xenc:EncryptedData>
+ </soapenv:Body>
+ </soapenv:Envelope>
+0
+
Modified: incubator/synapse/trunk/java/src/site/site.xml
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/src/site/site.xml?view=diff&rev=477504&r1=477503&r2=477504
==============================================================================
--- incubator/synapse/trunk/java/src/site/site.xml (original)
+++ incubator/synapse/trunk/java/src/site/site.xml Mon Nov 20 21:02:00 2006
@@ -49,6 +49,7 @@
<item name="Documentation">
<item name="Configuration Language"
href="Synapse_Configuration_Language.html"/>
<item name="User guide" href="userguide.html"/>
+ <item name="Samples" href="Synapse_Samples.html"/>
<item name="Extending Synapse" href="extending_synapse.html"/>
<item name="Javadocs" href="apidocs/index.html"/>
</item>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]