Author: indika
Date: Mon Dec 17 01:58:28 2007
New Revision: 604810
URL: http://svn.apache.org/viewvc?rev=604810&view=rev
Log:
add the Ruby sample (in-lined ruby script ) and update the sample guide
Added:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_354.xml
Modified:
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml
webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
Modified: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml?rev=604810&r1=604809&r2=604810&view=diff
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml Mon Dec 17 01:58:28 2007
@@ -38,9 +38,9 @@
<!-- Using In-lined Ruby scripts for mediation --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> + <in> + <script language="rb"> + <![CDATA[ + require 'rexml/document' + include REXML + newRequest= Document.new '<m:getQuote xmlns:m="http://services.samples/xsd"><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/soap/SimpleStockQuoteService"/> + </endpoint> + </send> + </in> + <out> + <script language="rb"> + <![CDATA[ + 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 + $mc.setPayloadXML(newResponse) + ]]> + </script> + <send/> + </out> +</definitions>+ +
Objective: Script mediators using Ruby(In-line Ruby +Script)
+ +Prerequisites:
+ +This sample uses Ruby so first setup support for this in Synapse as +described at Configuring +JRuby.
+ +Start the Synapse configuration numbered 354: i.e. bin/synapse -sample
+354
+Start the Axis2 server and deploy the SimpleStockQuoteService if not already
+done
This sample is functionally equivalent to the sample 353.
+ +Run the client with
+ant stockquote -Daddurl=http://localhost:9000/soap/SimpleStockQuoteService -Dtrpurl=http://localhost:8080/ -Dmode=customquote+
- -
+
+