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 --- .../BigBank/AccountClient/AccountClient.cpp | 130 +++++++++++ .../BigBank/AccountClient/AccountClient.dsp | 102 +++++++++ .../BigBank/AccountClient/AccountClient.plg | 32 +++ .../samples/BigBank/Accounts/AccountDataService.h | 62 +++++ .../Accounts/AccountDataServiceImpl.componentType | 26 +++ .../BigBank/Accounts/AccountDataServiceImpl.cpp | 140 ++++++++++++ .../BigBank/Accounts/AccountDataServiceImpl.h | 61 +++++ ...untDataServiceImpl_AccountDataService_Proxy.cpp | 87 +++++++ ...countDataServiceImpl_AccountDataService_Proxy.h | 36 +++ ...tDataServiceImpl_AccountDataService_Wrapper.cpp | 86 +++++++ ...untDataServiceImpl_AccountDataService_Wrapper.h | 36 +++ .../sca/samples/BigBank/Accounts/AccountService.h | 58 +++++ .../samples/BigBank/Accounts/AccountService.wsdl | 97 ++++++++ .../Accounts/AccountServiceImpl.componenttype | 39 ++++ .../BigBank/Accounts/AccountServiceImpl.cpp | 186 +++++++++++++++ .../samples/BigBank/Accounts/AccountServiceImpl.h | 58 +++++ ...AccountServiceImpl_AccountDataService_Proxy.cpp | 87 +++++++ .../AccountServiceImpl_AccountDataService_Proxy.h | 40 ++++ .../AccountServiceImpl_AccountService_Proxy.cpp | 67 ++++++ .../AccountServiceImpl_AccountService_Proxy.h | 34 +++ .../AccountServiceImpl_AccountService_Wrapper.cpp | 73 ++++++ .../AccountServiceImpl_AccountService_Wrapper.h | 36 +++ .../AccountServiceImpl_stockQuote_Proxy.cpp | 67 ++++++ .../Accounts/AccountServiceImpl_stockQuote_Proxy.h | 34 +++ .../sca/samples/BigBank/Accounts/Accounts.dsp | 250 +++++++++++++++++++++ .../sca/samples/BigBank/Accounts/Accounts.plg | 43 ++++ .../BigBank/Accounts/StockQuoteExternalService.h | 24 ++ .../samples/BigBank/Accounts/StockQuoteService.h | 24 ++ .../BigBank/Accounts/StockQuoteService.wsdl | 68 ++++++ .../Accounts/StockQuoteServiceImpl.componentType | 32 +++ .../BigBank/Accounts/StockQuoteServiceImpl.cpp | 63 ++++++ .../BigBank/Accounts/StockQuoteServiceImpl.h | 25 +++ ...ckQuoteServiceImpl_StockQuoteExternal_Proxy.cpp | 67 ++++++ ...tockQuoteServiceImpl_StockQuoteExternal_Proxy.h | 34 +++ ...ockQuoteServiceImpl_StockQuoteService_Proxy.cpp | 67 ++++++ ...StockQuoteServiceImpl_StockQuoteService_Proxy.h | 34 +++ ...kQuoteServiceImpl_StockQuoteService_Wrapper.cpp | 74 ++++++ ...ockQuoteServiceImpl_StockQuoteService_Wrapper.h | 36 +++ .../sca/samples/BigBank/Accounts/sca.module | 53 +++++ .../sca/samples/BigBank/Accounts/sca.subsystem | 27 +++ .../sca/samples/BigBank/BigBank.dsw | 53 +++++ .../sca/samples/BigBank/BigBank.ncb | Bin 0 -> 230400 bytes .../BigBank/WSAccountClient/Tuscany-model.config | 24 ++ .../BigBank/WSAccountClient/WSAccountClient.cpp | 179 +++++++++++++++ .../BigBank/WSAccountClient/WSAccountClient.dsp | 109 +++++++++ .../BigBank/WSAccountClient/WSAccountClient.plg | 33 +++ .../BigBank/WSAccountClient/axis2_Account_stub.cpp | 106 +++++++++ .../BigBank/WSAccountClient/axis2_Account_stub.h | 66 ++++++ .../samples/BigBank/WSAccountClient/services.xml | 30 +++ .../sca/samples/BigBank/deploy.bat | 16 ++ 50 files changed, 3211 insertions(+) create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.dsp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.plg create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataService.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.wsdl create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.componenttype create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.dsp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.plg create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteExternalService.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.wsdl create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.componentType create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.module create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.subsystem create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.dsw create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.ncb create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/Tuscany-model.config create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.dsp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.plg create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.cpp create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.h create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/services.xml create mode 100644 tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/deploy.bat (limited to 'tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank') diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.cpp new file mode 100644 index 0000000000..004c02fd9e --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.cpp @@ -0,0 +1,130 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "..\Accounts\AccountService.h" +#include "osoa/sca/sca.h" +#include +#include + +using namespace osoa::sca; +using namespace std; +using namespace com::bigbank::account; +using namespace commonj::sdo; + +int main(int argc, char* argv[]) +{ + + if (argc != 2) + { + cout << "AccountClient.exe: Argument must be the name of the account" << endl; + return 0; + } + try + { + + // Locate a service + ModuleContext myContext = ModuleContext::getCurrent(); + AccountService *accountService = + (AccountService*) myContext.locateService("AccountServiceComponent"); + if (accountService == 0) + { + cout << "AccountClient.exe: Unable to find Account service" << endl; + } + else + { + try + { + // exercise the account service + + DataFactoryPtr mdg = DataFactory::getDataFactory(); + + XSDHelperPtr xsh = HelperProvider::getXSDHelper(mdg); + + xsh->defineFile("AccountService.wsdl"); + + DataObjectPtr in = mdg->create("http://www.bigbank.com/AccountService","cid"); + in->setCString("customerID",argv[1]); + + DataObjectPtr report = + accountService->getAccountReport(in); + + if (report != 0) + { + int i; + char balanceStr[20]; + float balance; + + cout << "My Account Report" << endl; + cout << "=================" << endl; + + DataObjectList& stocks = report->getList("stocks"); + + for (i=0;i< stocks.size() ;i++) + { + cout << "Stock Account " << stocks[i]->getCString("accountNumber") << endl; + cout << "Stock Symbol : " << stocks[i]->getCString("symbol") << endl; + cout << " Holding : " << stocks[i]->getCString("quantity") << endl; + balance = stocks[i]->getFloat("balance"); + sprintf(balanceStr,"%.2f",balance); + cout << " Value : " << balanceStr << endl << endl; + } + + DataObjectList& checking = report->getList("checking"); + + for (i=0;i< checking.size() ;i++) + { + cout << "Checking Account " << checking[i]->getCString("accountNumber") << endl; + balance = checking[i]->getFloat("balance"); + sprintf(balanceStr,"%.2f",balance); + cout << " Balance : " << balanceStr << endl << endl; + } + + DataObjectList& savings = report->getList("savings"); + + for (i=0;i< savings.size() ;i++) + { + cout << "Savings Account " << savings[i]->getCString("accountNumber") << endl; + balance = savings[i]->getFloat("balance"); + sprintf(balanceStr,"%.2f",balance); + cout << " Balance : " << balanceStr << endl << endl; + } + + cout << endl; + } + } + catch (SDORuntimeException& e) + { + cout << e << endl; + } + catch (char* x) + { + cout << "AccountService.exe: exception caught: " << x << endl; + } + } + + } + catch (ServiceRuntimeException& ex) + { + cout << ex << endl; + } + return 0; +} + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.dsp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.dsp new file mode 100644 index 0000000000..cf1c043ae2 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.dsp @@ -0,0 +1,102 @@ +# Microsoft Developer Studio Project File - Name="AccountClient" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=AccountClient - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "AccountClient.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "AccountClient.mak" CFG="AccountClient - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "AccountClient - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "AccountClient - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "AccountClient - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "AccountClient - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(TUSCANY_SDOCPP)/include" /I "$(TUSCANY_SCACPP)/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# SUBTRACT CPP /X +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib tuscany_sca.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Accounts" /libpath:"$(TUSCANY_SCACPP)/lib" /libpath:"$(TUSCANY_SDOCPP)/lib" + +!ENDIF + +# Begin Target + +# Name "AccountClient - Win32 Release" +# Name "AccountClient - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\AccountClient.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.plg b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.plg new file mode 100644 index 0000000000..c378b0a81b --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/AccountClient/AccountClient.plg @@ -0,0 +1,32 @@ + + +
+

Build Log

+

+--------------------Configuration: AccountClient - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3EF.tmp" with contents +[ +/nologo /MLd /W3 /Gm /GX /ZI /Od /I "c:\apache\apache_checkout\cpp\sdo\deploy/include" /I "c:\apache\apache_checkout\cpp\sca\deploy/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/AccountClient.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\apache\apache_checkout\cpp\sca\samples\BigBank\AccountClient\AccountClient.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3EF.tmp" +Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3F0.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib tuscany_sca.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/AccountClient.pdb" /debug /machine:I386 /out:"Debug/AccountClient.exe" /pdbtype:sept /libpath:"Accounts" /libpath:"c:\apache\apache_checkout\cpp\sca\deploy/lib" /libpath:"c:\apache\apache_checkout\cpp\sdo\deploy/lib" +.\Debug\AccountClient.obj +] +Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3F0.tmp" +

Output Window

+Compiling... +AccountClient.cpp +Linking... + + + +

Results

+AccountClient.exe - 0 error(s), 0 warning(s) +
+ + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataService.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataService.h new file mode 100644 index 0000000000..1603ed2ccb --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataService.h @@ -0,0 +1,62 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#include "commonj/sdo/SDO.h" + +namespace com +{ + namespace bigbank + { + namespace account + { + + /* + * AccountDataService C interface + */ + + class AccountDataService { + + public: + + // CheckingAccount is a data object containing + // String "accountNumber" + // float balance + + virtual commonj::sdo::DataObjectPtr /* CheckingAccount*/ getCheckingAccount( + const char *id) = 0; + + // SavingsAccount is a data object containing + // String accountNumber + // float balance + + virtual commonj::sdo::DataObjectPtr /* SavingsAccount */ getSavingsAccount( + const char *id) = 0; + + // StockAccount is a data object containing + // String accountNumber + // String symbol + // int quantity + + virtual commonj::sdo::DataObjectPtr /* StockAccount */ getStockAccount ( + const char* id) = 0; + + + }; + +} +} +} // namespace; diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType new file mode 100644 index 0000000000..740f9b01d6 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.componentType @@ -0,0 +1,26 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp new file mode 100644 index 0000000000..ec72b4d5b9 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp @@ -0,0 +1,140 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "commonj/sdo/SDO.h" + +#include "AccountDataServiceImpl.h" + +using namespace commonj::sdo; + +namespace com +{ + namespace bigbank + { + namespace account + { + + DataObjectPtr /* CheckingAccount*/ AccountDataServiceImpl::getCheckingAccount( + const char *id) + { + try { + + DataFactoryPtr factory = DataFactory::getDataFactory(); + + XSDHelperPtr helper = HelperProvider::getXSDHelper(factory); + + helper->defineFile("AccountService.wsdl"); + + DataObjectPtr newaccount = + factory->create("http://www.bigbank.com/AccountService","CheckingAccount"); + + char* name = new char[strlen(id) + 10]; + strcpy(name,id); + strcat(name,"_CHA12345"); + + newaccount->setCString("accountNumber",name); + + delete name; + + newaccount->setFloat("balance",1500.0f); + + return newaccount; + + } + catch (SDORuntimeException e) + { + return 0; + } + } + + + + DataObjectPtr /* SavingsAccount */ AccountDataServiceImpl::getSavingsAccount( + const char *id) + { + try { + + DataFactoryPtr factory = DataFactory::getDataFactory(); + + XSDHelperPtr helper = HelperProvider::getXSDHelper(factory); + + helper->defineFile("AccountService.wsdl"); + + DataObjectPtr newaccount = + factory->create("http://www.bigbank.com/AccountService","SavingsAccount"); + + char* name = new char[strlen(id) + 10]; + strcpy(name,id); + strcat(name,"_SAA12345"); + + newaccount->setCString("accountNumber",name); + + delete name; + + newaccount->setFloat("balance",1500.0f); + + return newaccount; + + } + catch (SDORuntimeException e) + { + return 0; + } + } + + + DataObjectPtr /* StockAccount */ AccountDataServiceImpl::getStockAccount ( + const char* id) + { + try { + + DataFactoryPtr factory = DataFactory::getDataFactory(); + + XSDHelperPtr helper = HelperProvider::getXSDHelper(factory); + + helper->defineFile("AccountService.wsdl"); + + DataObjectPtr newaccount = + factory->create("http://www.bigbank.com/AccountService","StockAccount"); + + char* name = new char[strlen(id) + 10]; + strcpy(name,id); + strcat(name,"_STA12345"); + + newaccount->setCString("accountNumber",name); + + delete name; + + newaccount->setCString("symbol","IBM"); + + newaccount->setInteger("quantity",100); + + return newaccount; + + } + catch (SDORuntimeException e) + { + return 0; + } + } + } + } +} \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.h new file mode 100644 index 0000000000..6423c58795 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl.h @@ -0,0 +1,61 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + + +#include "AccountDataService.h" + + +namespace com +{ + namespace bigbank + { + namespace account + { + + /* + * AccountDataService C interface + */ + + class AccountDataServiceImpl : public AccountDataService { + + public: + // CheckingAccount is a data object containing + // String "accountNumber" + // float balance + + virtual DataObjectPtr /* CheckingAccount*/ getCheckingAccount( + const char *id); + + // SavingsAccount is a data object containing + // String accountNumber + // float balance + + virtual DataObjectPtr /* SavingsAccount */ getSavingsAccount( + const char *id); + + // StockAccount is a data object containing + // String accountNumber + // String symbol + // int quantity + + virtual DataObjectPtr /* StockAccount */ getStockAccount ( + const char* id); + + }; + } + } +} diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.cpp new file mode 100644 index 0000000000..dbc1588881 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.cpp @@ -0,0 +1,87 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "AccountDataServiceImpl_AccountDataService_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + AccountDataServiceImpl_AccountDataService_Proxy* AccountDataServiceImpl_AccountDataService_Proxy_Factory(ServiceWrapper* target) + { + return new AccountDataServiceImpl_AccountDataService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void AccountDataServiceImpl_AccountDataService_Proxy_Destructor(void* proxy) + { + delete (AccountDataServiceImpl_AccountDataService_Proxy*)proxy; + } +} + +AccountDataServiceImpl_AccountDataService_Proxy::AccountDataServiceImpl_AccountDataService_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +AccountDataServiceImpl_AccountDataService_Proxy::~AccountDataServiceImpl_AccountDataService_Proxy() +{ + if (target) + delete target; +} + +commonj::sdo::DataObjectPtr AccountDataServiceImpl_AccountDataService_Proxy::getCheckingAccount(const char* arg0) +{ + Operation operation("getCheckingAccount"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + +commonj::sdo::DataObjectPtr AccountDataServiceImpl_AccountDataService_Proxy::getSavingsAccount(const char* arg0) +{ + Operation operation("getSavingsAccount"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + +commonj::sdo::DataObjectPtr AccountDataServiceImpl_AccountDataService_Proxy::getStockAccount(const char* arg0) +{ + Operation operation("getStockAccount"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.h new file mode 100644 index 0000000000..c86af7e128 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Proxy.h @@ -0,0 +1,36 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef AccountDataServiceImpl_AccountDataService_Proxy_h +#define AccountDataServiceImpl_AccountDataService_Proxy_h + +#include "AccountDataService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class AccountDataServiceImpl_AccountDataService_Proxy : public com::bigbank::account::AccountDataService +{ +public: + AccountDataServiceImpl_AccountDataService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~AccountDataServiceImpl_AccountDataService_Proxy(); + virtual commonj::sdo::DataObjectPtr getCheckingAccount(const char* id); + virtual commonj::sdo::DataObjectPtr getSavingsAccount(const char* id); + virtual commonj::sdo::DataObjectPtr getStockAccount(const char* id); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // AccountDataServiceImpl_AccountDataService_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.cpp new file mode 100644 index 0000000000..424ea7fdfb --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.cpp @@ -0,0 +1,86 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "AccountDataServiceImpl_AccountDataService_Wrapper.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + AccountDataServiceImpl_AccountDataService_Wrapper* AccountDataServiceImpl_AccountDataService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new AccountDataServiceImpl_AccountDataService_Wrapper(target); + } +} + +AccountDataServiceImpl_AccountDataService_Wrapper::AccountDataServiceImpl_AccountDataService_Wrapper(Service* target) : ComponentServiceWrapper(target) +{ + impl = (com::bigbank::account::AccountDataServiceImpl*)getImplementation(); +} + +AccountDataServiceImpl_AccountDataService_Wrapper::~AccountDataServiceImpl_AccountDataService_Wrapper() +{ + releaseImplementation(); +} + +void* AccountDataServiceImpl_AccountDataService_Wrapper::newImplementation() +{ + return new com::bigbank::account::AccountDataServiceImpl; +} + +void AccountDataServiceImpl_AccountDataService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void AccountDataServiceImpl_AccountDataService_Wrapper::invokeService(Operation& operation) +{ + const string& operationName = operation.getName(); + + if (operationName == "getCheckingAccount") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + *(commonj::sdo::DataObjectPtr*)operation.getReturnValue() = impl->getCheckingAccount(p0); + return; + } + if (operationName == "getSavingsAccount") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + *(commonj::sdo::DataObjectPtr*)operation.getReturnValue() = impl->getSavingsAccount(p0); + return; + } + if (operationName == "getStockAccount") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + *(commonj::sdo::DataObjectPtr*)operation.getReturnValue() = impl->getStockAccount(p0); + return; + } + + + throw ServiceRuntimeException("Invalid operation"); + +} + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.h new file mode 100644 index 0000000000..af43114af0 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountDataServiceImpl_AccountDataService_Wrapper.h @@ -0,0 +1,36 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef AccountDataServiceImpl_AccountDataService_Wrapper_h +#define AccountDataServiceImpl_AccountDataService_Wrapper_h + +#include "AccountDataServiceImpl.h" +#include "tuscany/sca/core/ComponentServiceWrapper.h" + +class AccountDataServiceImpl_AccountDataService_Wrapper : public tuscany::sca::ComponentServiceWrapper +{ +public: + AccountDataServiceImpl_AccountDataService_Wrapper(tuscany::sca::model::Service* target); + virtual ~AccountDataServiceImpl_AccountDataService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + com::bigbank::account::AccountDataServiceImpl* impl; +}; + +#endif // AccountDataServiceImpl_AccountDataService_Wrapper_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.h new file mode 100644 index 0000000000..eb1a585c52 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.h @@ -0,0 +1,58 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/** + * AccountService.h + * + */ + + +#include + + +namespace com +{ + namespace bigbank + { + namespace account + { + + /* + * AccountService C interface + */ + + class AccountService { + + public: + + //The account report data object has one many-valued + // property "accountSummaries". + // This had properties + // String accountNumber + // String accountType + // Float balance. + + virtual commonj::sdo::DataObjectPtr /*AccountReport*/ + getAccountReport(DataObjectPtr cid) = 0; + + + }; + + } + } +} // namespaces + \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.wsdl b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.wsdl new file mode 100644 index 0000000000..9362ab56c0 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountService.wsdl @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SCA Sample Application 16 November 2005 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.componenttype b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.componenttype new file mode 100644 index 0000000000..7ab7736069 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.componenttype @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp new file mode 100644 index 0000000000..c78b5963bf --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp @@ -0,0 +1,186 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "AccountServiceImpl.h" +#include "StockQuoteService.h" +#include "AccountDataService.h" + +#include "osoa/sca/sca.h" + +using namespace osoa::sca; + + +namespace com +{ + namespace bigbank + { + namespace account + { + + AccountServiceImpl::AccountServiceImpl() + { + initialized = false; + // Note - cannot use the component context within the constructor - need to move this + // code out to lazy init on first use. + + //ComponentContext myContext = ComponentContext::getCurrent(); + + //dataService = + // (AccountDataService*)myContext.getService("AccountDataService"); + + //stockService = + // (StockQuoteService*)myContext.getService("StockQuoteService"); + + } + + //void AccountServiceImpl::lazyGetDependencies() + //{ + // cant do this either - the context cannot be instantiated + // resolve the references on call only + + //theContext = ComponentContext::getCurrent(); + + //dataService = + // (AccountDataService*)theContext.getService("AccountDataService"); + + //stockService = + // (StockQuoteService*)theContext.getService("stockQuote"); + + //initialized = true; + //} + + AccountServiceImpl::~AccountServiceImpl() + { + } + + DataObjectPtr /*AccountReport**/ + AccountServiceImpl::getAccountReport(DataObjectPtr cid) + { + try { + + commonj::sdo::DataFactoryPtr factory = + commonj::sdo::DataFactory::getDataFactory(); + + commonj::sdo::XSDHelperPtr helper = + commonj::sdo::HelperProvider::getXSDHelper(factory); + + helper->defineFile("AccountService.wsdl"); + + const char* id = cid->getCString("customerID"); + + commonj::sdo::DataObjectPtr newReport = + factory->create("http://www.bigbank.com/AccountService","AccountReport"); + + ComponentContext theContext = ComponentContext::getCurrent(); + + com::bigbank::account::AccountDataService *dataService = + (com::bigbank::account::AccountDataService*)theContext.getService("AccountDataService"); + + if (dataService == 0) + { + std::cout << "No Account Data Service registered" << std::endl; + return newReport; + } + + // would be better to return a list of accounts - this only + // gets the first of each. + + commonj::sdo::DataObjectPtr checking = + dataService->getCheckingAccount(id); + + if (checking != 0) + { + commonj::sdo::DataObjectList& dl = newReport->getList("checking"); + checking->setFloat("balance", + fromUSDollarToCurrency(checking->getFloat("balance"))); + dl.append(checking); + } + + commonj::sdo::DataObjectPtr savings = dataService->getSavingsAccount(id); + + if (savings != 0) + { + commonj::sdo::DataObjectList& dl = newReport->getList("savings"); + savings->setFloat("balance", + fromUSDollarToCurrency(savings->getFloat("balance"))); + dl.append(savings); + } + + com::bigbank::stockquote::StockQuoteService* stockService = + (StockQuoteService*)theContext.getService("stockQuote"); + + if (stockService == 0) + { + std::cout << "No Stock Quote Data Service registered" << std::endl; + return newReport; + } + + commonj::sdo::DataObjectPtr stocks = dataService->getStockAccount(id); + + if (stocks != 0) + { + commonj::sdo::DataObjectList& dl = newReport->getList("stocks"); + + float value = 10.0f; + try { + value = stockService->getQuote( + stocks->getCString("symbol")); + } + catch (ServiceRuntimeException& e) + { + std::cout << "Fault from stock quote service" << e << std::endl; + } + stocks->setFloat("balance", + fromUSDollarToCurrency(stocks->getInteger("quantity") * + value)); + dl.append(stocks); + } + return newReport; + } + catch (SDORuntimeException& e) + { + std::cout << "Error from SDO: " << e << std::endl; + return 0; + } + } + + + float AccountServiceImpl::fromUSDollarToCurrency(float value) + { + // get the property "currency" + ComponentContext myContext = ComponentContext::getCurrent(); + + commonj::sdo::DataObjectInstance properties = myContext.getProperties(); + if (properties) + { + const char* currency = properties->getCString("currency"); + if (currency != 0) + { + std::cout << "Currency is : " << currency << std::endl; + if (!strcmp(currency,"USD")) return value; + if (!strcmp(currency,"EURO")) return 0.8f * value; + } + } + return 0.0f; + } + } + } +} // namespaces diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.h new file mode 100644 index 0000000000..1e506f1ed1 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl.h @@ -0,0 +1,58 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#include "AccountService.h" + + +namespace com +{ + namespace bigbank + { + namespace account + { + +class AccountServiceImpl: public AccountService + { + + public: + + + AccountServiceImpl(); + virtual ~AccountServiceImpl(); + + // public API + + virtual DataObjectPtr /*AccountReport*/ + getAccountReport(DataObjectPtr cid); + + + //virtual void lazyGetDependencies(); + +private: + + + float fromUSDollarToCurrency(float value); + + bool initialized; + +}; + +} +} +} // namespaces + +using namespace com::bigbank::account; diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.cpp new file mode 100644 index 0000000000..a0441b213a --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.cpp @@ -0,0 +1,87 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "AccountServiceImpl_AccountDataService_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + AccountServiceImpl_AccountDataService_Proxy* AccountServiceImpl_AccountDataService_Proxy_Factory(ServiceWrapper* target) + { + return new AccountServiceImpl_AccountDataService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void AccountServiceImpl_AccountDataService_Proxy_Destructor(void* proxy) + { + delete (AccountServiceImpl_AccountDataService_Proxy*)proxy; + } +} + +AccountServiceImpl_AccountDataService_Proxy::AccountServiceImpl_AccountDataService_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +AccountServiceImpl_AccountDataService_Proxy::~AccountServiceImpl_AccountDataService_Proxy() +{ + if (target) + delete target; +} + +commonj::sdo::DataObjectPtr AccountServiceImpl_AccountDataService_Proxy::getCheckingAccount(const char* arg0) +{ + Operation operation("getCheckingAccount"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + +commonj::sdo::DataObjectPtr AccountServiceImpl_AccountDataService_Proxy::getSavingsAccount(const char* arg0) +{ + Operation operation("getSavingsAccount"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + +commonj::sdo::DataObjectPtr AccountServiceImpl_AccountDataService_Proxy::getStockAccount(const char* arg0) +{ + Operation operation("getStockAccount"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.h new file mode 100644 index 0000000000..ff5c6e6d87 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountDataService_Proxy.h @@ -0,0 +1,40 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#ifndef AccountServiceImpl_AccountDataService_Proxy_h +#define AccountServiceImpl_AccountDataService_Proxy_h + +#include "AccountDataService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class AccountServiceImpl_AccountDataService_Proxy : public com::bigbank::account::AccountDataService +{ +public: + AccountServiceImpl_AccountDataService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~AccountServiceImpl_AccountDataService_Proxy(); + virtual commonj::sdo::DataObjectPtr getCheckingAccount(const char* id); + virtual commonj::sdo::DataObjectPtr getSavingsAccount(const char* id); + virtual commonj::sdo::DataObjectPtr getStockAccount(const char* id); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // AccountServiceImpl_AccountDataService_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.cpp new file mode 100644 index 0000000000..1684266b3e --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.cpp @@ -0,0 +1,67 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "AccountServiceImpl_AccountService_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + AccountServiceImpl_AccountService_Proxy* AccountServiceImpl_AccountService_Proxy_Factory(ServiceWrapper* target) + { + return new AccountServiceImpl_AccountService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void AccountServiceImpl_AccountService_Proxy_Destructor(void* proxy) + { + delete (AccountServiceImpl_AccountService_Proxy*)proxy; + } +} + +AccountServiceImpl_AccountService_Proxy::AccountServiceImpl_AccountService_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +AccountServiceImpl_AccountService_Proxy::~AccountServiceImpl_AccountService_Proxy() +{ + if (target) + delete target; +} + +commonj::sdo::DataObjectPtr AccountServiceImpl_AccountService_Proxy::getAccountReport( DataObjectPtr arg0) +{ + Operation operation("getAccountReport"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.h new file mode 100644 index 0000000000..3b5df16198 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Proxy.h @@ -0,0 +1,34 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef AccountServiceImpl_AccountService_Proxy_h +#define AccountServiceImpl_AccountService_Proxy_h + +#include "AccountService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class AccountServiceImpl_AccountService_Proxy : public com::bigbank::account::AccountService +{ +public: + AccountServiceImpl_AccountService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~AccountServiceImpl_AccountService_Proxy(); + virtual commonj::sdo::DataObjectPtr getAccountReport( DataObjectPtr cid); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // AccountServiceImpl_AccountService_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.cpp new file mode 100644 index 0000000000..1b97e5c4d0 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.cpp @@ -0,0 +1,73 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "AccountServiceImpl_AccountService_Wrapper.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + AccountServiceImpl_AccountService_Wrapper* AccountServiceImpl_AccountService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new AccountServiceImpl_AccountService_Wrapper(target); + } +} + +AccountServiceImpl_AccountService_Wrapper::AccountServiceImpl_AccountService_Wrapper(Service* target) : ComponentServiceWrapper(target) +{ + impl = (AccountServiceImpl*)getImplementation(); +} + +AccountServiceImpl_AccountService_Wrapper::~AccountServiceImpl_AccountService_Wrapper() +{ + releaseImplementation(); +} + +void* AccountServiceImpl_AccountService_Wrapper::newImplementation() +{ + return new AccountServiceImpl; +} + +void AccountServiceImpl_AccountService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void AccountServiceImpl_AccountService_Wrapper::invokeService(Operation& operation) +{ + const string& operationName = operation.getName(); + + if (operationName == "getAccountReport") + { + DataObjectPtr& p0 = *(DataObjectPtr*)operation.getParameterValue(0); *(commonj::sdo::DataObjectPtr*)operation.getReturnValue() = impl->getAccountReport(p0); + return; + } + + + throw ServiceRuntimeException("Invalid operation"); + +} + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.h new file mode 100644 index 0000000000..9dce3fd05d --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_AccountService_Wrapper.h @@ -0,0 +1,36 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef AccountServiceImpl_AccountService_Wrapper_h +#define AccountServiceImpl_AccountService_Wrapper_h + +#include "AccountServiceImpl.h" +#include "tuscany/sca/core/ComponentServiceWrapper.h" + +class AccountServiceImpl_AccountService_Wrapper : public tuscany::sca::ComponentServiceWrapper +{ +public: + AccountServiceImpl_AccountService_Wrapper(tuscany::sca::model::Service* target); + virtual ~AccountServiceImpl_AccountService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + AccountServiceImpl* impl; +}; + +#endif // AccountServiceImpl_AccountService_Wrapper_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.cpp new file mode 100644 index 0000000000..be1b432353 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.cpp @@ -0,0 +1,67 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "AccountServiceImpl_stockQuote_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + AccountServiceImpl_stockQuote_Proxy* AccountServiceImpl_stockQuote_Proxy_Factory(ServiceWrapper* target) + { + return new AccountServiceImpl_stockQuote_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void AccountServiceImpl_stockQuote_Proxy_Destructor(void* proxy) + { + delete (AccountServiceImpl_stockQuote_Proxy*)proxy; + } +} + +AccountServiceImpl_stockQuote_Proxy::AccountServiceImpl_stockQuote_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +AccountServiceImpl_stockQuote_Proxy::~AccountServiceImpl_stockQuote_Proxy() +{ + if (target) + delete target; +} + +float AccountServiceImpl_stockQuote_Proxy::getQuote(const char* arg0) +{ + Operation operation("getQuote"); + operation.addParameter(&arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.h new file mode 100644 index 0000000000..d63d507bf4 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/AccountServiceImpl_stockQuote_Proxy.h @@ -0,0 +1,34 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef AccountServiceImpl_stockQuote_Proxy_h +#define AccountServiceImpl_stockQuote_Proxy_h + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class AccountServiceImpl_stockQuote_Proxy : public com::bigbank::stockquote::StockQuoteService +{ +public: + AccountServiceImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~AccountServiceImpl_stockQuote_Proxy(); + virtual float getQuote(const char* symbol); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // AccountServiceImpl_stockQuote_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.dsp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.dsp new file mode 100644 index 0000000000..52c450a2bd --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.dsp @@ -0,0 +1,250 @@ +# Microsoft Developer Studio Project File - Name="Accounts" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=Accounts - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Accounts.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Accounts.mak" CFG="Accounts - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Accounts - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Accounts - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Accounts - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACCOUNTS_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACCOUNTS_EXPORTS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 + +!ELSEIF "$(CFG)" == "Accounts - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACCOUNTS_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(TUSCANY_SCACPP)\include" /I "$(TUSCANY_SDOCPP)\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACCOUNTS_EXPORTS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sca.lib tuscany_sdo.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"$(TUSCANY_SCACPP)/lib" /libpath:"$(TUSCANY_SDOCPP)/lib" + +!ENDIF + +# Begin Target + +# Name "Accounts - Win32 Release" +# Name "Accounts - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\AccountDataServiceImpl.cpp +# End Source File +# Begin Source File + +SOURCE=.\AccountDataServiceImpl_AccountDataService_Proxy.cpp +# End Source File +# Begin Source File + +SOURCE=.\AccountDataServiceImpl_AccountDataService_Wrapper.cpp +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl.cpp +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_AccountDataService_Proxy.cpp +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_AccountDataService_Proxy.h +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_AccountService_Proxy.cpp +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_AccountService_Wrapper.cpp +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_stockQuote_Proxy.cpp +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl.cpp +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl_StockQuoteExternal_Proxy.cpp +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl_StockQuoteService_Proxy.cpp +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\AccountDataService.h +# End Source File +# Begin Source File + +SOURCE=.\AccountDataServiceImpl.h +# End Source File +# Begin Source File + +SOURCE=.\AccountDataServiceImpl_AccountDataService_Proxy.h +# End Source File +# Begin Source File + +SOURCE=.\AccountDataServiceImpl_AccountDataService_Wrapper.h +# End Source File +# Begin Source File + +SOURCE=.\AccountService.h +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl.h +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_AccountService_Proxy.h +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_AccountService_Wrapper.h +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl_stockQuote_Proxy.h +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteExternalService.h +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteService.h +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl.h +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl_StockQuoteExternal_Proxy.h +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl_StockQuoteService_Proxy.h +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl_StockQuoteService_Wrapper.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=..\WSAccountClient\services.xml +# End Source File +# Begin Source File + +SOURCE="..\WSAccountClient\Tuscany-model.config" +# End Source File +# End Group +# Begin Source File + +SOURCE=.\AccountDataServiceImpl.componentType +# End Source File +# Begin Source File + +SOURCE=.\AccountService.wsdl +# End Source File +# Begin Source File + +SOURCE=.\AccountServiceImpl.componenttype +# End Source File +# Begin Source File + +SOURCE=.\sca.module +# End Source File +# Begin Source File + +SOURCE=.\sca.subsystem +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteService.wsdl +# End Source File +# Begin Source File + +SOURCE=.\StockQuoteServiceImpl.componentType +# End Source File +# End Target +# End Project diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.plg b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.plg new file mode 100644 index 0000000000..f8ecb502c6 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/Accounts.plg @@ -0,0 +1,43 @@ + + +
+

Build Log

+

+--------------------Configuration: Accounts - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3F3.tmp" with contents +[ +/nologo /MDd /W3 /Gm /GX /ZI /Od /I "c:\apache\apache_checkout\cpp\sca\deploy\include" /I "c:\apache\apache_checkout\cpp\sdo\deploy\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACCOUNTS_EXPORTS" /Fp"Debug/Accounts.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\apache\apache_checkout\cpp\sca\samples\BigBank\Accounts\AccountDataServiceImpl.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3F3.tmp" +Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3F4.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sca.lib tuscany_sdo.lib /nologo /dll /incremental:yes /pdb:"Debug/Accounts.pdb" /debug /machine:I386 /out:"Debug/Accounts.dll" /implib:"Debug/Accounts.lib" /pdbtype:sept /libpath:"c:\apache\apache_checkout\cpp\sca\deploy/lib" /libpath:"c:\apache\apache_checkout\cpp\sdo\deploy/lib" +.\Debug\AccountDataServiceImpl.obj +.\Debug\AccountDataServiceImpl_AccountDataService_Proxy.obj +.\Debug\AccountDataServiceImpl_AccountDataService_Wrapper.obj +.\Debug\AccountServiceImpl.obj +.\Debug\AccountServiceImpl_AccountDataService_Proxy.obj +.\Debug\AccountServiceImpl_AccountService_Proxy.obj +.\Debug\AccountServiceImpl_AccountService_Wrapper.obj +.\Debug\AccountServiceImpl_stockQuote_Proxy.obj +.\Debug\StockQuoteServiceImpl.obj +.\Debug\StockQuoteServiceImpl_StockQuoteExternal_Proxy.obj +.\Debug\StockQuoteServiceImpl_StockQuoteService_Proxy.obj +.\Debug\StockQuoteServiceImpl_StockQuoteService_Wrapper.obj +] +Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3F4.tmp" +

Output Window

+Compiling... +AccountDataServiceImpl.cpp +Linking... + + + +

Results

+Accounts.dll - 0 error(s), 0 warning(s) +
+ + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteExternalService.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteExternalService.h new file mode 100644 index 0000000000..d8df90651d --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteExternalService.h @@ -0,0 +1,24 @@ +#include "commonj/sdo/SDO.h" +using namespace commonj::sdo; + + +namespace com +{ + namespace bigbank + { + namespace stockquote + { + + /* + * AccountsService C interface + */ + + class StockQuoteExternalService { + public: + virtual const char* GetQuote(const char* symbol) = 0; + + }; + + } + } +} // namespace; diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.h new file mode 100644 index 0000000000..cd61d4c4d2 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.h @@ -0,0 +1,24 @@ + + +namespace com +{ + namespace bigbank + { + namespace stockquote + { + + /* + * AccountsService C interface + */ + + class StockQuoteService { + public: + virtual float getQuote(const char* symbol) = 0; + + }; + + } + } +} // namespace; + +using namespace com::bigbank::stockquote; diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.wsdl b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.wsdl new file mode 100644 index 0000000000..ba6caff22c --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteService.wsdl @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.componentType b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.componentType new file mode 100644 index 0000000000..92e46f2638 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.componentType @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.cpp new file mode 100644 index 0000000000..8ce6d410c2 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.cpp @@ -0,0 +1,63 @@ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "StockQuoteServiceImpl.h" +#include "StockQuoteExternalService.h" + +#include "osoa/sca/sca.h" +#include "commonj/sdo/SDO.h" + +using namespace osoa::sca; +using namespace commonj::sdo; + +namespace com{ + namespace bigbank{ + namespace stockquote { + + + float StockQuoteServiceImpl::getQuote(const char *symbol) + { + ComponentContext myContext = ComponentContext::getCurrent(); + + // Use an SCA reference to get the stock price + StockQuoteExternalService* stockQuoteExternalService = + (StockQuoteExternalService*)myContext. + getService("StockQuoteExternal"); + + if (stockQuoteExternalService == 0) + { + std::cout << "unable to find external stock quote service" << std::endl; + return 0.1f; + } + + // Create a data object representing the requests (use dynamic API until static is available) + DataObjectPtr requestDO; + + // Invoke the service + const char* result = stockQuoteExternalService->GetQuote(symbol); + + //std::cout << result<< std::endl; + + float stockPrice = 0.0f; + + try + { + XMLHelperPtr xmlHelper = HelperProvider::getXMLHelper(myContext.getDataFactory()); + XMLDocumentPtr stockDoc = xmlHelper->load(result); + if (stockDoc->getRootDataObject()) + { + stockPrice=stockDoc->getRootDataObject()->getFloat("Stock.0/Last"); + } + } + catch (SDORuntimeException e) + { + std::cout << e << std::endl; + return 0.0f; + } + return stockPrice; + } + } + } +} \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.h new file mode 100644 index 0000000000..7611984e4e --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl.h @@ -0,0 +1,25 @@ + +#include "StockQuoteService.h" + + +namespace com +{ + namespace bigbank + { + namespace stockquote + { + + /* + * AccountsService C interface + */ + + class StockQuoteServiceImpl : public StockQuoteService { + public: + virtual float getQuote(const char* symbol); + + }; + + +} +} +} // namespace; diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.cpp new file mode 100644 index 0000000000..b618dd4a33 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.cpp @@ -0,0 +1,67 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "StockQuoteServiceImpl_StockQuoteExternal_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + StockQuoteServiceImpl_StockQuoteExternal_Proxy* StockQuoteServiceImpl_StockQuoteExternal_Proxy_Factory(ServiceWrapper* target) + { + return new StockQuoteServiceImpl_StockQuoteExternal_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void StockQuoteServiceImpl_StockQuoteExternal_Proxy_Destructor(void* proxy) + { + delete (StockQuoteServiceImpl_StockQuoteExternal_Proxy*)proxy; + } +} + +StockQuoteServiceImpl_StockQuoteExternal_Proxy::StockQuoteServiceImpl_StockQuoteExternal_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +StockQuoteServiceImpl_StockQuoteExternal_Proxy::~StockQuoteServiceImpl_StockQuoteExternal_Proxy() +{ + if (target) + delete target; +} + +const char* StockQuoteServiceImpl_StockQuoteExternal_Proxy::GetQuote(const char* arg0) +{ + Operation operation("GetQuote"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.h new file mode 100644 index 0000000000..45469174ce --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteExternal_Proxy.h @@ -0,0 +1,34 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef StockQuoteServiceImpl_StockQuoteExternal_Proxy_h +#define StockQuoteServiceImpl_StockQuoteExternal_Proxy_h + +#include "StockQuoteExternalService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class StockQuoteServiceImpl_StockQuoteExternal_Proxy : public com::bigbank::stockquote::StockQuoteExternalService +{ +public: + StockQuoteServiceImpl_StockQuoteExternal_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~StockQuoteServiceImpl_StockQuoteExternal_Proxy(); + virtual const char* GetQuote(const char* symbol); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // StockQuoteServiceImpl_StockQuoteExternal_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.cpp new file mode 100644 index 0000000000..43dabb5307 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.cpp @@ -0,0 +1,67 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "StockQuoteServiceImpl_StockQuoteService_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + StockQuoteServiceImpl_StockQuoteService_Proxy* StockQuoteServiceImpl_StockQuoteService_Proxy_Factory(ServiceWrapper* target) + { + return new StockQuoteServiceImpl_StockQuoteService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void StockQuoteServiceImpl_StockQuoteService_Proxy_Destructor(void* proxy) + { + delete (StockQuoteServiceImpl_StockQuoteService_Proxy*)proxy; + } +} + +StockQuoteServiceImpl_StockQuoteService_Proxy::StockQuoteServiceImpl_StockQuoteService_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +StockQuoteServiceImpl_StockQuoteService_Proxy::~StockQuoteServiceImpl_StockQuoteService_Proxy() +{ + if (target) + delete target; +} + +float StockQuoteServiceImpl_StockQuoteService_Proxy::getQuote(const char* arg0) +{ + Operation operation("getQuote"); + operation.addParameter(&arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.h new file mode 100644 index 0000000000..e1b0ad1807 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Proxy.h @@ -0,0 +1,34 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef StockQuoteServiceImpl_StockQuoteService_Proxy_h +#define StockQuoteServiceImpl_StockQuoteService_Proxy_h + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class StockQuoteServiceImpl_StockQuoteService_Proxy : public com::bigbank::stockquote::StockQuoteService +{ +public: + StockQuoteServiceImpl_StockQuoteService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~StockQuoteServiceImpl_StockQuoteService_Proxy(); + virtual float getQuote(const char* symbol); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // StockQuoteServiceImpl_StockQuoteService_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp new file mode 100644 index 0000000000..00ac26c784 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp @@ -0,0 +1,74 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "StockQuoteServiceImpl_StockQuoteService_Wrapper.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + StockQuoteServiceImpl_StockQuoteService_Wrapper* StockQuoteServiceImpl_StockQuoteService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new StockQuoteServiceImpl_StockQuoteService_Wrapper(target); + } +} + +StockQuoteServiceImpl_StockQuoteService_Wrapper::StockQuoteServiceImpl_StockQuoteService_Wrapper(Service* target) : ComponentServiceWrapper(target) +{ + impl = (StockQuoteServiceImpl*)getImplementation(); +} + +StockQuoteServiceImpl_StockQuoteService_Wrapper::~StockQuoteServiceImpl_StockQuoteService_Wrapper() +{ + releaseImplementation(); +} + +void* StockQuoteServiceImpl_StockQuoteService_Wrapper::newImplementation() +{ + return new StockQuoteServiceImpl; +} + +void StockQuoteServiceImpl_StockQuoteService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void StockQuoteServiceImpl_StockQuoteService_Wrapper::invokeService(Operation& operation) +{ + const string& operationName = operation.getName(); + + if (operationName == "getQuote") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + *(float*)operation.getReturnValue() = impl->getQuote(p0); + return; + } + + + throw ServiceRuntimeException("Invalid operation"); + +} + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.h new file mode 100644 index 0000000000..a6d8580e5e --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/StockQuoteServiceImpl_StockQuoteService_Wrapper.h @@ -0,0 +1,36 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +#ifndef StockQuoteServiceImpl_StockQuoteService_Wrapper_h +#define StockQuoteServiceImpl_StockQuoteService_Wrapper_h + +#include "StockQuoteServiceImpl.h" +#include "tuscany/sca/core/ComponentServiceWrapper.h" + +class StockQuoteServiceImpl_StockQuoteService_Wrapper : public tuscany::sca::ComponentServiceWrapper +{ +public: + StockQuoteServiceImpl_StockQuoteService_Wrapper(tuscany::sca::model::Service* target); + virtual ~StockQuoteServiceImpl_StockQuoteService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + StockQuoteServiceImpl* impl; +}; + +#endif // StockQuoteServiceImpl_StockQuoteService_Wrapper_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.module b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.module new file mode 100644 index 0000000000..8560a3cb72 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.module @@ -0,0 +1,53 @@ + + + + + + + + AccountDataServiceComponent + StockQuoteServiceComponent + + + EURO + + + + + + + + + + + StockQuoteExternalService + + + + + + + + + + + + AccountServiceComponent + + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.subsystem b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.subsystem new file mode 100644 index 0000000000..faaa828bf9 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/Accounts/sca.subsystem @@ -0,0 +1,27 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.dsw b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.dsw new file mode 100644 index 0000000000..42d7f5a82e --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.dsw @@ -0,0 +1,53 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "AccountClient"=.\AccountClient\AccountClient.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "Accounts"=.\Accounts\Accounts.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "WSAccountClient"=.\WSAccountClient\WSAccountClient.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.ncb b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.ncb new file mode 100644 index 0000000000..8b4beb8420 Binary files /dev/null and b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/BigBank.ncb differ diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/Tuscany-model.config b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/Tuscany-model.config new file mode 100644 index 0000000000..41a4ec3ebb --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/Tuscany-model.config @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.cpp new file mode 100644 index 0000000000..f794dc6112 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.cpp @@ -0,0 +1,179 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed 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. + */ + +#include "axis2_Account_stub.h" +#include +#include +#include +#include +#include + +axiom_node_t * +build_om_programatically(const axis2_env_t *env, + const axis2_char_t *operation, + const axis2_char_t *param1 + ); + +int main(int argc, char** argv) +{ + axis2_stub_t *stub = NULL; + axiom_node_t *node = NULL; + axis2_status_t status = AXIS2_FAILURE; + const axis2_env_t *env = NULL; + const axis2_char_t *address = NULL; + const axis2_char_t *client_home = NULL; + axiom_node_t *ret_node = NULL; + + const axis2_char_t *operation = "getAccountReport"; + const axis2_char_t *param1 = "ED"; + + env = axis2_env_create_all( "Account_blocking.log", AXIS2_LOG_LEVEL_TRACE); + + client_home = AXIS2_GETENV("AXIS2C_HOME"); + if (!client_home) + client_home = "../../deploy"; + + address = "http://localhost:9090/axis2/services/Account"; + if (argc > 1 ) + operation = argv[1]; + if (AXIS2_STRCMP(operation, "-h") == 0) + { + printf("Usage : %s [operation] [param1] [endpoint_url]\n", argv[0]); + printf("use -h for help\n"); + printf("default operation add\n"); + printf("default param1 %s\n", param1); + printf("default endpoint_url %s\n", address); + printf("NOTE: command line arguments must appear in given order, with trailing ones being optional\n"); + return 0; + } + if (argc > 2 ) + param1 = argv[2]; + if (argc > 3 ) + address = argv[3]; + + printf ("Using endpoint : %s\n", address); + printf ("\nInvoking operation %s with param %s \n", operation, param1); + + node = build_om_programatically(env, operation, param1); + stub = + axis2_Account_stub_create_with_endpoint_uri_and_client_home(env, address, client_home); + /* create node and invoke Calculator */ + ret_node = axis2_Account_stub_getAccountReport(stub, env, node); + if(ret_node) + { + axis2_char_t *om_str = NULL; + om_str = AXIOM_NODE_TO_STRING(ret_node, env); + if(om_str) + { + printf("\nOM returned = %s\n", om_str); + } + + //if (AXIOM_NODE_GET_NODE_TYPE(ret_node, env) == AXIOM_ELEMENT) + //{ + // axis2_char_t *result = NULL; + // axiom_node_t *result_node = (axiom_node_t*)AXIOM_NODE_GET_FIRST_CHILD(ret_node, env); + // axiom_element_t *data_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(result_node, env); + + // result = AXIOM_ELEMENT_GET_TEXT(data_ele, env, result_node); + // printf( "\nResult = %s\n", result); + //} + //else + //{ + // axiom_xml_writer_t *writer = NULL; + // axiom_output_t *om_output = NULL; + // axis2_char_t *buffer = NULL; + // writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, + // AXIS2_XML_PARSER_TYPE_BUFFER); + // om_output = axiom_output_create (env, writer); + + // AXIOM_NODE_SERIALIZE (ret_node, env, om_output); + // buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(writer, env); + // printf ("\nReceived invalid OM as result : %s\n", buffer); + // if(NULL != buffer) + // { + // AXIS2_FREE(env->allocator, buffer); + // buffer = NULL; + // } + // if(NULL != om_output) + // { + // AXIOM_OUTPUT_FREE(om_output, env); + // om_output = NULL; + // } + //} + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:" + " %d :: %s", env->error->error_number, + AXIS2_ERROR_GET_MESSAGE(env->error)); + printf("Account stub invoke FAILED!\n"); + } + if (stub) + { + AXIS2_STUB_FREE(stub, env); + } + return status; +} + +axiom_node_t * +build_om_programatically(const axis2_env_t *env, + const axis2_char_t *operation, + const axis2_char_t *param1 + ) +{ + axiom_node_t *Account_om_node = NULL; + axiom_element_t* Account_om_ele = NULL; + axiom_node_t* text_om_node = NULL; + axiom_element_t * text_om_ele = NULL; + axiom_node_t* first_om_node = NULL; + axiom_element_t * first_om_ele = NULL; + axiom_namespace_t *ns1 = NULL; + + + axiom_xml_writer_t *xml_writer = NULL; + axiom_output_t *om_output = NULL; + axis2_char_t *buffer = NULL; + + ns1 = axiom_namespace_create (env, "http://www.bigbank.com/AccountService", "ns1"); + + Account_om_ele = axiom_element_create(env, NULL, operation, ns1, &Account_om_node); + + first_om_ele = axiom_element_create(env, Account_om_node, "customerID", NULL, &first_om_node); + + text_om_ele = axiom_element_create(env, first_om_node, "customerID", NULL, &text_om_node); + + AXIOM_ELEMENT_SET_TEXT(text_om_ele, env, param1, text_om_node); + + xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE, + AXIS2_XML_PARSER_TYPE_BUFFER); + om_output = axiom_output_create( env, xml_writer); + + AXIOM_NODE_SERIALIZE(Account_om_node, env, om_output); + buffer = (axis2_char_t*)AXIOM_XML_WRITER_GET_XML(xml_writer, env); + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "\nSending OM node in XML : %s \n", buffer); + if(NULL != buffer) + { + AXIS2_FREE(env->allocator, buffer); + buffer = NULL; + } + if(NULL != om_output) + { + AXIOM_OUTPUT_FREE(om_output, env); + om_output = NULL; + } + + return Account_om_node; +} diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.dsp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.dsp new file mode 100644 index 0000000000..db382db6ff --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.dsp @@ -0,0 +1,109 @@ +# Microsoft Developer Studio Project File - Name="WSAccountClient" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=WSAccountClient - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "WSAccountClient.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "WSAccountClient.mak" CFG="WSAccountClient - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "WSAccountClient - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "WSAccountClient - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "WSAccountClient - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "WSAccountClient - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(TUSCANY_SDOCPP)/include" /I "$(AXIS2C_HOME)/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sca.lib tuscany_sdo.lib axis2_engine.lib axis2_parser.lib axis2_util.lib axiom.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"$(TUSCANY_SCACPP)\lib" /libpath:"$(TUSCANY_SDOCPP)\lib" /libpath:"$(AXIS2C_HOME)\lib" + +!ENDIF + +# Begin Target + +# Name "WSAccountClient - Win32 Release" +# Name "WSAccountClient - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\axis2_Account_stub.cpp +# End Source File +# Begin Source File + +SOURCE=.\WSAccountClient.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\axis2_Account_stub.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.plg b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.plg new file mode 100644 index 0000000000..5200a14ce6 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/WSAccountClient.plg @@ -0,0 +1,33 @@ + + +
+

Build Log

+

+--------------------Configuration: WSAccountClient - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3FB.tmp" with contents +[ +/nologo /MLd /W3 /Gm /GX /ZI /Od /I "c:\apache\apache_checkout\cpp\sdo\deploy/include" /I "c:\axis\axis2c_92\axis2c-bin-0.92-win32/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/WSAccountClient.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\apache\apache_checkout\cpp\sca\samples\BigBank\WSAccountClient\WSAccountClient.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3FB.tmp" +Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3FC.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sca.lib tuscany_sdo.lib axis2_engine.lib axis2_parser.lib axis2_util.lib axiom.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/WSAccountClient.pdb" /debug /machine:I386 /out:"Debug/WSAccountClient.exe" /pdbtype:sept /libpath:"c:\apache\apache_checkout\cpp\sca\deploy\lib" /libpath:"c:\apache\apache_checkout\cpp\sdo\deploy\lib" /libpath:"c:\axis\axis2c_92\axis2c-bin-0.92-win32\lib" +.\Debug\axis2_Account_stub.obj +.\Debug\WSAccountClient.obj +] +Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP3FC.tmp" +

Output Window

+Compiling... +WSAccountClient.cpp +Linking... + + + +

Results

+WSAccountClient.exe - 0 error(s), 0 warning(s) +
+ + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.cpp new file mode 100644 index 0000000000..d9198b29ec --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.cpp @@ -0,0 +1,106 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed 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. + */ + +#include "axis2_Account_stub.h" + + +axis2_stub_t * +axis2_Account_stub_create_with_endpoint_ref_and_client_home(const axis2_env_t *env, + axis2_endpoint_ref_t *endpoint_ref, + axis2_char_t *client_home) +{ + axis2_stub_t *stub = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + stub = (axis2_stub_t *) + axis2_stub_create_with_endpoint_ref_and_client_home(env, endpoint_ref, + client_home); + if(NULL == stub) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_NO_MEMORY, (axis2_status_codes)AXIS2_FAILURE); + return NULL; + } + axis2_populate_axis_service( stub, env); + return stub; +} + +void axis2_populate_axis_service( axis2_stub_t* stub, const axis2_env_t *env) +{ + axis2_svc_client_t* svc_client = NULL; + axis2_qname_t *op_qname = NULL; + axis2_svc_t* svc = NULL; + axis2_op_t* op = NULL; + + /*Modifying the Service*/ + svc_client = AXIS2_STUB_GET_SVC_CLIENT (stub, env ); + svc = (axis2_svc_t*)AXIS2_SVC_CLIENT_GET_AXIS_SERVICE ( svc_client, env ); + + /*creating the operations*/ + + op_qname = axis2_qname_create(env,"getAccountReport" , "", NULL); + op = axis2_op_create_with_qname(env, op_qname); + AXIS2_OP_SET_MSG_EXCHANGE_PATTERN(op, env, AXIS2_MEP_URI_OUT_IN); + AXIS2_SVC_ADD_OP(svc, env, op); + + } + +axis2_stub_t * +axis2_Account_stub_create_with_endpoint_uri_and_client_home(const axis2_env_t *env, + const axis2_char_t *endpoint_uri, + const axis2_char_t *client_home) +{ + axis2_stub_t *stub = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + stub = (axis2_stub_t *) + axis2_stub_create_with_endpoint_uri_and_client_home(env, endpoint_uri, + client_home); + if(NULL == stub) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_NO_MEMORY, (axis2_status_codes)AXIS2_FAILURE); + return NULL; + } + + axis2_populate_axis_service( stub, env); + + return stub; +} + +/***************************Function implementation****************************/ + +axiom_node_t * +axis2_Account_stub_getAccountReport(axis2_stub_t *stub, + const axis2_env_t *env, + axiom_node_t *node) +{ + axis2_svc_client_t *svc_client = NULL; + axiom_node_t *ret_node = NULL; + axis2_qname_t *op_qname = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + svc_client = AXIS2_STUB_GET_SVC_CLIENT(stub, env); + op_qname = axis2_qname_create(env, "getAccountReport" , "", NULL); + ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE_WITH_OP_QNAME( svc_client, env, op_qname, node); + + return ret_node; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.h new file mode 100644 index 0000000000..53f07263b8 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/axis2_Account_stub.h @@ -0,0 +1,66 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed 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. + */ + +#ifndef AXIS2_ECHO_STUB_H +#define AXIS2_ECHO_STUB_H + +/** + * @file axis2_Calculator_stub.h + * @brief axis2 Calculator stub interface + */ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +axiom_node_t * +axis2_Account_stub_getAccountReport(axis2_stub_t *stub, + const axis2_env_t *env, + axiom_node_t *node); + +/** + * populate services + */ +void axis2_populate_axis_service( axis2_stub_t* stub, const axis2_env_t *env); + +/** + * Creates axis2_stub struct + * @param endpoint reference + * @return pointer to newly created axis2_stub struct + */ +axis2_stub_t * +axis2_Account_stub_create_with_endpoint_ref_and_client_home(const axis2_env_t *env, + axis2_endpoint_ref_t *endpoint_ref, + axis2_char_t *client_home); + +/** + * Creates axis2_stub struct + * @param endpoint uri + * @return pointer to newly created axis2_stub struct + */ +axis2_stub_t * +axis2_Account_stub_create_with_endpoint_uri_and_client_home(const axis2_env_t *env, + const axis2_char_t *endpoint_uri, + const axis2_char_t *client_home); +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* AXIS2_ECHO_STUB_H */ diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/services.xml b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/services.xml new file mode 100644 index 0000000000..bb57c6edb6 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/WSAccountClient/services.xml @@ -0,0 +1,30 @@ + + + + tuscany_sca_ws_service + c:/apache/apache_checkout/cpp/sca/samples/BigBank/deploy + AccountSubsystem/Account/WSAccountEntrypoint + + + This is a testing service, named 'BigBank' to test multiple operations in the same service + + + + + + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/deploy.bat b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/deploy.bat new file mode 100644 index 0000000000..d88112556b --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/BigBank/deploy.bat @@ -0,0 +1,16 @@ +copy Accounts\Debug\Accounts.dll Deploy\modules\Accounts +copy Accounts\Debug\Accounts.pdb Deploy\modules\Accounts +copy Accounts\AccountServiceImpl.h Deploy\modules\Accounts +copy Accounts\AccountService.h Deploy\modules\Accounts +copy Accounts\AccountDataServiceImpl.h Deploy\modules\Accounts +copy Accounts\AccountDataService.h Deploy\modules\Accounts +copy Accounts\StockQuoteService.h Deploy\modules\Accounts +copy Accounts\StockQuoteServiceImpl.h Deploy\modules\Accounts +copy Accounts\StockQuoteExternalService.h Deploy\modules\Accounts +copy AccountClient\Debug\AccountClient.exe Deploy\modules\Accounts +copy AccountClient\Debug\AccountClient.pdb Deploy\modules\Accounts +copy Accounts\sca.module Deploy\modules\Accounts +copy Accounts\sca.subsystem Deploy\subsystems\Accounts +copy Accounts\AccountServiceImpl.componentType Deploy\modules\Accounts +copy Accounts\AccountDataServiceImpl.componentType Deploy\modules\Accounts +copy Accounts\StockQuoteServiceImpl.componentType Deploy\modules\Accounts -- cgit v1.2.3