From e982b4ef38fd043c15e89bdd60763b10434a087e Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Sun, 28 Feb 2010 19:40:06 +0000 Subject: Moving old inactive code to a branch as it's confusing code assist, searches and indexing in trunk. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@917273 13f79535-47bb-0310-9956-ffa450edef68 --- .../sample.calculator.client/CalculatorClient.cpp | 61 ++++++++++++++++++++++ .../sample.calculator.client/CalculatorClient.php | 32 ++++++++++++ .../PHPCalculator/sample.calculator.client/env.sh | 48 +++++++++++++++++ .../sample.calculator.client/runclient_cpp.bat | 26 +++++++++ .../sample.calculator.client/runclient_cpp.sh | 26 +++++++++ .../sample.calculator.client/runclient_php.bat | 25 +++++++++ 6 files changed, 218 insertions(+) create mode 100644 sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp create mode 100644 sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php create mode 100755 sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/env.sh create mode 100644 sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat create mode 100755 sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh create mode 100644 sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat (limited to 'sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client') diff --git a/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp new file mode 100644 index 0000000000..e72b52f87e --- /dev/null +++ b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp @@ -0,0 +1,61 @@ +/* + * 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. + */ + +/* $Rev$ $Date$ */ + +// some strangeness in the build that causes +// WinSock.h and WinSock2.h to be included leading to redefinitions +//#define _WINSOCKAPI_ + + +#include + +#include + +#include + +#include "commonj/sdo/SDO.h" + +#include "osoa/sca/sca.h" + +#include "Calculator.h" + + +using namespace std; +using namespace commonj::sdo; +using namespace osoa::sca; + + +int main (int argc, char** argv) +{ + + try + { + CompositeContext myContext = CompositeContext::getCurrent(); + Calculator *calcService = (Calculator*) myContext.locateService("CalculatorCPPComponent/CalculatorService"); + float result = calcService->div(10, 2); + cout << "calculator_client: div(10,2) = " << result << endl; + } + catch (...) + { + printf("Got and exception"); + } + + return 0; +} diff --git a/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php new file mode 100644 index 0000000000..7a512260ae --- /dev/null +++ b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php @@ -0,0 +1,32 @@ +add(1.23, 4.56) . "\n"; +echo "sub(1.23, 4.56) = " . $service->sub(1.23, 4.56) . "\n"; +echo "mul(1.23, 4.56) = " . $service->mul(1.23, 4.56) . "\n"; +echo "div(1.23, 4.56) = " . $service->div(1.23, 4.56) . "\n"; + +?> diff --git a/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/env.sh b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/env.sh new file mode 100755 index 0000000000..de34f1b42a --- /dev/null +++ b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/env.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# 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. + +export AXIS2C_HOME=/home/slaws/apps/axis2c-bin-0.96-linux + +export LIBXML2_LIB=/usr/lib +export LIBXML2_INCLUDE=/usr/include/libxml2 + +export PHP_LIB=/usr/local/lib +export PHP_INCLUDE=/usr/local/include/php + +export PHP_SCA_SDO_INCLUDE=/home/slaws/phpbuild-5-2/pecl/SDO +export PHP_SCA_SDO_LIB=$PHP_LIB/php/extensions/no-debug-zts-20060613/ + +export TUSCANY_SDOCPP=/sdo/deploy +export TUSCANY_SCACPP=/usr/local/tuscany/cpp/sca/deploy + +export LD_LIBRARY_PATH=$LIBXML2_LIB:\ +$AXIS2C_HOME/lib:\ +$PHP_LIB:\ +$TUSCANY_SDOCPP/lib:\ +$TUSCANY_SCACPP/lib:\ +$TUSCANY_SCACPP/extensions/cpp/lib:\ +$TUSCANY_SCACPP/extensions/php/lib:\ +$TUSCANY_SCACPP/extensions/ws/lib:\ +$TUSCANY_SCACPP/samples/PHPCalculator/deploy/sample.calculator:\ +$PHP_SCA_SDO_LIB + +export TUSCANY_SCACPP_LOGGING=9 +export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator + +export PATH=.:$PATH diff --git a/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat new file mode 100644 index 0000000000..0493d7410d --- /dev/null +++ b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat @@ -0,0 +1,26 @@ +@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. + +set TUSCANY_SCACPP_ROOT=%TUSCANY_SCACPP%\samples\PHPCalculator\deploy +set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent +set TUSCANY_SCACPP_LOGGING=9 +set PHRC=C:\simon\Projects\Tuscany\php\php-5.2.0\Debug_TS + +calculator_client.exe + diff --git a/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh new file mode 100755 index 0000000000..85a472b7fb --- /dev/null +++ b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# 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. + +export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent + +a.out +# gdb a.out +# strace a.out &> strace.txt +# valgrind a.out diff --git a/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat new file mode 100644 index 0000000000..815c4fb58e --- /dev/null +++ b/sca-cpp/branches/cpp-contrib/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat @@ -0,0 +1,25 @@ +@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 + +php TuscanyTest.php + +:end +endlocal -- cgit v1.2.3