You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ru...@apache.org on 2010/07/18 18:58:32 UTC
svn commit: r965262 - in /synapse/trunk/java/repository/conf/sample:
synapse_sample_300.xml synapse_sample_350.xml synapse_sample_351.xml
synapse_sample_352.xml synapse_sample_353.xml synapse_sample_354.xml
Author: ruwan
Date: Sun Jul 18 16:58:31 2010
New Revision: 965262
URL: http://svn.apache.org/viewvc?rev=965262&view=rev
Log:
migrating samples 300 and 350 to 354
Modified:
synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml
synapse/trunk/java/repository/conf/sample/synapse_sample_350.xml
synapse/trunk/java/repository/conf/sample/synapse_sample_351.xml
synapse/trunk/java/repository/conf/sample/synapse_sample_352.xml
synapse/trunk/java/repository/conf/sample/synapse_sample_353.xml
synapse/trunk/java/repository/conf/sample/synapse_sample_354.xml
Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml?rev=965262&r1=965261&r2=965262&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml Sun Jul 18 16:58:31 2010
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
@@ -33,15 +34,23 @@
<trigger interval="5"/>
</task>
- <in>
- <send/>
- </in>
- <out>
- <log level="custom">
- <property name="Stock_Quote_on" expression="//ns:return/ax21:lastTradeTimestamp/child::text()" xmlns:ax21="http://services.samples/xsd" xmlns:ns="http://services.samples"/>
- <property name="For_the_organization" expression="//ns:return/ax21:name/child::text()" xmlns:ax21="http://services.samples/xsd" xmlns:ns="http://services.samples"/>
- <property name="Last_Value" expression="//ns:return/ax21:last/child::text()" xmlns:ax21="http://services.samples/xsd" xmlns:ns="http://services.samples"/>
- </log>
- </out>
+ <sequence name="main">
+ <in>
+ <send/>
+ </in>
+ <out>
+ <log level="custom">
+ <property xmlns:ax21="http://services.samples/xsd"
+ xmlns:ns="http://services.samples" name="Stock_Quote_on"
+ expression="//ns:return/ax21:lastTradeTimestamp/child::text()"/>
+ <property xmlns:ax21="http://services.samples/xsd"
+ xmlns:ns="http://services.samples" name="For_the_organization"
+ expression="//ns:return/ax21:name/child::text()"/>
+ <property xmlns:ax21="http://services.samples/xsd"
+ xmlns:ns="http://services.samples" name="Last_Value"
+ expression="//ns:return/ax21:last/child::text()"/>
+ </log>
+ </out>
+ </sequence>
-</definitions>
\ No newline at end of file
+</definitions>
Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_350.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_350.xml?rev=965262&r1=965261&r2=965262&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_350.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_350.xml Sun Jul 18 16:58:31 2010
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
@@ -30,20 +31,22 @@
<localEntry key="stockquoteScript"
src="file:repository/conf/sample/resources/script/stockquoteTransformRequest.js"/>
- <in>
- <!-- transform the custom quote request into a standard quote request expected by the service -->
- <script language="js" key="stockquoteScript" function="transformRequest"/>
- <send>
- <endpoint>
- <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
- </endpoint>
- </send>
- </in>
+ <sequence name="main">
+ <in>
+ <!-- transform the custom quote request into a standard quote request expected by the service -->
+ <script language="js" key="stockquoteScript" function="transformRequest"/>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </in>
+ <out>
+ <!-- transform the standard response back into the custom format the client expects -->
+ <script language="js" key="script/stockquoteTransformResponse.js"
+ function="transformResponse"/>
+ <send/>
+ </out>
+ </sequence>
- <out>
- <!-- transform the standard response back into the custom format the client expects -->
- <script language="js" key="script/stockquoteTransformResponse.js"
- function="transformResponse"/>
- <send/>
- </out>
</definitions>
Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_351.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_351.xml?rev=965262&r1=965261&r2=965262&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_351.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_351.xml Sun Jul 18 16:58:31 2010
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
@@ -16,37 +17,41 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
<!-- In-line script mediation with JavaScript -->
<definitions xmlns="http://synapse.apache.org/ns/2010/04/configuration">
- <in>
- <!-- transform the custom quote request into a standard quote requst expected by the service -->
- <script language="js"><![CDATA[
- var symbol = mc.getPayloadXML()..*::Code.toString();
- mc.setPayloadXML(
- <m:getQuote xmlns:m="http://services.samples/xsd">
- <m:request>
- <m:symbol>{symbol}</m:symbol>
- </m:request>
- </m:getQuote>);
- ]]></script>
- <send>
- <endpoint>
- <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
- </endpoint>
- </send>
- </in>
- <out>
- <!-- transform the standard response back into the custom format the client expects -->
- <script language="js"><![CDATA[
- var symbol = mc.getPayloadXML()..*::symbol.toString();
- var price = mc.getPayloadXML()..*::last.toString();
- mc.setPayloadXML(
- <m:CheckPriceResponse xmlns:m="http://services.samples/xsd">
- <m:Code>{symbol}</m:Code>
- <m:Price>{price}</m:Price>
- </m:CheckPriceResponse>);
- ]]></script>
- <send/>
- </out>
+
+ <sequence name="main">
+ <in>
+ <!-- transform the custom quote request into a standard quote requst expected by the service -->
+ <script language="js">
+ var symbol = mc.getPayloadXML()..*::Code.toString();
+ mc.setPayloadXML(
+ <m:getQuote xmlns:m="http://services.samples/xsd">
+ <m:request>
+ <m:symbol>{symbol}</m:symbol>
+ </m:request>
+ </m:getQuote>);
+ </script>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </in>
+ <out>
+ <!-- transform the standard response back into the custom format the client expects -->
+ <script language="js">
+ var symbol = mc.getPayloadXML()..*::symbol.toString();
+ var price = mc.getPayloadXML()..*::last.toString();
+ mc.setPayloadXML(
+ <m:CheckPriceResponse xmlns:m="http://services.samples/xsd">
+ <m:Code>{symbol}</m:Code>
+ <m:Price>{price}</m:Price>
+ </m:CheckPriceResponse>);
+ </script>
+ <send/>
+ </out>
+ </sequence>
+
</definitions>
Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_352.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_352.xml?rev=965262&r1=965261&r2=965262&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_352.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_352.xml Sun Jul 18 16:58:31 2010
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
@@ -19,18 +20,22 @@
<!-- Accessing Synapse message context API methods using scripting language -->
<definitions xmlns="http://synapse.apache.org/ns/2010/04/configuration">
- <in>
- <!-- change the MessageContext into a response and set a response payload -->
- <script language="js"><![CDATA[
- mc.setTo(mc.getReplyTo());
- mc.setProperty("RESPONSE", "true");
- mc.setPayloadXML(
- <ns:getQuoteResponse xmlns:ns="http://services.samples/xsd">
- <ns:return>
- <ns:last>99.9</ns:last>
- </ns:return>
- </ns:getQuoteResponse>);
- ]]></script>
- </in>
- <send/>
-</definitions>
\ No newline at end of file
+
+ <sequence name="main">
+ <in>
+ <!-- change the MessageContext into a response and set a response payload -->
+ <script language="js">
+ mc.setTo(mc.getReplyTo());
+ mc.setProperty("RESPONSE", "true");
+ mc.setPayloadXML(
+ <ns:getQuoteResponse xmlns:ns="http://services.samples/xsd">
+ <ns:return>
+ <ns:last>99.9</ns:last>
+ </ns:return>
+ </ns:getQuoteResponse>);
+ </script>
+ </in>
+ <send/>
+ </sequence>
+
+</definitions>
Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_353.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_353.xml?rev=965262&r1=965261&r2=965262&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_353.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_353.xml Sun Jul 18 16:58:31 2010
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
@@ -16,25 +17,30 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
<!-- Using Ruby scripts for mediation -->
<definitions xmlns="http://synapse.apache.org/ns/2010/04/configuration">
- <localEntry key="stockquoteScript" src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
- <in>
- <!-- transform the custom quote request into a standard quote request expected by the service -->
- <script language="rb" key="stockquoteScript" function="transformRequest"/>
+ <localEntry key="stockquoteScript"
+ src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
+
+ <sequence name="main">
+ <in>
+ <!-- transform the custom quote request into a standard quote request expected by the service -->
+ <script language="rb" key="stockquoteScript" function="transformRequest"/>
+
+ <!-- send message to real endpoint referenced by name "stockquote" and stop -->
+ <send>
+ <endpoint name="stockquote">
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </in>
+ <out>
+ <!-- transform the standard response back into the custom format the client expects -->
+ <script language="rb" key="stockquoteScript" function="transformResponse"/>
+ <send/>
+ </out>
+ </sequence>
- <!-- send message to real endpoint referenced by name "stockquote" and stop -->
- <send>
- <endpoint name="stockquote">
- <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
- </endpoint>
- </send>
- </in>
- <out>
- <!-- transform the standard response back into the custom format the client expects -->
- <script language="rb" key="stockquoteScript" function="transformResponse"/>
- <send/>
- </out>
</definitions>
Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_354.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_354.xml?rev=965262&r1=965261&r2=965262&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_354.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_354.xml Sun Jul 18 16:58:31 2010
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
@@ -17,35 +18,43 @@
~ under the License.
-->
- <!-- Using In-lined Ruby scripts for mediation -->
+<!-- Using In-lined Ruby scripts for mediation -->
<definitions xmlns="http://synapse.apache.org/ns/2010/04/configuration">
- <in>
- <script language="rb">
- <![CDATA[
+
+ <sequence name="main">
+ <in>
+ <script language="rb">
+
require 'rexml/document'
include REXML
- newRequest= Document.new '<m:getQuote xmlns:m="http://services.samples"><m:request><m:symbol>...test...</m:symbol></m:request></m:getQuote>'
- newRequest.root.elements[1].elements[1].text = $mc.getPayloadXML().root.elements[1].get_text
+ newRequest= Document.new '<m:getQuote xmlns:m="http://services.samples"><m:request><m:symbol>...test...</m:symbol></m:request></m:getQuote>'
+ newRequest.root.elements[1].elements[1].text =
+ $mc.getPayloadXML().root.elements[1].get_text
$mc.setPayloadXML(newRequest)
- ]]>
- </script>
- <send>
- <endpoint>
- <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
- </endpoint>
- </send>
- </in>
- <out>
- <script language="rb">
- <![CDATA[
+
+ </script>
+ <send>
+ <endpoint>
+ <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </in>
+ <out>
+ <script language="rb">
+
require 'rexml/document'
include REXML
- newResponse = Document.new '<m:CheckPriceResponse xmlns:m="http://services.samples/xsd"><m:Code></m:Code><m:Price></m:Price></m:CheckPriceResponse>'
- newResponse.root.elements[1].text = $mc.getPayloadXML().root.elements[1].elements[1].get_text
- newResponse.root.elements[2].text = $mc.getPayloadXML().root.elements[1].elements[2].get_text
+ newResponse = Document.new '<m:CheckPriceResponse
+ xmlns:m="http://services.samples/xsd"><m:Code></m:Code><m:Price></m:Price></m:CheckPriceResponse>'
+ newResponse.root.elements[1].text =
+ $mc.getPayloadXML().root.elements[1].elements[1].get_text
+ newResponse.root.elements[2].text =
+ $mc.getPayloadXML().root.elements[1].elements[2].get_text
$mc.setPayloadXML(newResponse)
- ]]>
- </script>
- <send/>
- </out>
+
+ </script>
+ <send/>
+ </out>
+ </sequence>
+
</definitions>