From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/samples/RubyCalculator/Makefile.am | 4 + .../sca/samples/RubyCalculator/README | 23 ++ .../sca/samples/RubyCalculator/README.html | 249 +++++++++++++++++++++ .../sca/samples/RubyCalculator/deploy.cmd | 56 +++++ .../sample.calculator.client/CalculatorClient.rb | 25 +++ .../sample.calculator.client/Makefile.am | 6 + .../sample.calculator.client/runclient.bat | 49 ++++ .../sample.calculator.client/runclient.sh | 49 ++++ .../sample.calculator.solution.composite | 32 +++ .../sample.calculator.wsclient/Calculator.wsdl | 114 ++++++++++ .../CalculatorWSClient.rb | 25 +++ .../sample.calculator.wsclient/Makefile.am | 6 + .../sample.calculator.wsclient/runwsclient.bat | 49 ++++ .../sample.calculator.wsclient/runwsclient.sh | 48 ++++ .../sample.calculator.wsclient.composite | 29 +++ .../sample.calculator/Calculator.wsdl | 114 ++++++++++ .../sample.calculator/CalculatorImpl.rb | 48 ++++ .../RubyCalculator/sample.calculator/DivideImpl.rb | 39 ++++ .../RubyCalculator/sample.calculator/Makefile.am | 7 + .../sample.calculator/runwsserver.bat | 49 ++++ .../sample.calculator/runwsserver.sh | 48 ++++ .../sample.calculator/sample.calculator.composite | 40 ++++ 22 files changed, 1109 insertions(+) create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/Makefile.am create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README.html create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/deploy.cmd create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/Makefile.am create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.bat create mode 100755 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.sh create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.solution.composite create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Calculator.wsdl create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/CalculatorWSClient.rb create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Makefile.am create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.bat create mode 100755 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.sh create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/sample.calculator.wsclient.composite create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Calculator.wsdl create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/DivideImpl.rb create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Makefile.am create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.bat create mode 100755 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.sh create mode 100644 tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/sample.calculator.composite (limited to 'tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator') diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/Makefile.am b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/Makefile.am new file mode 100644 index 0000000000..908112e3cd --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/Makefile.am @@ -0,0 +1,4 @@ +deploydir=$(prefix)/samples/RubyCalculator/deploy +SUBDIRS = sample.calculator sample.calculator.client sample.calculator.wsclient +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README new file mode 100644 index 0000000000..4104ff46b6 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README @@ -0,0 +1,23 @@ +Tuscany SCA for C++ Samples - Calculator Sample +=============================================== + +This is a very simple sample to show how an SCA composite can wire together +two components to implement a Calculator service and expose that service as +a Web Service. + +There are three sub projects in this workspace: + - sample.calculator + This contains the source code and SCDL artifacts for the SCA Calculator. + composite implementing the sample Calculator. + + - sample.calculator.client + A sample client which does a local call to the Calculator service. + + - sample.calculator.wsclient + A sample Axis2 Web Service client which calls the Calculator Web service. + +Additionally, there is the sample.calculator.solution.composite file. This +describes the configuration of the SCA Calculator composite deployed to the +SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README.html b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README.html new file mode 100644 index 0000000000..e5e2a832cf --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/README.html @@ -0,0 +1,249 @@ + + + + + + + + + + + Tuscany SCA for C++ Samples - RubyCalculator Sample + + + +
+
+
+

Tuscany SCA for C++ Samples - RubyCalculator Sample

+ +

This is a very simple sample to show how an SCA composite can wire + together two Ruby components to implement a Calculator service and expose + that service as a Web Service. +

+

There are three sub projects in this workspace:

+
    +
  • sample.calculator
    + This contains the Ruby scripts and SCDL artifacts for the SCA Calculator + composite implementing the sample Calculator. +
  • +
  • sample.calculator.client
    + A sample client which does a local call to the Calculator service. +
  • +
  • sample.calculator.wsclient
    + A sample client which does a local call to a composite that contains a Web Service reference + that calls the Calculator Web Service. +
  • +
+

Additionally, there is the sample.calculator.solution.composite file. This + describes the configuration of the SCA Calculator composite deployed to the SCA + runtime. +

+
+ + + + +
+

Building the Ruby samples on Linux

+

If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux.

+
    +
  1. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • AXIS2C_HOME=<path to axis2c version 0.94>
    • +
  2. + +
  3. As the RubyCalculator sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Ruby samples only with the following command sequence: +
      +
    • cd <tuscany_sca_install_dir>/samples
    • +
    • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP
    • +
    • make install
    • +
    + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/RubyCalculator
  4. +
+
+ +
+

Running the RubyCalculator sample on Linux

+

RubyCalculator with basic client

+
    +
  1. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to installed Tuscany SCA>
    • +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
    • +
    • AXIS2C_HOME=<path to axis2c version 0.94>
    • +
    +
  2. +
  3. Run the sample with the following commands: +
      +
    • cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator.client
    • +
    • ./runclient.sh
    • +
    +
  4. +
+

RubyCalculator with Web Service client

+
    +
  1. Ensure you have enabled Axis2C to run Tuscany SCA services. Follow the instructions + found here. +
  2. +
  3. Start the Axis2C simple http server: +
      +
    1. The following environment variables are required: +
        +
      • TUSCANY_SCACPP=<path to installed Tuscany SCA>
      • +
      • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
      • +
      • AXIS2C_HOME=<path to axis2c version 0.94>
      • +
      +
    2. +
    3. cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator
    4. +
    5. ./runwsserver.sh
    6. +
    +
  4. +
  5. Run the client: +
      +
    1. The following environment variable is required: +
        +
      • AXIS2C_HOME=<path to axis2c version 0.94>
      • +
      +
    2. +
    3. cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator.wsclient
    4. +
    5. ./runwsclient.sh
    6. +
    +
  6. +
+
+ +
+

Building the RubyCalculator sample on Windows

+

If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Windows.

+
    +
  1. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • AXIS2C_HOME=<path to axis2c version 0.94>
    • +
  2. + +
  3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
      +
    • cd <tuscany_sca_install_dir>/samples/RubyCalculator
    • +
    • ./deploy.cmd
    • +
    +
  4. +
+
+ +
+

Running the RubyCalculator sample on Windows

+

RubyCalculator with basic client

+
    +
  1. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to installed Tuscany SCA>
    • +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
    • +
    • AXIS2C_HOME=<path to axis2c version 0.94>
    • +
    +
  2. +
  3. Run the sample with the following commands: +
      +
    • cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator.client
    • +
    • ./runclient.bat
    • +
    +
  4. +
+

RubyCalculator with Web Service client

+
    +
  1. Ensure you have enabled Axis2C to run Tuscany SCA services. Follow the instructions + found here. +
  2. +
  3. Start the Axis2C simple http server: +
      +
    1. The following environment variables are required: +
        +
      • TUSCANY_SCACPP=<path to installed Tuscany SCA>
      • +
      • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
      • +
      • AXIS2C_HOME=<path to axis2c version 0.94>
      • +
      +
    2. +
    3. cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator
    4. +
    5. ./runwsserver.bat
    6. +
    +
  4. +
  5. Run the client: +
      +
    1. The following environment variables are required: +
        +
      • TUSCANY_SCACPP=<path to installed Tuscany SCA>
      • +
      • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
      • +
      • AXIS2C_HOME=<path to axis2c version 0.94>
      • +
      +
    2. +
    3. cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator.wsclient
    4. +
    5. ./runwsclient.bat
    6. +
    +
  6. +
+
+ + + +
+

Getting Help

+ +

First place to look is at the Tuscany FAQ at + http://incubator.apache.org/tuscany/faq.html

+ +

Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

+
+
+
+ + + + diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/deploy.cmd b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/deploy.cmd new file mode 100644 index 0000000000..2609c3b1e5 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/deploy.cmd @@ -0,0 +1,56 @@ +@echo off +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. + +rem Will copy the correct files from the source tree for packaging and deployment of the +rem SCA sample. +setlocal +set currentPath=%~d0%~p0 +set sourcePath=%currentPath% + +set deploydir=%TUSCANY_SCACPP% +set samplesdir=%deploydir%\samples +set calcdir=%samplesdir%\RubyCalculator + +if . == %1. ( +set destinationPath=%calcdir%\deploy +) ELSE ( +set destinationPath=%1 +) + +if not exist %samplesdir% mkdir %samplesdir% +if not exist %calcdir% mkdir %calcdir% +if not exist %destinationPath% mkdir %destinationPath% +if not exist %destinationPath%\sample.calculator mkdir %destinationPath%\sample.calculator +copy %sourcePath%\sample.calculator\*.composite %destinationPath%\sample.calculator +copy %sourcePath%\sample.calculator\*.rb %destinationPath%\sample.calculator +copy %sourcePath%\sample.calculator\Calculator.wsdl %destinationPath%\sample.calculator +copy %sourcePath%\sample.calculator\runwsserver.bat %destinationPath%\sample.calculator + +if not exist %destinationPath%\sample.calculator.client mkdir %destinationPath%\sample.calculator.client +copy %sourcePath%\sample.calculator.client\CalculatorClient.rb %destinationPath%\sample.calculator.client +copy %sourcePath%\sample.calculator.client\runclient.bat %destinationPath%\sample.calculator.client + +if not exist %destinationPath%\sample.calculator.wsclient mkdir %destinationPath%\sample.calculator.wsclient +copy %sourcePath%\sample.calculator.wsclient\CalculatorWSClient.rb %destinationPath%\sample.calculator.wsclient +copy %sourcePath%\sample.calculator.wsclient\sample.calculator.wsclient.composite %destinationPath%\sample.calculator.wsclient +copy %sourcePath%\sample.calculator.wsclient\Calculator.wsdl %destinationPath%\sample.calculator.wsclient +copy %sourcePath%\sample.calculator.wsclient\runwsclient.bat %destinationPath%\sample.calculator.wsclient + +copy %sourcePath%\*.composite %destinationPath% + +endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb new file mode 100644 index 0000000000..253928df0c --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +require("tuscany_sca_ruby") + +calculator = SCA::locateService("CalculatorComponent") + +x = calculator.div(5, 2) +print x, "\n" diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/Makefile.am b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/Makefile.am new file mode 100644 index 0000000000..06ffb81173 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/Makefile.am @@ -0,0 +1,6 @@ +deploydir=$(prefix)/samples/RubyCalculator/deploy +clientdir=$(deploydir)/sample.calculator.client + +client_DATA = *.rb +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh *.rb diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.bat b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.bat new file mode 100644 index 0000000000..4e9cc0f2cd --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.bat @@ -0,0 +1,49 @@ +@echo off + +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. + +setlocal + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo using Axis2C installed at %AXIS2C_HOME% + +set TUSCANY_SCACPP_SYSTEM_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent + +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +cd %TUSCANY_SCACPP_SYSTEM_ROOT%\sample.calculator.client +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin CalculatorClient.rb + +:end +endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.sh b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.sh new file mode 100755 index 0000000000..974dd2e41c --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.client/runclient.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +APFULLDIR=`pwd` + +if [ x$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +TEST_SYSTEM=$APFULLDIR/../ + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_SYSTEM_ROOT=$TEST_SYSTEM +export TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent + +cd $TUSCANY_SCACPP_SYSTEM_ROOT/sample.calculator.client +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib CalculatorClient.rb diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.solution.composite b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.solution.composite new file mode 100644 index 0000000000..0a8ae343db --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.solution.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Calculator.wsdl b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Calculator.wsdl new file mode 100644 index 0000000000..f74c3d5c33 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Calculator.wsdl @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/CalculatorWSClient.rb b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/CalculatorWSClient.rb new file mode 100644 index 0000000000..4022f8a636 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/CalculatorWSClient.rb @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +require("tuscany_sca_ruby") + +calculator = SCA::locateService("CalculatorService") + +x = calculator.div(5, 2) +print x, "\n" diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Makefile.am b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Makefile.am new file mode 100644 index 0000000000..ab977e5b64 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/Makefile.am @@ -0,0 +1,6 @@ +deploydir=$(prefix)/samples/RubyCalculator/deploy +wsclientdir=$(deploydir)/sample.calculator.wsclient + +wsclient_DATA = *.rb *.wsdl *.composite +wsclient_SCRIPTS = runwsclient.sh +EXTRA_DIST = runwsclient.sh *.rb *.wsdl *.composite diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.bat b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.bat new file mode 100644 index 0000000000..f9a1ad62a7 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.bat @@ -0,0 +1,49 @@ +@echo off + +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. + +setlocal + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo using Axis2C installed at %AXIS2C_HOME% + +set TUSCANY_SCACPP_SYSTEM_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorWSClientComponent + +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +cd %TUSCANY_SCACPP_SYSTEM_ROOT%\sample.calculator.wsclient +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin CalculatorWSClient.rb + +:end +endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.sh b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.sh new file mode 100755 index 0000000000..ec4053fb74 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/runwsclient.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +APFULLDIR=`pwd` + +if [ x$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +TEST_SYSTEM=$APFULLDIR/../ + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_SYSTEM_ROOT=$TEST_SYSTEM +export TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorWSClientComponent + +cd $TUSCANY_SCACPP_SYSTEM_ROOT/sample.calculator.wsclient +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib CalculatorWSClient.rb diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/sample.calculator.wsclient.composite b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/sample.calculator.wsclient.composite new file mode 100644 index 0000000000..22d31b539c --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator.wsclient/sample.calculator.wsclient.composite @@ -0,0 +1,29 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Calculator.wsdl b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Calculator.wsdl new file mode 100644 index 0000000000..f74c3d5c33 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Calculator.wsdl @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb new file mode 100644 index 0000000000..36ed15ff9b --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +class CalculatorImpl + + attr_writer :divideService + + def initialize() + print "Ruby - CalculatorImpl.initialize\n" + end + + def div(arg1, arg2) + print "Ruby - CalculatorImpl.div\n" + @divideService.divide(arg1.to_f, arg2.to_f) + end + + def add(arg1, arg2) + print "Ruby - CalculatorImpl.add\n" + arg1.to_f + arg2.to_f + end + + def sub(arg1, arg2) + print "Ruby - CalculatorImpl.sub\n" + arg1.to_f - arg2.to_f + end + + def mul(arg1, arg2) + print "Ruby - CalculatorImpl.mul\n" + arg1.to_f * arg2.to_f + end + +end \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/DivideImpl.rb b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/DivideImpl.rb new file mode 100644 index 0000000000..c6615bfcfa --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/DivideImpl.rb @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +class DivideImpl + + attr_writer :round + + def initialize() + print "Ruby - DivideImpl.initialize\n" + end + + def divide(arg1, arg2) + print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n" + res = arg1.to_f / arg2.to_f + if @round then + res = res.round + print "DivideImpl.divide rounding\n" + end + print "DivideImpl.divide ", res, "\n" + res + end + +end \ No newline at end of file diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Makefile.am b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..6e85ad28a4 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/Makefile.am @@ -0,0 +1,7 @@ +deploydir=$(prefix)/samples/RubyCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +composite_SCRIPTS = runwsserver.sh + +composite_DATA = *.composite *.wsdl *.rb +EXTRA_DIST = *.composite *.wsdl *.rb runwsserver.sh diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.bat b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.bat new file mode 100644 index 0000000000..9870d4600d --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.bat @@ -0,0 +1,49 @@ +@echo off + +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. + +setlocal + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo using Axis2C installed at %AXIS2C_HOME% + +set TUSCANY_SCACPP_SYSTEM_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent + +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +cd %AXIS2C_HOME%\bin +.\axis2_http_server.exe + +:end +endlocal diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.sh b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.sh new file mode 100755 index 0000000000..69906579b2 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/runwsserver.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +APFULLDIR=`pwd` + +if [ x$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +TEST_SYSTEM=$APFULLDIR/../ + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_SYSTEM_ROOT=$TEST_SYSTEM +export TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent + +cd $AXIS2C_HOME/bin +./axis2_http_server diff --git a/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/sample.calculator.composite b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..90f68e8234 --- /dev/null +++ b/tags/cpp-1.0-incubating-M2-RC1/sca/samples/RubyCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,40 @@ + + + + + + + + + CalculatorComponent + + + + + DivideComponent + + + + + true + + + \ No newline at end of file -- cgit v1.2.3