I checked in a working version of the Ruby BigBank scenario under
cpp/sca/samples/RubyBank.
If you take a look at this code you'll see that it's very simple. Here
are links to the interesting files:
AccountDataServiceImpl.rb: Implements the Account Data Service
component, three methods returning checking, savings and stock account info.
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyBank/bigbank.account/AccountDataServiceImpl.rb
AccountServiceImpl.rb: the Account Service component, calls the Account
Data Service to get account info, then calls the StockQuote Web service
to get the price of the Stock, calculates the balance of the stock
account, and converts all balances to the configured currency.
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyBank/bigbank.account/AccountServiceImpl.rb
StockQuoteServiceImpl.rb: Front end component for the StockQuote Web
service, extract the price of the stock from the document returned by
the StockQuote Web service.
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyBank/bigbank.account/StockQuoteServiceImpl.rb
AccountClient.rb: A Ruby client that does an SCA locateService then
invokes the Account Service.
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyBank/bigbank.client/AccountClient.rb
bigbank.account.composite: The SCDL composite file declaring the above
Ruby components and wiring them together.
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyBank/bigbank.account/bigbank.account.composite
The Ruby component implementations currently use the standard Ruby
rexml/document module to handle XML documents. This is the how SDO
DataObjects are rendered in Ruby now. Basically our runtime converts
SDO DataObjects to rexml Documents before passing them to Ruby and
returned rexml Documents back to SDO DataObjects. I think that this is
OK for now as rexml is easy to use and comes with the standard Ruby
distribution. In the future I think we should look into implementing a
full blown SDO integration like is done for PHP with the SDO for PHP
package at http://pecl.php.net/package/sdo.
Here are the steps to run this new scenario:
To run the command line client:
- cd to $TUSCANY_SCACPP/samples/RubyBank/deploy/bin
- run ./runclient.sh
To start a server publishing the AccountService Web service:
- run ./runwsserver.sh
To invoke the AccountService Web service, you can use the Web Service
client that comes with the C++ version of BigBank:
- cd to $TUSCANY_SCACPP/samples/BigBank/deploy/bin
- run ./runwsclient.sh
It should also work the same way with Simon's PHP BigBank client.
I think it would be nice to implement the SupplyChain application
scenario in Ruby as well. Or maybe even better... use that scenario to
show the integration of multiple languages, Python, C++ and PHP for
example? I guess we just need a little more work on the PHP extension to
support properties, references and bring in on par with the Ruby and
Python extensions. Thoughts?
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]