From 1c2df9a2458897ff6c2393913b2723457e42a0da Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 23 Nov 2009 05:48:11 +0000 Subject: Simplified the automake build using configure options instead of environment variables and cleaned up some of the makefile.am files. Adjusted build instructions. Moved directories that don't yet build or work out of the main build dir and obsolete docs to a contrib dir. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@883254 13f79535-47bb-0310-9956-ffa450edef68 --- .../CppBigBank/bigbank.phpwsclient/bigaccount.php | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php (limited to 'sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php') diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php new file mode 100644 index 0000000000..b9f77d3297 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php @@ -0,0 +1,113 @@ + + + BigBank Sample + + + + + + +getAccountReport($accountname); + // we have to construct an object hierarchy that matches the + // WSDL request. We can use SDO to do this for us + + // configure SDO based on the WSDL + $xmldas = SDO_DAS_XML::create("AccountService.wsdl"); + + // Get a document that represents the request + // and get the root element + $requestxdoc = $xmldas->createDocument("getAccountReport"); + $requestsdo = $requestxdoc->getRootDataObject(); + + // add the parameter + $requestsdo['customerID'] = $accountname; + + // make the call + $result = $client->getAccountReport($requestsdo); + + // now we have the result as a PHP object + // we can turn this into an SDO but we have to do it manually + // as the SOAP extension won't generate types for us + // automatically just yet + $responsexdoc = $xmldas->createDocument("getAccountReportResponse"); + $responsesdo = $responsexdoc->getRootDataObject(); + + // flesh out the object hierarchy + $account = $responsesdo->createDataObject ('result'); + $checking = $account->createDataObject ('checking'); + $saving = $account->createDataObject ('savings'); + $stocks = $account->createDataObject ('stocks'); + + //copy the data + $checking['accountNumber'] = $result->result->checking->accountNumber; + $checking['balance'] = $result->result->checking->balance; + //etc.. + // This is a bit rubbish as we would want this to happen automatically + + // Now just put the data on the screen + // To do this we don't need to use SDO as you can see but + // it would be really handy if we wanted to pass the XML doc + // onto another service or if we wanted to do some other + // more complex XML manipulation or XPath searches + echo "

Account $accountname

"; + echo "

Checking Account

"; + echo ""; + echo ""; + echo "
Account Number $checking->accountNumber
Balance $checking->balance

Saving Account

"; + echo ""; + echo ""; + echo "
Account Number" . $result->result->savings->accountNumber . "
Balance" . $result->result->savings->balance . "

Stock Account

"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
Account Number" . $result->result->stocks->accountNumber . "
Symbol" . $result->result->stocks->symbol . "
Quantity" . $result->result->stocks->quantity . "
Banalce" . $result->result->stocks->balance . "
"; + } + catch (SoapFault $f) + { + echo "Caught soap exception: \n"; + print_r ( $f ); + } + } + catch ( Exception $e ) + { + echo "Caught exception: \n"; + print_r ( $e ); + + } +?> -- cgit v1.2.3