You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/08/06 18:42:56 UTC

svn commit: r429151 - in /incubator/tuscany/cpp/sca/samples/BigBank: AccountClient/ Accounts/

Author: jsdelfino
Date: Sun Aug  6 09:42:55 2006
New Revision: 429151

URL: http://svn.apache.org/viewvc?rev=429151&view=rev
Log:
Changed AccountService web service to be a proper doc-literal-wrapped web service, using elements and anonymous complex types wrappering the input and output parameters. Adjusted the AccountService class to flow the actual parameters instead of the wrappers. Also removed all the calls to XSDHelper.defineFile which are not necessary as long as AccountService.wsdl is registered in Tuscany-Model.config.

Modified:
    incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/AccountClient.cpp
    incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.cmd
    incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.sh
    incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp
    incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.h
    incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.wsdl
    incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp
    incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.h

Modified: incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/AccountClient.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/AccountClient.cpp?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/AccountClient.cpp (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/AccountClient.cpp Sun Aug  6 09:42:55 2006
@@ -54,17 +54,8 @@
 			{
                 // 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","CustomerID");
-                in->setCString("customerID",argv[1]);
-
                 DataObjectPtr report = 
-                    accountService->getAccountReport(in);
+                    accountService->getAccountReport(argv[1]);
 
                 if (report != 0)
                 {

Modified: incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.cmd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.cmd?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.cmd (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.cmd Sun Aug  6 09:42:55 2006
@@ -48,8 +48,7 @@
 
 set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH%
 
-cd "%TUSCANY_SCACPP_SYSTEM_ROOT%/modules/Accounts"
-"%APFULLDIR%/AccountClient.exe" 1234
+.\AccountClient.exe 1234
 
 :end
 endlocal

Modified: incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.sh
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.sh?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.sh (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.sh Sun Aug  6 09:42:55 2006
@@ -41,6 +41,5 @@
 export TUSCANY_SCACPP_SYSTEM_ROOT=$TEST_SYSTEM
 export TUSCANY_SCACPP_DEFAULT_MODULE=BigBankSubsystem
 
-cd $TEST_SYSTEM/modules/Accounts
-$APFULLDIR/account_client 1234
+./account_client 1234
 

Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountDataServiceImpl.cpp Sun Aug  6 09:42:55 2006
@@ -20,10 +20,12 @@
 #endif
 
 #include "commonj/sdo/SDO.h"
+#include "osoa/sca/sca.h"
 
 #include "AccountDataServiceImpl.h"
 
 using namespace commonj::sdo;
+using namespace osoa::sca;
 
 namespace com
 {
@@ -37,11 +39,7 @@
             {
                 try {
 
-                    DataFactoryPtr factory  = DataFactory::getDataFactory();
-
-                    XSDHelperPtr helper = HelperProvider::getXSDHelper(factory);
-    
-                    helper->defineFile("AccountService.wsdl");
+                    DataFactoryPtr factory  = ComponentContext::getCurrent().getDataFactory();
 
                     DataObjectPtr newaccount = 
                         factory->create("http://www.bigbank.com/AccountService","CheckingAccount");
@@ -72,11 +70,7 @@
             {
                 try {
 
-                    DataFactoryPtr factory  = DataFactory::getDataFactory();
-
-                    XSDHelperPtr helper = HelperProvider::getXSDHelper(factory);
-    
-                    helper->defineFile("AccountService.wsdl");
+                    DataFactoryPtr factory  = ComponentContext::getCurrent().getDataFactory();
 
                     DataObjectPtr newaccount = 
                         factory->create("http://www.bigbank.com/AccountService","SavingsAccount");
@@ -106,11 +100,7 @@
             {
                 try {
 
-                    DataFactoryPtr factory  = DataFactory::getDataFactory();
-
-                    XSDHelperPtr helper = HelperProvider::getXSDHelper(factory);
-    
-                    helper->defineFile("AccountService.wsdl");
+                    DataFactoryPtr factory  = ComponentContext::getCurrent().getDataFactory();
 
                     DataObjectPtr newaccount = 
                         factory->create("http://www.bigbank.com/AccountService","StockAccount");

Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.h?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.h Sun Aug  6 09:42:55 2006
@@ -47,7 +47,7 @@
                 // Float balance.
 
                  virtual commonj::sdo::DataObjectPtr /*AccountReport*/
-                     getAccountReport(DataObjectPtr cid) = 0;
+                     getAccountReport(const char* customerID) = 0;
          
         
             };

Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.wsdl?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.wsdl (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountService.wsdl Sun Aug  6 09:42:55 2006
@@ -10,16 +10,22 @@
   targetNamespace="http://www.bigbank.com/AccountService"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
   
-  <xsd:element name="getAccountReport" type="tns:CustomerID" />
-    
-  <xsd:complexType name="CustomerID">
+  <xsd:element name="getAccountReport">
+  <xsd:complexType>
    <xsd:sequence>
     <xsd:element name="customerID" type="xsd:string" />
    </xsd:sequence>
-   </xsd:complexType>
+   </xsd:complexType>
+  </xsd:element>
 
-  <xsd:element name="getAccountReportResponse" type="tns:AccountReport" />
-
+  <xsd:element name="getAccountReportResponse">
+  <xsd:complexType> 
+   <xsd:sequence>
+    <xsd:element name="result" type="tns:AccountReport"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   </xsd:element>
+  
   <xsd:complexType name="AccountReport"> 
    <xsd:sequence>
     <xsd:element name="checking" type="tns:CheckingAccount" 
@@ -28,9 +34,9 @@
 	  maxOccurs="unbounded"/>
     <xsd:element name="stocks" type="tns:StockAccount" 
 	  maxOccurs="unbounded"/>
-   </xsd:sequence>
-   </xsd:complexType>
-  
+    </xsd:sequence>
+  </xsd:complexType>
+   
   <xsd:complexType name="StockAccount">
    <xsd:sequence>
     <xsd:element name="accountNumber" type="xsd:string"/>

Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.cpp Sun Aug  6 09:42:55 2006
@@ -72,25 +72,17 @@
             }
 
             DataObjectPtr /*AccountReport**/ 
-                AccountServiceImpl::getAccountReport(DataObjectPtr cid)
+                AccountServiceImpl::getAccountReport(const char* customerID)
             {
                 try {
 
-                    commonj::sdo::DataFactoryPtr factory = 
-                        commonj::sdo::DataFactory::getDataFactory();
- 
-                    commonj::sdo::XSDHelperPtr helper = 
-                        commonj::sdo::HelperProvider::getXSDHelper(factory);
+                    ComponentContext theContext = ComponentContext::getCurrent();
     
-                    helper->defineFile("AccountService.wsdl");
-
-                    const char* id = cid->getCString("customerID");
-
+                    commonj::sdo::DataFactoryPtr factory = theContext.getDataFactory();
+ 
                     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");
         
@@ -104,7 +96,7 @@
                     // gets the first of each.
 
                     commonj::sdo::DataObjectPtr checking =                     
-                        dataService->getCheckingAccount(id);
+                        dataService->getCheckingAccount(customerID);
 
                     if (checking != 0)
                     {
@@ -114,7 +106,7 @@
                         dl.append(checking);
                     }
 
-                    commonj::sdo::DataObjectPtr savings = dataService->getSavingsAccount(id);
+                    commonj::sdo::DataObjectPtr savings = dataService->getSavingsAccount(customerID);
 
                     if (savings != 0)
                     {
@@ -133,7 +125,7 @@
                         return newReport;
                     }
 
-                    commonj::sdo::DataObjectPtr stocks = dataService->getStockAccount(id);
+                    commonj::sdo::DataObjectPtr stocks = dataService->getStockAccount(customerID);
 
                     if (stocks != 0)
                     {

Modified: incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.h?rev=429151&r1=429150&r2=429151&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.h (original)
+++ incubator/tuscany/cpp/sca/samples/BigBank/Accounts/AccountServiceImpl.h Sun Aug  6 09:42:55 2006
@@ -37,7 +37,7 @@
     // public API
 
     virtual DataObjectPtr /*AccountReport*/
-        getAccountReport(DataObjectPtr cid);
+        getAccountReport(const char* customerID);
 
 
     //virtual void lazyGetDependencies();



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org