incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r741201 [1/2] - in /incubator/stonehenge/trunk/stocktrader/php/business_service: ./ conf/ keys/ wsdl/
Date Thu, 05 Feb 2009 17:36:47 GMT
Author: shankar
Date: Thu Feb  5 17:36:46 2009
New Revision: 741201

URL: http://svn.apache.org/viewvc?rev=741201&view=rev
Log:
php business service added. 

Added:
    incubator/stonehenge/trunk/stocktrader/php/business_service/
    incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php
    incubator/stonehenge/trunk/stocktrader/php/business_service/business_svc.php
    incubator/stonehenge/trunk/stocktrader/php/business_service/conf/
    incubator/stonehenge/trunk/stocktrader/php/business_service/conf/configuration_service_config.xml
    incubator/stonehenge/trunk/stocktrader/php/business_service/conf/database_config.xml
    incubator/stonehenge/trunk/stocktrader/php/business_service/conf/policy.xml
    incubator/stonehenge/trunk/stocktrader/php/business_service/data_access_layer.php
    incubator/stonehenge/trunk/stocktrader/php/business_service/keys/
    incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_cert.cert
    incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_key.pem
    incubator/stonehenge/trunk/stocktrader/php/business_service/keys/bob_cert.cert
    incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl0
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd0
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd1
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd2
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeService.wsdl
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeService.wsdl0
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeService.xsd0
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeService.xsd1
    incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/config_svc.wsdl

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php Thu Feb  5 17:36:46 2009
@@ -0,0 +1,1264 @@
+<?php
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once("order_processor_proxy.php");
+require_once("data_access_layer.php");
+
+define ("ORDER_TYPE_BUY", "buy");
+define ("ORDER_TYPE_SELL", "sell");
+define ("BUY_ORDER_FEE", 15.95);
+define ("SELL_ORDER_FEE", 29.95);
+define ("INITIAL_ORDER_PRICE", 1.0);
+define ("INITIAL_HOLDING_ID", -1);
+define ("TOP_ORDERS", 5);
+
+// PHP classes corresponding to the data types in defined in WSDL
+class emptyMethodAction 
+{
+}
+
+class emptyMethodActionResponse 
+{
+}
+
+/**
+ * This class encapsulate login information for a user.
+ */
+class login 
+{
+    public $userID; // string
+    public $password; // string
+}
+
+/**
+ * This class encapsulates the login response information.
+ */
+class loginResponse 
+{
+    public $loginReturn; // (object)AccountDataBean
+}
+
+/**
+ * This class encapsulates account information of a user.
+ */
+class AccountDataBean 
+{
+    public $accountID; // int
+    public $loginCount; // int
+    public $logoutCount; // int
+    public $lastLogin; // dateTime
+    public $creationDate; // dateTime
+    public $balance; // decimal
+    public $openBalance; // decimal
+    public $profileID; // string
+}
+
+/**
+ * This class contains information required for the getOrders request.
+ */
+class getOrders 
+{
+    public $userID; // string
+}
+
+/**
+ * This class encapsulates the response for getOrderes request.
+ */
+class getOrdersResponse 
+{
+    public $getOrdersReturn; // (object)ArrayOfOrderDataBean
+}
+
+/**
+ * This class contains an array of OrderDataBean objects.
+ */
+class ArrayOfOrderDataBean 
+{
+    public $OrderDataBean; // array[0, unbounded] of (object)OrderDataBean
+}
+
+/**
+ * This class contains information required to obtain Account information
+ * of a particular user.
+ */
+class getAccountData 
+{
+    public $userID; // string
+}
+
+/**
+ * This class encapsulates an AccountDataBean object as the response of
+ * a getAccountData request.
+ */
+class getAccountDataResponse 
+{
+    public $getAccountDataReturn; // (object)AccountDataBean
+}
+
+/**
+ * This class contains userID which is required to obtain the profile
+ * information correspond to a particular userID.
+ */
+class getAccountProfileData 
+{
+    public $userID; // string
+}
+
+/**
+ * This class encapsultes response object for a getAccountProfile request,
+ * which is a AccountProfileDataBean object.
+ */
+class getAccountProfileDataResponse 
+{
+    public $getAccountProfileDataReturn; // (object)AccountProfileDataBean
+}
+
+/**
+ * This class encapsultes Account profile information of users.
+ */
+class AccountProfileDataBean 
+{
+    public $userID; // string
+    public $password; // string
+    public $fullName; // string
+    public $address; // string
+    public $email; // string
+    public $creditCard; // string
+}
+
+/**
+ * This class is used to update AccountProfile information of a particular
+ * user. It contains user profile information (AccountProfileDataBean object).
+ */
+class updateAccountProfile 
+{
+    public $profileData; // (object)AccountProfileDataBean
+}
+
+/**
+ * This class encapsultes the response information of updateAccountProfile request.
+ */
+class updateAccountProfileResponse 
+{
+    public $updateAccountProfileReturn; // (object)AccountProfileDataBean
+}
+
+/**
+ * This encapsulates logout request information.
+ */
+class logout 
+{
+    public $userID; // string
+}
+
+/**
+ * This class encapsultes logout response information, of a particular user.
+ */
+class logoutResponse 
+{
+}
+
+/**
+ * This class encapsulates buy order information, corresponding to a particular
+ * order.
+ */
+class buy 
+{
+    public $userID; // string
+    public $symbol; // string
+    public $quantity; // double
+    public $orderProcessingMode; // int
+}
+
+/**
+ * This class encapsultes response information corresonding to a particular buy
+ * operation.
+ */
+class buyResponse 
+{
+    public $buyReturn; // (object)OrderDataBean
+}
+
+/**
+ * This class encapsulates a sell order information, of an order.
+ */
+class sell 
+{
+    public $userID; // string
+    public $holdingID; // int
+    public $orderProcessingMode; // int
+}
+
+/**
+ * Response of a particular sell operation.
+ */
+class sellResponse 
+{
+    public $sellReturn; // (object)OrderDataBean
+}
+
+/**
+ * This class encapsulates the userID in order to get holding
+ * information of a particular user.
+ */
+class getHoldings 
+{
+    public $userID; // string
+}
+
+/**
+ * This class contains response of a getHoldings request.
+ */
+class getHoldingsResponse 
+{
+    public $getHoldingsReturn; // (object)ArrayOfHoldingDataBean
+}
+
+/**
+ * Encapsulates an array of HoldingDataBean objects.
+ */
+class ArrayOfHoldingDataBean 
+{
+    public $HoldingDataBean; // array[0, unbounded] of (object)HoldingDataBean
+}
+
+/**
+ * This class encapsulates information of a holding.
+ */
+class HoldingDataBean 
+{
+    public $holdingID; // int
+    public $quantity; // double
+    public $purchasePrice; // decimal
+    public $purchaseDate; // dateTime
+    public $quoteID; // string
+}
+
+/**
+ * This class contains information for registration of a new user.
+ */
+class register 
+{
+    public $userID; // string
+    public $password; // string
+    public $fullname; // string
+    public $address; // string
+    public $email; // string
+    public $creditcard; // string
+    public $openBalance; // decimal
+}
+
+/**
+ * This class contains the response of a new user registration.
+ */
+class registerResponse 
+{
+    public $registerReturn; // (object)AccountDataBean
+}
+
+/**
+ * This contains information required to get the Closed order information.
+ */
+class getClosedOrders 
+{
+    public $userID; // string
+}
+
+/**
+ * This class encapsultes the response of a getClosedOrders request.
+ */
+class getClosedOrdersResponse 
+{
+    public $getClosedOrdersReturn; // (object)ArrayOfOrderDataBean
+}
+
+/**
+ * This class corresponds to a getMarketSummary object needed for
+ * getMarketSummary operation.
+ */
+class getMarketSummary 
+{
+}
+
+/**
+ * This class encapsulates the response of the getMarketSummary request.
+ */
+class getMarketSummaryResponse 
+{
+    public $getMarketSummaryReturn; // (object)MarketSummaryDataBeanWS
+}
+
+/**
+ * This class encapsulates MarketSummary information.
+ */
+class MarketSummaryDataBeanWS 
+{
+    public $TSIA; // decimal
+    public $openTSIA; // decimal
+    public $volume; // double
+    public $topGainers; // (object)ArrayOfQuoteDataBean
+    public $topLosers; // (object)ArrayOfQuoteDataBean
+    public $summaryDate; // dateTime
+}
+
+/**
+ * This class contains an array of QuoteDataBean objects.
+ */
+class ArrayOfQuoteDataBean 
+{
+    public $QuoteDataBean; // array[0, unbounded] of (object)QuoteDataBean
+}
+
+/**
+ * This class encapsulates information of a particular Quote.
+ */
+class QuoteDataBean 
+{
+    public $symbol; // string
+    public $companyName; // string
+    public $price; // decimal
+    public $open; // decimal
+    public $low; // decimal
+    public $high; // decimal
+    public $change; // double
+    public $volume; // double
+}
+
+/**
+ * This class encapsulates the symbol which is needed for the getQuote
+ * operation.
+ */
+class getQuote 
+{
+    public $symbol; // string
+}
+
+/**
+ * This class encapsulates a QuoteDataBean which is a response of a 
+ * getQuote request.
+ */
+class getQuoteResponse 
+{
+    public $getQuoteReturn; // (object)QuoteDataBean
+}
+
+/**
+ * This class encapsultes information required to get information correspond
+ * to a particular holding.
+ */
+class getHolding 
+{
+    public $userID; // string
+    public $holdingID; // int
+}
+
+/**
+ * This class contains a HoldingDataBean object, which is the response of a
+ * getHolding request.
+ */
+class getHoldingResponse 
+{
+    public $getHoldingReturn; // (object)HoldingDataBean
+}
+
+/**
+ * This class contains the userID of a particular user, which is needed for
+ * obtaining the TopOrders he has placed.
+ */
+class getTopOrders 
+{
+    public $userID; // string
+}
+
+/**
+ * This class contains an Array of OrderDataBean objects which is the output
+ * of getTopOrders request.
+ */
+class getTopOrdersResponse 
+{
+    public $getTopOrdersReturn; // (object)ArrayOfOrderDataBean
+}
+
+/**
+ * This class contians information for a particular sell operation. The
+ * difference between normal sell operation and this sellEnhanced operation
+ * is that, sellEnhanced allows selling some quantity to be sold, which sell
+ * operation sell all the items in a particular holding.
+ */
+class sellEnhanced 
+{
+    public $userID; // string
+    public $holdingID; // int
+    public $quantity; // double
+}
+
+/**
+ * This class encapsultes the response of a sellEnhanced operation.
+ */
+class sellEnhancedResponse 
+{
+    public $sellEnhancedReturn; // (object)OrderDataBean
+}
+
+/**
+ * This class is used to check the status of the Business processor
+ * service.
+ */
+class isOnline 
+{
+}
+
+/**
+ * This class is used to send the response of a isOnline requset.
+ */
+class isOnlineResponse 
+{
+}
+
+/**
+ * This is the utility method to process a sellEnhanced request.
+ * After creating an order, it passes it to order processor for
+ * further processing.
+ * @param sellInfo contains sell operation information.
+ * @return an order object correspond to the order.
+ */
+function processSellEnhanced($sellInfo)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if ($dbhandle)
+	{
+		$status = ExecuteQuery("BEGIN TRAN");
+		if ($status)
+		{
+			$query = "SELECT HOLDING.HOLDINGID, HOLDING.QUANTITY, HOLDING.PURCHASEPRICE, 
+					HOLDING.PURCHASEDATE, HOLDING.QUOTE_SYMBOL,HOLDING.ACCOUNT_ACCOUNTID FROM 
+					HOLDING WITH (NOLOCK) WHERE HOLDINGID= '$sellInfo->holdingID'";
+			
+			$result = ExecuteQuery($query);
+			$symbol = GetMSSQLValue($result, 0, 4);
+			
+			if ($symbol)
+			{
+				$order = createOrder($sellInfo->userID, 
+						$symbol, ORDER_TYPE_SELL, 
+						$sellInfo->quantity, $sellInfo->holdingID);
+				
+				/*$order->openDate = "2008-05-30T19:27:30.78125+05:30";
+				$order->completionDate = "2008-05-30T19:27:30.890625+05:30";*/
+				$order->orderStatus = "open";
+				
+				if ($order)
+				{
+					processSubmitOrder($order);
+					$response = new sellEnhanced();
+					$response->sellEnhancedReturn = new OrderDataBean();
+					$response->sellEnhancedReturn = $order;
+					ExecuteQuery("COMMIT TRAN");
+				}
+				else
+				{
+					ExecuteQuery("ROLLBACK TRAN");
+				}
+			}
+			else
+			{
+				ExecuteQuery("ROLLBACK TRAN");
+			}
+
+			CloseDatabase($dbhandle);
+		}
+	}
+	return $response;
+}
+
+/**
+ * This is the utility method to get the Top orders of a user.
+ * @param userID is the userID of a particular user.
+ * @return an array of OrderDataBean objects.
+ */
+function processGetTopOrders($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+		$query = "SELECT TOP ".TOP_ORDERS." ORDERID, ORDERTYPE, ORDERSTATUS, OPENDATE, 
+				COMPLETIONDATE, QUANTITY, PRICE, ORDERFEE, QUOTE_SYMBOL FROM 
+				ORDERS WHERE ORDERS.ACCOUNT_ACCOUNTID = (select ACCOUNT.ACCOUNTID 
+				from ACCOUNT WITH (NOLOCK)  WHERE ACCOUNT.PROFILE_USERID = 
+				'$userID') ORDER BY ORDERS.ORDERID DESC";
+		
+		$result = ExecuteQuery($query);
+		
+		if($result)
+		{		
+			$response = new getOrdersResponse();
+			$response->getOrdersReturn = new ArrayOfOrderDataBean();
+			$rawNo = 0;
+			
+			while(($orderID = GetMSSQLValue($result, $rawNo, 0)))
+			{
+				$response->getOrdersReturn->OrderDataBean[$rawNo] = 
+					new OrderDataBean();
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderID = $orderID;
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderType = GetMSSQLValue($result, $rawNo, 1);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderStatus = GetMSSQLValue($result, $rawNo, 2);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					openDate = formatDate(GetMSSQLValue($result, $rawNo, 3));
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					completionDate = formatDate(GetMSSQLValue($result, $rawNo, 4));
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					quantity = GetMSSQLValue($result, $rawNo, 5);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					price = GetMSSQLValue($result, $rawNo, 6);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderFee = GetMSSQLValue($result, $rawNo, 7);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					symbol = GetMSSQLValue($result, $rawNo, 8);
+				
+				$rawNo = $rawNo + 1;
+			}
+		}
+		CloseDatabase($dbhandle);
+	}
+	return $response;
+}
+
+/**
+ * This utility method get the holding information of a particualr holding.
+ * @param holdingInfo holdingID, and the userID
+ * @return a HoldingDataBean object, which the holding information.
+ */
+function processGetHolding($holdingInfo)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+        $query = "Set NOCOUNT ON; SELECT HOLDING.ACCOUNT_ACCOUNTID, 
+			HOLDING.QUANTITY, HOLDING.PURCHASEPRICE, HOLDING.PURCHASEDATE, 
+			HOLDING.QUOTE_SYMBOL FROM HOLDING WITH(NOLOCK) 
+			WHERE HOLDING.HOLDINGID='$holdingInfo->holdingID' AND 
+			HOLDING.ACCOUNT_ACCOUNTID = (SELECT ACCOUNTID FROM 
+			ACCOUNT WHERE PROFILE_USERID = '$holdingInfo->userID')";
+	
+		$result = ExecuteQuery($query);
+		if ($result)
+		{
+			$response = new getHoldingResponse();
+			$response->getHoldingReturn = new HoldingDataBean();
+			$response->getHoldingReturn->holdingID = $holdingInfo->holdingID;
+			$response->getHoldingReturn->quantity = GetMSSQLValue($result, 0, 1);
+			$response->getHoldingReturn->purchasePrice = GetMSSQLValue($result, 0, 2);
+			$response->getHoldingReturn->purchaseDate = formatDate(GetMSSQLValue($result, 0, 3));
+			$response->getHoldingReturn->quoteID = GetMSSQLValue($result, 0, 4);
+		}
+		CloseDatabase($dbhandle);	
+	}
+	return $response;
+}
+
+/**
+ * This utility method is used to register a new user into the system.
+ * @param userInfo, information required to register a new user to the system.
+ * @return an AccountDataBean object correspond to the registered user.
+ */
+function processRegister($userInfo)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+        $queryAccount = "INSERT INTO account (CREATIONDATE, OPENBALANCE, LOGOUTCOUNT, 
+			BALANCE, LASTLOGIN, LOGINCOUNT, PROFILE_USERID) VALUES (GetDate(), 
+			'$userInfo->openBalance', '0', '$userInfo->openBalance', GetDate(), '0', 
+			'$userInfo->userID'); SELECT ID=@@IDENTITY";
+			
+        $queryAccountProfile = "INSERT INTO accountprofile VALUES 
+			('$userInfo->address', '$userInfo->password', '$userInfo->userID', 
+			'$userInfo->email', '$userInfo->creditCard', '$userInfo->fullname')";
+			
+		$result = ExecuteQuery($queryAccountProfile);
+		if ($result)
+		{
+			$result = null;
+			$result = ExecuteQuery($queryAccount);
+			$accountID = GetMSSQLValue($result, 0, 0);
+			if ($accountID)
+			{
+				$response = new registerResponse();
+				$response->registerReturn = new AccountDataBean();
+				$response->registerReturn->accountID = $accountID;
+				$response->registerReturn->loginCount = 0;
+				$response->registerReturn->logoutCount = 0;
+				$response->registerReturn->balance = $userInfo->openBalance;
+				$response->registerReturn->openBalance = $userInfo->openBalance;
+				$response->registerReturn->profileID = $accountID;
+			}
+		}
+		CloseDatabase($dbhandle);	
+	}
+	return $response;
+}
+
+/**
+ * This utility method is used to get MarketSummary information.
+ * @return a getMarketSummary object with market summary information.
+ */
+function processGetMarketSummary()
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+		$queryTSIA = "Set NOCOUNT ON; select SUM(price)/count(*) as 
+				TSIA from quote where symbol like 's:1__'";
+		$queryOPENTSIA = "Set NOCOUNT ON; select SUM(open1)/count(*) as 
+				openTSIA from quote where symbol like 's:1__'";
+		$queryVolume = "Set NOCOUNT ON; SELECT SUM(volume) from quote 
+				where symbol like 's:1__'";
+		$queryGainers = "Set NOCOUNT ON; SELECT symbol, companyname, volume, price, 
+				open1, low, high, change1 from quote with (NOLOCK) where symbol 
+				like 's:1__' order by change1 desc";
+		$queryLosers = "Set NOCOUNT ON; SELECT symbol, companyname, volume, price, 
+				open1, low, high, change1 from quote with (NOLOCK) where symbol 
+				like 's:1__' order by change1";
+		
+		$response = new getMarketSummaryResponse();
+		$response->getMarketSummaryReturn = new MarketSummaryDataBeanWS();
+		
+		$result = ExecuteQuery($queryTSIA);
+		if ($result)
+		{
+			$response->getMarketSummaryReturn->TSIA = 
+				GetMSSQLValue($result, 0, 0);
+			$result = null;
+		}
+		
+		$result = ExecuteQuery($queryOPENTSIA);
+		if ($result)
+		{
+			$response->getMarketSummaryReturn->openTSIA = 
+				GetMSSQLValue($result, 0, 0);
+			$result = null;
+		}
+		
+		$result = ExecuteQuery($queryVolume);
+		if($result)
+		{
+			$response->getMarketSummaryReturn->volume = 
+				GetMSSQLValue($result, 0, 0);
+			$result = null;
+		}
+		
+		$result = ExecuteQuery($queryGainers);
+		if($result)
+		{
+			$response->getMarketSummaryReturn->topGainers = 
+				new ArrayOfQuoteDataBean();
+			$rawNo = 0;
+			while(($symbol = GetMSSQLValue($result, $rawNo, 0)) && $rawNo < 5)
+			{
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo] = new QuoteDataBean();
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->symbol = $symbol;
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->companyName = GetMSSQLValue($result, 0, 1);
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->volume = GetMSSQLValue($result, 0, 2);
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->price = GetMSSQLValue($result, 0, 3);
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->open = GetMSSQLValue($result, 0, 4);
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->low = GetMSSQLValue($result, 0, 5);
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->high = GetMSSQLValue($result, 0, 6);
+				$response->getMarketSummaryReturn->topGainers->
+					QuoteDataBean[$rawNo]->change = GetMSSQLValue($result, 0, 7);
+				$rawNo = $rawNo + 1;
+			}
+			$result = null;
+		}
+		
+		$result = ExecuteQuery($queryLosers);
+		if($result)
+		{
+			$response->getMarketSummaryReturn->topLosers = 
+				new ArrayOfQuoteDataBean();
+			$rawNo = 0;
+			while(($symbol = GetMSSQLValue($result, $rawNo, 0)) && $rawNo < 5)
+			{
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo] = new QuoteDataBean();
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->symbol = $symbol;
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->companyName = GetMSSQLValue($result, 0, 1);
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->volume = GetMSSQLValue($result, 0, 2);
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->price = GetMSSQLValue($result, 0, 3);
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->open = GetMSSQLValue($result, 0, 4);
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->low = GetMSSQLValue($result, 0, 5);
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->high = GetMSSQLValue($result, 0, 6);
+				$response->getMarketSummaryReturn->topLosers->
+					QuoteDataBean[$rawNo]->change = GetMSSQLValue($result, 0, 7);
+				$rawNo = $rawNo + 1;
+			}
+			$result = null;
+		}
+		
+		/*$result = ExecuteQuery($querySummaryDate);
+		if($result)
+		{
+			$response->getMarketSummaryReturn->summaryDate = 
+				GetMSSQLValue($result, 0, 0);
+			$result = null;
+		}*/
+		
+		CloseDatabase($dbhandle);	
+	}
+	return $response;
+}
+
+
+/**
+ * This utility method is used to get accountID corresond to a particular userID.
+ * @param userID userID.
+ * @return the accountID of the user.
+ */
+function getAccountID($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+		$query = "Set NOCOUNT ON; SELECT ACCOUNTID FROM dbo.ACCOUNT  
+			WITH (NOLOCK) WHERE PROFILE_USERID = '$userID'";
+		$result = ExecuteQuery($query);
+		if($result)
+		{
+			$response = GetMSSQLValue($result, 0, 0);	
+		}
+		CloseDatabase($dbhandle);	
+	}
+	return $response;
+}
+
+/**
+ * This utility method is used to create an order in the system.
+ * @param userID userID
+ * @param symbol symbol
+ * @param orderType type of the order (buy|sell)
+ * @param quantity amount (buy|sell)
+ * @param holdingID holdingID of the order (apply for sell)
+ * @return an OrderDataBean object.
+ */
+function createOrder($userID, $symbol, $orderType, $quantity, $holdingID)
+{
+	$order = null;
+	$order = new OrderDataBean();
+	$order->price = INITIAL_ORDER_PRICE;
+	$order->orderType = $orderType;
+	$order->orderStatus = "open";
+	$order->quantity = $quantity;
+	$order->symbol = $symbol;
+	
+	if ($orderType == ORDER_TYPE_BUY)
+	{
+		$order->orderFee = BUY_ORDER_FEE;
+	}
+	elseif ($orderType == ORDER_TYPE_SELL)
+	{
+		$order->orderFee = SELL_ORDER_FEE;
+	}
+	
+	$query = "INSERT INTO ORDERS (OPENDATE, ORDERFEE, PRICE, QUOTE_SYMBOL, QUANTITY, 
+			ORDERTYPE, ORDERSTATUS, ACCOUNT_ACCOUNTID, HOLDING_HOLDINGID) 
+			VALUES (GETDATE(),  '$order->orderFee', '$order->price', 
+			'$order->symbol', '$order->quantity', '$orderType', 'open', 
+			'".getAccountID($userID)."', '$holdingID'); 
+			SELECT ID=@@IDENTITY";
+	
+	$result = ExecuteQuery($query);
+	
+	if ($result)
+	{
+		$order->orderID = GetMSSQLValue($result, 0, 0);
+	}
+	return $order;
+}
+
+/**
+ * This is the utility method to process a sell request.
+ * After creating an order, it passes it to order processor for
+ * further processing.
+ * @param buyInfo contains buy operation information.
+ * @return an order object correspond to the order.
+ */
+function processBuy($buyInfo)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if ($dbhandle)
+	{
+		$status = ExecuteQuery("BEGIN TRAN");
+		$order = createOrder($buyInfo->userID, $buyInfo->symbol, 
+				ORDER_TYPE_BUY, $buyInfo->quantity, INITIAL_HOLDING_ID);
+		
+		/*$order->openDate = "2008-05-30T19:27:30.78125+05:30";
+		$order->completionDate = "2008-05-30T19:27:30.890625+05:30";*/
+		$order->orderStatus = "open";
+		
+		if ($order)
+		{	
+			processSubmitOrder($order);
+			$response = new buyResponse();
+			$response->buyReturn = new OrderDataBean();
+			$response->buyReturn = $order;
+			ExecuteQuery("COMMIT TRAN");
+		}
+		else
+		{
+			ExecuteQuery("ROLLBACK TRAN");
+		}
+		CloseDatabase($dbhandle);
+	}
+	return $response;
+}
+
+/**
+ * This method is used by the ConfigWeb application to check the connectivity.
+ * @return a QuoteDataBean object with nill
+ */
+function connectivityResponse()
+{
+	$response = new getQuoteResponse();
+	$response->getQuoteReturn = new QuoteDataBean();
+	return $response;
+}
+
+/**
+ * This is the utility method to process a getQuote request.
+ * @param symbol symbol.
+ * @return a QuoteDataBean object.
+ */
+function processGetQuote($symbol)
+{
+	if ($symbol)
+	{
+		$dbhandle = ConnectToDatabase();
+		$response = null;
+		if($dbhandle)
+		{
+			$query = "Set NOCOUNT ON; SELECT symbol, companyname, volume, price, 
+					open1, low, high, change1 from quote with (ROWLOCK) where 
+					symbol = '$symbol'";
+			
+			$result = ExecuteQuery($query);
+			if ($result)
+			{
+				$response = new getQuoteResponse();
+				$response->getQuoteReturn = new QuoteDataBean();
+				$response->getQuoteReturn->symbol = GetMSSQLValue($result, 0, 0);
+				$response->getQuoteReturn->companyName = GetMSSQLValue($result, 0, 1);
+				$response->getQuoteReturn->volume = GetMSSQLValue($result, 0, 2);
+				$response->getQuoteReturn->price = GetMSSQLValue($result, 0, 3);
+				$response->getQuoteReturn->open = GetMSSQLValue($result, 0, 4);
+				$response->getQuoteReturn->low = GetMSSQLValue($result, 0, 5);
+				$response->getQuoteReturn->high = GetMSSQLValue($result, 0, 6);
+				$response->getQuoteReturn->change = GetMSSQLValue($result, 0, 7);			
+				
+			}
+			CloseDatabase($dbhandle);	
+		}
+	}
+	else
+	{
+		$response = connectivityResponse();
+	}
+	return $response;
+}
+
+/**
+ * This is the utility method that update Account profile information.
+ * @param profileInfo information that needs to be updated in the profile.
+ * @return a AccountProfileDataBean object.
+ */
+function processUpdateAccountProfile($profileInfo)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+		$query = "UPDATE accountprofile WITH (ROWLOCK) SET ADDRESS='$profileInfo->address', 
+				PASSWORD='$profileInfo->password', EMAIL='$profileInfo->email', CREDITCARD = 
+				'$profileInfo->creditCard', FULLNAME='$profileInfo->fullName' WHERE 
+				USERID= '$profileInfo->userID'";
+				
+		$result = ExecuteQuery($query);
+		if($result)
+		{
+			$response = new updateAccountProfileResponse();
+			$response->updateAccountProfileReturn = new AccountProfileDataBean();
+			$response->updateAccountProfileReturn->userID = $profileInfo->userID;
+			$response->updateAccountProfileReturn->password = $profileInfo->password;
+			$response->updateAccountProfileReturn->fullName = $profileInfo->fullName;
+			$response->updateAccountProfileReturn->address = $profileInfo->address;
+			$response->updateAccountProfileReturn->email = $profileInfo->email;
+			$response->updateAccountProfileReturn->creditCard = $profileInfo->creditCard;
+		}
+		else
+		{	
+		}
+		CloseDatabase($dbhandle);	
+	}
+	return $response;
+}
+
+/**
+ * Is used to process a logout request
+ * @param userID userID 
+ * @return logoutResponse object
+ */
+function processLogout($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+        $query = "UPDATE dbo.account WITH (ROWLOCK) SET LOGOUTCOUNT = 
+			(LOGOUTCOUNT + 1) where PROFILE_USERID= '$userID'";
+		
+		$result = ExecuteQuery($query);
+		if($result)
+		{
+			$response = new logoutResponse();
+		}
+		CloseDatabase($dbhandle);	
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get the holdings of a particular user.
+ * @param userID userID
+ * @return an array of HoldingDataBean objects.
+ */
+function processGetHoldings($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+        $query = "SELECT HOLDING.HOLDINGID, HOLDING.QUANTITY, HOLDING.PURCHASEPRICE, 
+			HOLDING.PURCHASEDATE, HOLDING.QUOTE_SYMBOL,HOLDING.ACCOUNT_ACCOUNTID 
+			from holding WHERE HOLDING.ACCOUNT_ACCOUNTID = (SELECT ACCOUNTID 
+			FROM ACCOUNT WHERE PROFILE_USERID = '$userID') ORDER BY HOLDING.HOLDINGID DESC";
+			
+		$result = ExecuteQuery($query);
+		if($result)
+		{
+			$response = new getHoldingsResponse();
+			$response->getHoldingsReturn = new ArrayOfHoldingDataBean();
+			
+			$rawNo = 0;
+			while(($holdingID = GetMSSQLValue($result, $rawNo, 0)))
+			{
+				$response->getHoldingsReturn->HoldingDataBean[$rawNo] 
+					= new HoldingDataBean();
+				$response->getHoldingsReturn->HoldingDataBean[$rawNo]->
+					holdingID = GetMSSQLValue($result, $rawNo, 0);
+				$response->getHoldingsReturn->HoldingDataBean[$rawNo]->
+					quantity = GetMSSQLValue($result, $rawNo, 1);
+				$response->getHoldingsReturn->HoldingDataBean[$rawNo]->
+					purchasePrice = GetMSSQLValue($result, $rawNo, 2);
+				$response->getHoldingsReturn->HoldingDataBean[$rawNo]->
+					purchaseDate = formatDate(GetMSSQLValue($result, $rawNo, 3));
+				$response->getHoldingsReturn->HoldingDataBean[$rawNo]->
+					quoteID = GetMSSQLValue($result, $rawNo, 4);
+				$rawNo = $rawNo + 1;	
+			}		
+		}
+		CloseDatabase($dbhandle);	
+	}
+	return $response;
+}
+
+/**
+ * This method obtains the set of closed orders.
+ * @param userID userID
+ * @return an array of OrderDataBean objects
+ */
+function processGetClosedOrders($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if ($dbhandle)
+	{
+        $query = "Set NOCOUNT ON; SELECT ORDERID, ORDERTYPE, ORDERSTATUS, 
+			COMPLETIONDATE, OPENDATE, QUANTITY, PRICE, ORDERFEE, QUOTE_SYMBOL 
+			FROM orders WHERE ACCOUNT_ACCOUNTID = (select accountid from 
+			account WITH(NOLOCK) where profile_userid = '$userID') AND 
+			ORDERSTATUS = 'closed'";
+		
+		$result = ExecuteQuery($query);
+		
+		if ($result)
+		{
+			$response = new getClosedOrdersResponse();
+			$response->getClosedOrdersReturn = new ArrayOfOrderDataBean();
+			$rawNo = 0;
+			
+			while(($orderID = GetMSSQLValue($result, $rawNo, 0)))
+			{
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo] = 
+					new OrderDataBean();
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					orderID = $orderID;
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					orderType = GetMSSQLValue($result, 0, 1);
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					orderStatus = GetMSSQLValue($result, $rawNo, 2);
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					completionDate = formatDate(GetMSSQLValue($result, $rawNo, 3));
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					openDate = formatDate(GetMSSQLValue($result, $rawNo, 4));
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					quantity = GetMSSQLValue($result, $rawNo, 5);
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					price = GetMSSQLValue($result, $rawNo, 6);
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					orderFee = GetMSSQLValue($result, $rawNo, 7);
+				$response->getClosedOrdersReturn->OrderDataBean[$rawNo]->
+					symbol = GetMSSQLValue($result, $rawNo, 8);
+				
+				$rawNo = $rawNo + 1;
+			}
+			
+			$query = "UPDATE orders SET ORDERSTATUS = 'completed' where 
+				ORDERSTATUS = 'closed' AND ACCOUNT_ACCOUNTID = (select accountid 
+				from account WITH (NOLOCK) where profile_userid = '$userID')";
+				
+			ExecuteQuery($query);
+		}
+		CloseDatabase($dbhandle);
+	}
+	return $response;	
+}
+
+/**
+ * This method is a utility method which obtains the AccountProfileData of 
+ * a user.
+ * @param userID userID
+ * @return an AccountProfileDataBean object.
+ */
+function processGetAccountProfileData($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+        $query = "Set NOCOUNT ON; SELECT accountprofile.USERID, accountprofile.PASSWORD, 
+		accountprofile.FULLNAME, accountprofile.ADDRESS, accountprofile.EMAIL, 
+		accountprofile.CREDITCARD FROM accountprofile WITH (NOLOCK) WHERE 
+		accountprofile.USERID = '$userID'";
+		
+		$result = ExecuteQuery($query);
+		
+		if($result)
+		{
+			$response = new getAccountProfileDataResponse();
+			$response->getAccountProfileDataReturn = new AccountProfileDataBean();
+			$response->getAccountProfileDataReturn->userID = $userID;
+			$response->getAccountProfileDataReturn->password = GetMSSQLValue($result, 0, 1);
+			$response->getAccountProfileDataReturn->fullName = GetMSSQLValue($result, 0, 2);
+			$response->getAccountProfileDataReturn->address = GetMSSQLValue($result, 0, 3);
+			$response->getAccountProfileDataReturn->email = GetMSSQLValue($result, 0, 4);
+			$response->getAccountProfileDataReturn->creditCard = GetMSSQLValue($result, 0, 5);
+		}
+		CloseDatabase($dbhandle);
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get the Account data of a particular user.
+ * @param userID userID
+ * @return an AccountDataBean object
+ */
+function processGetAccountData($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+		$query = "Set NOCOUNT ON; SELECT account.ACCOUNTID, account.PROFILE_USERID, 
+				account.CREATIONDATE, account.OPENBALANCE, account.LOGOUTCOUNT, 
+				account.BALANCE, account.LASTLOGIN, account.LOGINCOUNT FROM account 
+				WHERE account.PROFILE_USERID = '$userID'";
+				
+		$result = ExecuteQuery($query);
+	
+		if ($result)
+		{
+			$response = new getAccountDataResponse();
+			$response->getAccountDataReturn = new AccountDataBean();
+			$response->getAccountDataReturn->accountID = GetMSSQLValue($result, 0, 0);
+			$response->getAccountDataReturn->profileID = GetMSSQLValue($result, 0, 1);
+			$response->getAccountDataReturn->creationDate = formatDate(GetMSSQLValue($result, 0, 2));
+			$response->getAccountDataReturn->openBalance = GetMSSQLValue($result, 0, 3);
+			$response->getAccountDataReturn->logoutCount = GetMSSQLValue($result, 0, 4);
+			$response->getAccountDataReturn->balance = GetMSSQLValue($result, 0, 5);
+			$response->getAccountDataReturn->lastLogin = formatDate(GetMSSQLValue($result, 0, 6));
+			$response->getAccountDataReturn->loginCount = GetMSSQLValue($result, 0, 7);
+		}
+		CloseDatabase($dbhandle);
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get the orders that a particular user has placed.
+ * @param userID userID
+ * @return an array of OrderDataBean objects.
+ */
+function processGetOrders($userID)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if($dbhandle)
+	{
+		$query = "SELECT ORDERID, ORDERTYPE, ORDERSTATUS, OPENDATE, 
+			COMPLETIONDATE, QUANTITY, PRICE, ORDERFEE, QUOTE_SYMBOL FROM 
+			ORDERS WHERE ORDERS.ACCOUNT_ACCOUNTID = (select ACCOUNT.ACCOUNTID 
+			from ACCOUNT WITH (NOLOCK)  WHERE ACCOUNT.PROFILE_USERID = 
+			'$userID') ORDER BY ORDERS.ORDERID DESC";
+		
+								
+		$result = ExecuteQuery($query);
+		
+		if($result)
+		{		
+			$response = new getOrdersResponse();
+			$response->getOrdersReturn = new ArrayOfOrderDataBean();
+			$rawNo = 0;
+			
+			while(($orderID = GetMSSQLValue($result, $rawNo, 0)))
+			{
+				$response->getOrdersReturn->OrderDataBean[$rawNo] = 
+					new OrderDataBean();
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderID = $orderID;
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderType = GetMSSQLValue($result, $rawNo, 1);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderStatus = GetMSSQLValue($result, $rawNo, 2);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					openDate = formatDate(GetMSSQLValue($result, $rawNo, 3));
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					completionDate = formatDate(GetMSSQLValue($result, $rawNo, 4));
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					quantity = GetMSSQLValue($result, $rawNo, 5);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					price = GetMSSQLValue($result, $rawNo, 6);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					orderFee = GetMSSQLValue($result, $rawNo, 7);
+				$response->getOrdersReturn->OrderDataBean[$rawNo]->
+					symbol = GetMSSQLValue($result, $rawNo, 8);
+				
+				$rawNo = $rawNo + 1;
+			}
+		}
+		CloseDatabase($dbhandle);
+	}
+	return $response;
+}
+
+/**
+ * This method is used to process a login request.
+ * @param userID userID
+ * @param password password
+ * @return an AccountDataBean object.
+ */
+function processLogin($userID, $password)
+{
+	$dbhandle = ConnectToDatabase();
+	$response = null;
+	if ($dbhandle)
+	{
+		$query = "Set NOCOUNT ON; SELECT ACCOUNTPROFILE.USERID, 
+			ACCOUNTPROFILE.PASSWORD, ACCOUNTPROFILE.FULLNAME, 
+			ACCOUNTPROFILE.ADDRESS, ACCOUNTPROFILE.EMAIL, 
+			ACCOUNTPROFILE.CREDITCARD FROM ACCOUNTPROFILE WITH (NOLOCK) 
+			WHERE ACCOUNTPROFILE.USERID = '$userID'";
+		
+		$result = ExecuteQuery($query);
+		
+		if ($password == GetMSSQLValue($result, 0, 1))
+		{
+			$query = "UPDATE ACCOUNT WITH (ROWLOCK) SET LOGINCOUNT 
+				= (LOGINCOUNT + 1), LASTLOGIN = CURRENT_TIMESTAMP where 
+				PROFILE_USERID = '$userID'; 
+				SELECT ACCOUNT.ACCOUNTID, ACCOUNT.CREATIONDATE, 
+				ACCOUNT.OPENBALANCE, ACCOUNT.LOGOUTCOUNT, 
+				ACCOUNT.BALANCE, ACCOUNT.LASTLOGIN, ACCOUNT.LOGINCOUNT 
+				FROM ACCOUNT WITH (ROWLOCK) WHERE 
+				ACCOUNT.PROFILE_USERID = '$userID'";
+			
+			$result = null;
+			$result = ExecuteQuery($query);
+			if ($result)
+			{
+				$response = new loginResponse();
+				$response->loginReturn = new AccountDataBean();
+				$response->loginReturn->accountID = GetMSSQLValue($result, 0, 0);
+				$response->loginReturn->creationDate = formatDate(GetMSSQLValue($result, 0, 1));
+				$response->loginReturn->openBalance = GetMSSQLValue($result, 0, 2);
+				$response->loginReturn->logoutCount = GetMSSQLValue($result, 0, 3);
+				$response->loginReturn->balance = GetMSSQLValue($result, 0, 4);
+				$response->loginReturn->lastLogin = formatDate(GetMSSQLValue($result, 0, 5));
+				$response->loginReturn->loginCount = GetMSSQLValue($result, 0, 6);
+				$response->loginReturn->profileID = $userID;
+			}
+		}
+		CloseDatabase($dbhandle);
+	}
+	return $response;
+}
+
+/**
+ * This function formats the incoming date into the format
+ * yy-mm-ddThh-min-sec format
+ */
+function formatDate($dateString)
+{
+	return date ("Y-m-d\TH:i:s.100", strtotime($dateString));
+}
+?>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/business_svc.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/business_svc.php?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/business_svc.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/business_svc.php Thu Feb  5 17:36:46 2009
@@ -0,0 +1,439 @@
+<?php
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require_once("business_processor.php");
+
+// define the class map
+$class_map = array(
+    "emptyMethodAction" => "emptyMethodAction",
+    "emptyMethodActionResponse" => "emptyMethodActionResponse",
+    "login" => "login",
+    "loginResponse" => "loginResponse",
+    "AccountDataBean" => "AccountDataBean",
+    "getOrders" => "getOrders",
+    "getOrdersResponse" => "getOrdersResponse",
+    "ArrayOfOrderDataBean" => "ArrayOfOrderDataBean",
+    "OrderDataBean" => "OrderDataBean",
+    "getAccountData" => "getAccountData",
+    "getAccountDataResponse" => "getAccountDataResponse",
+    "getAccountProfileData" => "getAccountProfileData",
+    "getAccountProfileDataResponse" => "getAccountProfileDataResponse",
+    "AccountProfileDataBean" => "AccountProfileDataBean",
+    "updateAccountProfile" => "updateAccountProfile",
+    "updateAccountProfileResponse" => "updateAccountProfileResponse",
+    "logout" => "logout",
+    "logoutResponse" => "logoutResponse",
+    "buy" => "buy",
+    "buyResponse" => "buyResponse",
+    "sell" => "sell",
+    "sellResponse" => "sellResponse",
+    "getHoldings" => "getHoldings",
+    "getHoldingsResponse" => "getHoldingsResponse",
+    "ArrayOfHoldingDataBean" => "ArrayOfHoldingDataBean",
+    "HoldingDataBean" => "HoldingDataBean",
+    "register" => "register",
+    "registerResponse" => "registerResponse",
+    "getClosedOrders" => "getClosedOrders",
+    "getClosedOrdersResponse" => "getClosedOrdersResponse",
+    "getMarketSummary" => "getMarketSummary",
+    "getMarketSummaryResponse" => "getMarketSummaryResponse",
+    "MarketSummaryDataBeanWS" => "MarketSummaryDataBeanWS",
+    "ArrayOfQuoteDataBean" => "ArrayOfQuoteDataBean",
+    "QuoteDataBean" => "QuoteDataBean",
+    "getQuote" => "getQuote",
+    "getQuoteResponse" => "getQuoteResponse",
+    "getHolding" => "getHolding",
+    "getHoldingResponse" => "getHoldingResponse",
+    "getTopOrders" => "getTopOrders",
+    "getTopOrdersResponse" => "getTopOrdersResponse",
+    "sellEnhanced" => "sellEnhanced",
+    "sellEnhancedResponse" => "sellEnhancedResponse",
+    "isOnline" => "isOnline",
+    "isOnlineResponse" => "isOnlineResponse");
+
+// define PHP functions that maps to WSDL operations 
+function emptyMethodAction($input) 
+{
+	return;
+}
+
+/**
+ * Used by the service to provide login functionality.
+ * @param input login input object
+ * @return an AccountDataBean object on success
+ * and null on failure.
+ */
+
+function login($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processLogin($input->userID, $input->password);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * To get the Top five order information.
+ * @param input contains the userID
+ * @return an array of OrderDataBean objects
+ */
+ 
+function getOrders($input) 
+{
+	$response = null;
+	if($input)
+	{
+		//This method only get the top five order information.
+		$response = processGetTopOrders($input->userID);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method obtains information about a particular
+ * user's Account
+ * @param input contains the userID
+ * @return an AccountDataBean object
+ */
+
+function getAccountData($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetAccountData($input->userID);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method obtains profile information about a particular
+ * user.
+ * @param input contains userID
+ * @return an AccountProfileDataBean object.
+ */
+
+function getAccountProfileData($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetAccountProfileData($input->userID);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method gets the order information with status "closed"
+ * @param input contains the userID
+ * @return an ArrayOfOrderDataBean object.
+ */
+
+function getClosedOrders($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetClosedOrders($input->userID);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method updates user profile information.
+ * @param input contains an AccountProfileDataBean object.
+ * @return an AccountProfileDataBean object.
+ */
+
+function updateAccountProfile($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processUpdateAccountProfile(
+			$input->profileData);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to logout a particular user.
+ * @param input contains the userID
+ * @return a logoutResponse object.
+ */
+function logout($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processLogout($input->userID);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to do a buy operation.
+ * @param input contains an order object.
+ * @return an OrderDataBean object on success.
+ */
+
+function buy($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processBuy($input);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to do a sell operation.
+ * @param input contains an order object.
+ * @return an OrderDataBean object on success.
+ */
+
+function sell($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processSell($input);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get Holding information of a particular user.
+ * @param input contains a userID.
+ * @return an ArrayOfHoldingDataBean object.
+ */
+
+function getHoldings($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetHoldings($input->userID);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to register a new user.
+ * @param input contains a user information.
+ * @return an AccountDataBean object.
+ */
+function register($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processRegister($input);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get Market Summary information.
+ * @param input getMarketSummaryObject.
+ * @return a MarketSummaryDataBeanWS object.
+ */
+function getMarketSummary($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetMarketSummary();
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get quote information of a symbol.
+ * @param input contains the symbol.
+ * @return a QuoteDataBean object.
+ */
+function getQuote($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetQuote($input->symbol);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get holding information.
+ * @param input contains userID and the holdingID.
+ * @return a HoldingDataBean object.
+ */
+function getHolding($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetHolding($input);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to get the top order information of a user.
+ * @param input contains userID.
+ * @return an ArrayOfOrderDataBean object.
+ */
+function getTopOrders($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processGetTopOrders($input->userID);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to do a sell operation (with some quantity).
+ * @param input contains userID, holdingID and the quantity.
+ * @return an OrderDataBean object.
+ */
+function sellEnhanced($input) 
+{
+	$response = null;
+	if($input)
+	{
+		$response = processSellEnhanced($input);
+	}
+	else
+	{
+	}
+	return $response;
+}
+
+/**
+ * This method is used to check whether the service is online or not.
+ * @param input an isOnline object.
+ * @return an isOnline object.
+ */
+function isOnline($input) 
+{
+	return new isOnline();
+}
+
+
+// define the operations map
+$operations = array(
+    "emptyMethodAction" => "emptyMethodAction",
+    "login" => "login",
+    "getOrders" => "getOrders",
+    "getAccountData" => "getAccountData",
+    "getAccountProfileData" => "getAccountProfileData",
+    "updateAccountProfile" => "updateAccountProfile",
+    "logout" => "logout",
+    "buy" => "buy",
+    "sell" => "sell",
+    "getHoldings" => "getHoldings",
+    "register" => "register",
+    "getClosedOrders" => "getClosedOrders",
+    "getMarketSummary" => "getMarketSummary",
+    "getQuote" => "getQuote",
+    "getHolding" => "getHolding",
+    "getTopOrders" => "getTopOrders",
+    "sellEnhanced" => "sellEnhanced",
+    "isOnline" => "isOnline");
+
+// define the actions => operations map
+$actions = array(
+    "http://trade.samples.websphere.ibm.com/ITradeServices/login" => "login",
+    "getOrders" => "getOrders",
+    "getAccountData" => "getAccountData",
+    "getAccountProfileData" => "getAccountProfileData",
+    "updateAccountProfile" => "updateAccountProfile",
+    "logout" => "logout",
+    "buy" => "buy",
+    "sell" => "sell",
+    "getHoldings" => "getHoldings",
+    "register" => "register",
+    "getClosedOrders" => "getClosedOrders",
+    "getMarketSummary" => "getMarketSummary",
+    "http://trade.samples.websphere.ibm.com/ITradeServices/getQuote" => "getQuote",
+    "getHolding" => "getHolding",
+    "getTopOrders" => "getTopOrders",
+    "sellEnhanced" => "sellEnhanced",
+    "isOnline" => "isOnline");
+
+// create service in WSDL mode
+$service = new WSService(array ("wsdl" =>"wsdl/TradeService.wsdl",
+        "actions" => $actions,
+        "classmap" => $class_map,
+        "operations" => $operations));
+
+// process client requests and reply 
+$service->reply();
+
+?>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/conf/configuration_service_config.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/conf/configuration_service_config.xml?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/conf/configuration_service_config.xml (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/conf/configuration_service_config.xml Thu Feb  5 17:36:46 2009
@@ -0,0 +1,3 @@
+<config>
+	<config_service>http://localhost:8080/config_service/config_svc.php</config_service>
+</config>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/conf/database_config.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/conf/database_config.xml?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/conf/database_config.xml (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/conf/database_config.xml Thu Feb  5 17:36:46 2009
@@ -0,0 +1,6 @@
+<config>
+	<server>127.0.0.1,1433</server>
+	<user>trade</user>
+	<password>trade</password>
+	<database>StockTraderDB</database>
+</config>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/conf/policy.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/conf/policy.xml?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/conf/policy.xml (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/conf/policy.xml Thu Feb  5 17:36:46 2009
@@ -0,0 +1,43 @@
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+    <wsp:ExactlyOne>
+        <wsp:All>
+            <sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                <wsp:Policy>
+                    <sp:ProtectionToken>
+                        <wsp:Policy>
+                            <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+                                <wsp:Policy>
+                                    <sp:WssX509V3Token10/>
+                                </wsp:Policy>
+                            </sp:X509Token>
+                        </wsp:Policy>
+                    </sp:ProtectionToken>
+                    <sp:AlgorithmSuite>
+                        <wsp:Policy>
+                            <sp:Basic256/>
+                        </wsp:Policy>
+                    </sp:AlgorithmSuite>
+                    <sp:Layout>
+                        <wsp:Policy>
+                            <sp:Strict/>
+                        </wsp:Policy>
+                    </sp:Layout>
+                    <sp:IncludeTimestamp/>
+                </wsp:Policy>
+            </sp:SymmetricBinding>
+            <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                <wsp:Policy>
+                    <sp:MustSupportRefKeyIdentifier/>
+                    <sp:MustSupportRefEmbeddedToken/>
+                    <sp:MustSupportRefIssuerSerial/>
+                </wsp:Policy>
+            </sp:Wss10>
+            <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                <sp:Body/>
+            </sp:SignedParts>
+            <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                <sp:Body/>
+            </sp:EncryptedParts>
+        </wsp:All>
+    </wsp:ExactlyOne>
+</wsp:Policy>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/data_access_layer.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/data_access_layer.php?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/data_access_layer.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/data_access_layer.php Thu Feb  5 17:36:46 2009
@@ -0,0 +1,118 @@
+<?php
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+class ConnectionInfo
+{
+	public $server; 	//The database server (eg: 127.0.0.1:1433)
+	public $user;		//User name 
+	public $password;	//Password
+	public $database;	//Database name
+}
+
+/**
+ * The method retrieves information for the database connection
+ * from a configuration file. The name of the config file should
+ * be, database_config.xml, and it should be in the same directory
+ * as this file.
+ * @return non NULL value (ConnectionInfo object), upon successfull 
+ * execution, and NULL if some information regarding the 
+ * connection is not available.
+ */
+
+function GetConnectionInfo()
+{
+	$doc = new DOMDocument();
+	$result = $doc->load('./conf/database_config.xml');
+
+	$server = $doc->getElementsByTagName("server")->item(0)->nodeValue;
+	$user = $doc->getElementsByTagName("user")->item(0)->nodeValue;
+	$password = $doc->getElementsByTagName("password")->item(0)->nodeValue;
+	$database = $doc->getElementsByTagName("database")->item(0)->nodeValue;
+
+	if ($server == NULL || $user == NULL || $password == NULL || $database == NULL)
+	{
+		error_log ("SERVER, USER, PASSWORD OR DATABASE IS NULL\n");
+	}
+	else
+	{
+		$ConnInfo = new ConnectionInfo();
+		$ConnInfo->server = $server;
+		$ConnInfo->user = $user;
+		$ConnInfo->password = $password;
+		$ConnInfo->database = $database;
+	}
+	return $ConnInfo;
+}
+
+/**
+ * This method establishes a connection to the database. 
+ * @return dbhandle, upon successfull execution a non null
+ * handle to the database connection is returned. Else it 
+ * will be null.
+ */
+
+function ConnectToDatabase()
+{
+	$connInfo = GetConnectionInfo();
+	if ($connInfo != NULL)
+	{
+		$dbhandle = mssql_connect($connInfo->server, $connInfo->user, $connInfo->password)
+			or die ("Couldn't connect to the server!!!");	    	
+		$selected = mssql_select_db($connInfo->database, $dbhandle) 
+			or die ("Couldn't open the database!!!");
+	}
+	return $dbhandle;
+}
+
+/**
+ * This method executes a query that it receives.
+ * @param query the query to execute
+ * @return non-NULL upon success and NULL otherwise.
+ */
+
+function ExecuteQuery($query)
+{
+	return mssql_query($query);
+}
+
+/**
+ * This method close the connection that is established to the
+ * database.
+ * @param dbhandle handle to the database
+ */
+
+function CloseDatabase($dbhandle)
+{
+	mssql_close($dbhandle);
+}
+
+/**
+ * This method returns the a value from a mssql result set (a tuple
+ * returned after execution of ExecuteQuery method.
+ * @param result, the result obtained from ExecuteQuery method.
+ * @param raw, the raw number
+ * @param column, the column number
+ * @return the value at (raw, column) of the tuple.
+ */
+
+function GetMSSQLValue($result, $raw, $column)
+{
+	return mssql_result($result, $raw, $column);
+}
+?>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_cert.cert
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_cert.cert?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_cert.cert (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_cert.cert Thu Feb  5 17:36:46 2009
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDDDCCAfSgAwIBAgIQM6YEf7FVYx/tZyEXgVComTANBgkqhkiG9w0BAQUFADAw
+MQ4wDAYDVQQKDAVPQVNJUzEeMBwGA1UEAwwVT0FTSVMgSW50ZXJvcCBUZXN0IENB
+MB4XDTA1MDMxOTAwMDAwMFoXDTE4MDMxOTIzNTk1OVowQjEOMAwGA1UECgwFT0FT
+SVMxIDAeBgNVBAsMF09BU0lTIEludGVyb3AgVGVzdCBDZXJ0MQ4wDAYDVQQDDAVB
+bGljZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAoqi99By1VYo0aHrkKCNT
+4DkIgPL/SgahbeKdGhrbu3K2XG7arfD9tqIBIKMfrX4Gp90NJa85AV1yiNsEyvq+
+mUnMpNcKnLXLOjkTmMCqDYbbkehJlXPnaWLzve+mW0pJdPxtf3rbD4PS/cBQIvtp
+jmrDAU8VsZKT8DN5Kyz+EZsCAwEAAaOBkzCBkDAJBgNVHRMEAjAAMDMGA1UdHwQs
+MCowKKImhiRodHRwOi8vaW50ZXJvcC5iYnRlc3QubmV0L2NybC9jYS5jcmwwDgYD
+VR0PAQH/BAQDAgSwMB0GA1UdDgQWBBQK4l0TUHZ1QV3V2QtlLNDm+PoxiDAfBgNV
+HSMEGDAWgBTAnSj8wes1oR3WqqqgHBpNwkkPDzANBgkqhkiG9w0BAQUFAAOCAQEA
+BTqpOpvW+6yrLXyUlP2xJbEkohXHI5OWwKWleOb9hlkhWntUalfcFOJAgUyH30TT
+pHldzx1+vK2LPzhoUFKYHE1IyQvokBN2JjFO64BQukCKnZhldLRPxGhfkTdxQgdf
+5rCK/wh3xVsZCNTfuMNmlAM6lOAg8QduDah3WFZpEA0s2nwQaCNQTNMjJC8tav1C
+Br6+E5FAmwPXP7pJxn9Fw9OXRyqbRA4v2y7YpbGkG2GI9UvOHw6SGvf4FRSthMMO
+35YbpikGsLix3vAsXWWi4rwfVOYzQK0OFPNi9RMCUdSH06m9uLWckiCxjos0FQOD
+ZE9l4ATGy9s9hNVwryOJTw==
+-----END CERTIFICATE-----

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_key.pem
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_key.pem?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_key.pem (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/keys/alice_key.pem Thu Feb  5 17:36:46 2009
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCiqL30HLVVijRoeuQoI1PgOQiA8v9KBqFt4p0aGtu7crZcbtqt
+8P22ogEgox+tfgan3Q0lrzkBXXKI2wTK+r6ZScyk1wqctcs6OROYwKoNhtuR6EmV
+c+dpYvO976ZbSkl0/G1/etsPg9L9wFAi+2mOasMBTxWxkpPwM3krLP4RmwIDAQAB
+AoGAY+fazB357rE1YVrh2hlgwh6lr3YRASmzaye+MLOAdNCPW5Sm8iFL5Cn7IU2v
+/kKi2eW21oeaLtFzsMU9W2LJP6h33caPcMr/1F3wsiHRCBSZiRLgroYnryJ2pWRq
+B8r6/j1mCKzNkoxwspUS1tPFIT0yJB4L/bQGMIvnoM4v5aECQQDX2hBKRbsQYSgL
+xZmqx/KJG7+rcpjYXBcztcO09sAsJ+tJe7FPKoKB1CG/KWqj8KQn69blXxhKRDTp
+rPZLiU7RAkEAwOnfR+dwLbnNGTuafvvbWE1d0CCa3YGooCrrCq4Af7D5jv9TZXDx
+yOIZsHzQH5U47e9ht2JvYllbTlMhirKsqwJBAKbyAadwRz5j5pU0P6XW/78LtzLj
+b1Pn5goYi0VrkzaTqWcsQ/b26fmAGJnBbrldZZl6zrqY0jCekE4reFLz4AECQA7Y
+MEFFMuGh4YFmj73jvX4u/eANEj2nQ4WHp+x7dTheMuXpCc7NgR13IIjvIci8X9QX
+Toqg/Xcw7xC43uTgWN8CQF2p4WulNa6U64sxyK1gBWOr6kwx6PWU29Ay6MPDPAJP
+O84lDgb5dlC1SGE+xHUzPPN6E4YFI/ECawOHNrADEsE=
+-----END RSA PRIVATE KEY-----

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/keys/bob_cert.cert
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/keys/bob_cert.cert?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/keys/bob_cert.cert (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/keys/bob_cert.cert Thu Feb  5 17:36:46 2009
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDCjCCAfKgAwIBAgIQYDju2/6sm77InYfTq65x+DANBgkqhkiG9w0BAQUFADAw
+MQ4wDAYDVQQKDAVPQVNJUzEeMBwGA1UEAwwVT0FTSVMgSW50ZXJvcCBUZXN0IENB
+MB4XDTA1MDMxOTAwMDAwMFoXDTE4MDMxOTIzNTk1OVowQDEOMAwGA1UECgwFT0FT
+SVMxIDAeBgNVBAsMF09BU0lTIEludGVyb3AgVGVzdCBDZXJ0MQwwCgYDVQQDDANC
+b2IwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMCquMva4lFDrv3fXQnKK8Ck
+SU7HvVZ0USyJtlL/yhmHH/FQXHyYY+fTcSyWYItWJYiTZ99PAbD+6EKBGbdfuJNU
+JCGaTWc5ZDUISqM/SGtacYe/PD/4+g3swNPzTUQAIBLRY1pkr2cm3s5Ch/f+mYVN
+BR41HnBeIxybw25kkoM7AgMBAAGjgZMwgZAwCQYDVR0TBAIwADAzBgNVHR8ELDAq
+MCiiJoYkaHR0cDovL2ludGVyb3AuYmJ0ZXN0Lm5ldC9jcmwvY2EuY3JsMA4GA1Ud
+DwEB/wQEAwIEsDAdBgNVHQ4EFgQUXeg55vRyK3ZhAEhEf+YT0z986L0wHwYDVR0j
+BBgwFoAUwJ0o/MHrNaEd1qqqoBwaTcJJDw8wDQYJKoZIhvcNAQEFBQADggEBAIiV
+Gv2lGLhRvmMAHSlY7rKLVkv+zEUtSyg08FBT8z/RepUbtUQShcIqwWsemDU8JVts
+ucQLc+g6GCQXgkCkMiC8qhcLAt3BXzFmLxuCEAQeeFe8IATr4wACmEQE37TEqAuW
+EIanPYIplbxYgwP0OBWBSjcRpKRAxjEzuwObYjbll6vKdFHYIweWhhWPrefquFp7
+TefTkF4D3rcctTfWJ76I5NrEVld+7PBnnJNpdDEuGsoaiJrwTW3Ixm40RXvG3fYS
+4hIAPeTCUk3RkYfUkqlaaLQnUrF2hZSgiBNLPe8gGkYORccRIlZCGQDEpcWl1Uf9
+OHw6fC+3hkqolFd5CVI=
+-----END CERTIFICATE-----

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php Thu Feb  5 17:36:46 2009
@@ -0,0 +1,186 @@
+<?php
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+define ("SERVICE_NAME", "PHP_BS");
+
+// PHP classes corresponding to the data types in defined in WSDL
+/**
+ * This class encapsulate information about an order object.
+ */
+class OrderDataBean 
+{
+    public $orderID; // int
+    public $orderType; // string
+    public $orderStatus; // string
+    public $openDate; // dateTime
+    public $completionDate; // dateTime
+    public $quantity; // double
+    public $price; // decimal
+    public $orderFee; // decimal
+    public $symbol; // string
+}
+
+/**
+ * This class encapsulate an order object to be submitted to order
+ * processor.
+ */
+class SubmitOrder 
+{
+    public $order; // (object)OrderDataBean
+}
+
+/*
+ * request send to get information needed by business service
+ */
+class BSConfigRequest 
+{
+    public $BS;
+}
+
+/*
+ * configuration parameters needed by business service
+ */
+class BSConfigResponse 
+{
+    public $DBName;
+    public $DBHostName;
+    public $DBPort;
+    public $OPS;
+    public $Sec;
+}
+
+/**
+ * This method will get configurations needed to make connection to order processor service
+ * returns BSConfigResponse object
+ */
+function GetOPSConfig()
+{
+	// define the class map
+	$class_map = array(
+		"BSConfigRequest" => "BSConfigRequest",
+		"BSConfigResponse" => "BSConfigResponse");
+
+    // create client in WSDL mode
+    $client = new WSClient(array ("wsdl" =>"wsdl/config_svc.wsdl",
+		"classmap" => $class_map, 
+		"to" => GetConfigServiceEndpoint()));
+
+    // get proxy object reference form client 
+    $proxy = $client->getProxy();
+	$input = new BSConfigRequest();
+	$input->BS = SERVICE_NAME;
+
+    $response = $proxy->BSConfigRequest($input);
+	return $response;
+}
+
+/**
+ * This method returns a proxy object so that all the other operations 
+ * can use it for calling Web Service operations.
+ * @return a proxy object.
+ */
+function GetProxy()
+{
+	$OPSConfig = GetOPSConfig();
+	if($OPSConfig)
+	{
+		$class_map = array(
+				"SubmitOrderTransactedQueue" => "SubmitOrderTransactedQueue",
+				"OrderDataBean" => "OrderDataBean",
+				"SubmitOrder" => "SubmitOrder");
+				
+		if ($OPSConfig->Sec)
+		{
+			//This is the security information
+			$rec_cert = ws_get_key_from_file("./keys/bob_cert.cert");
+			$pvt_key = ws_get_key_from_file("./keys/alice_key.pem");
+			$my_cert = ws_get_key_from_file("./keys/alice_cert.cert");
+			$policy_xml = file_get_contents("./conf/policy.xml"); 
+			$policy = new WSPolicy($policy_xml);
+			$sec_token = new WSSecurityToken(array("receiverCertificate" => $rec_cert,
+				"privateKey" => $pvt_key,
+				"certificate" => $my_cert));
+			$client = new WSClient(array (
+						"wsdl" => "wsdl/TradeOrders.wsdl",
+						"classmap" => $class_map,
+						"policy" => $policy,
+						"securityToken" => $sec_token,
+						"to" => $OPSConfig->OPS));
+		}
+		else
+		{
+			// create client in WSDL mode
+			$client = new WSClient(array (
+						"wsdl" => "wsdl/TradeOrders.wsdl",
+						"classmap" => $class_map,
+						"to" => $OPSConfig->OPS));
+		}
+		
+		// get proxy object reference form client 
+		$proxy = $client->getProxy();
+	}
+	return $proxy;
+}
+
+/**
+ * This method obtains the config service endpoint from a 
+ * configuration file. If it can not retrieve from that, it used the
+ * default value.
+ * @return the endpoint.
+ */
+function GetConfigServiceEndpoint()
+{
+	$doc = new DOMDocument();
+	$result = $doc->load('./conf/configuration_service_config.xml');
+	$service = 
+		$doc->getElementsByTagName("config_service")->item(0)->nodeValue;
+	
+	if (!($service))
+	{
+		$service = 
+			"http://localhost:8080/config_service/config_svc.php";
+	}
+	return $service;
+}
+
+/**
+ * This method does the neccessary processing prior to submit the order
+ * for further processing.
+ * @param order, the order object to be submitted.
+ * @return the order object just submitted.
+ */
+function processSubmitOrder($order)
+{	
+	$proxy = GetProxy();
+	$submitOrder = new SubmitOrder();
+	$submitOrder->order = new OrderDataBean();
+	$submitOrder->order->orderID = $order->orderID;
+	$submitOrder->order->orderType = $order->orderType;
+	$submitOrder->order->orderStatus = "open";
+	$submitOrder->order->quantity = $order->quantity;
+	$submitOrder->order->price = $order->price;
+	$submitOrder->order->orderFee = $order->orderFee;
+	$submitOrder->order->symbol = $order->symbol;
+	
+	if ($proxy)
+	{
+		$proxy->SubmitOrder($submitOrder);
+	}
+}
+?>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl Thu Feb  5 17:36:46 2009
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="OrderProcessor" targetNamespace="http://Trade.TraderOrderHost" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://Trade.TraderOrderHost" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://Trade.TraderOrderHost" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
 >
+ <wsp:Policy wsu:Id="NetMsmqBinding_OrderProcessorService_policy">
+  <wsp:ExactlyOne>
+   <wsp:All>
+    <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
+    <wsaw:UsingAddressing/>
+   </wsp:All>
+  </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="NetMsmqBinding_OrderProcessorService1_policy">
+  <wsp:ExactlyOne>
+   <wsp:All>
+    <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
+    <msmq:MsmqVolatile xmlns:msmq="http://schemas.microsoft.com/ws/06/2004/mspolicy/msmq"/>
+    <msmq:MsmqBestEffort xmlns:msmq="http://schemas.microsoft.com/ws/06/2004/mspolicy/msmq"/>
+    <wsaw:UsingAddressing/>
+   </wsp:All>
+  </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="CustomBinding_OrderProcessorService_policy">
+  <wsp:ExactlyOne>
+   <wsp:All>
+    <ow:OneWay xmlns:ow="http://schemas.microsoft.com/ws/2005/05/routing/policy"/>
+    <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
+    <wsaw:UsingAddressing/>
+   </wsp:All>
+  </wsp:ExactlyOne>
+ </wsp:Policy>
+  <wsdl:types>
+    <xsd:schema targetNamespace="http://Trade.TraderOrderHost/Imports">
+      <xsd:import schemaLocation="TradeOrders.xsd0" namespace="http://Trade.TraderOrderHost"/>
+      <xsd:import schemaLocation="TradeOrders.xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
+      <xsd:import schemaLocation="TradeOrders.xsd2" namespace="http://trade.samples.websphere.ibm.com"/>
+    </xsd:schema>
+  </wsdl:types>
+  <wsdl:message name="OrderProcessorService_SubmitOrderTransactedQueue_InputMessage">
+    <wsdl:part name="parameters" element="tns:SubmitOrderTransactedQueue"/>
+  </wsdl:message>
+  <wsdl:message name="OrderProcessorService_SubmitOrder_InputMessage">
+    <wsdl:part name="parameters" element="tns:SubmitOrder"/>
+  </wsdl:message>
+  <wsdl:message name="OrderProcessorService_isOnline_InputMessage">
+    <wsdl:part name="parameters" element="tns:isOnline"/>
+  </wsdl:message>
+  <wsdl:portType name="OrderProcessorService">
+    <wsdl:operation name="SubmitOrderTransactedQueue">
+      <wsdl:input wsaw:Action="SubmitOrder" message="tns:OrderProcessorService_SubmitOrderTransactedQueue_InputMessage"/>
+    </wsdl:operation>
+    <wsdl:operation name="SubmitOrder">
+      <wsdl:input wsaw:Action="SubmitOrderOnePhase" message="tns:OrderProcessorService_SubmitOrder_InputMessage"/>
+    </wsdl:operation>
+    <wsdl:operation name="isOnline">
+      <wsdl:input wsaw:Action="isOnline" message="tns:OrderProcessorService_isOnline_InputMessage"/>
+    </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="BasicHttpBinding_OrderProcessorService" type="i0:OrderProcessorService">
+  <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+  <wsdl:operation name="SubmitOrderTransactedQueue">
+   <soap:operation soapAction="SubmitOrder" style="document"/>
+   <wsdl:input>
+    <soap:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="SubmitOrder">
+   <soap:operation soapAction="SubmitOrderOnePhase" style="document"/>
+   <wsdl:input>
+    <soap:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="isOnline">
+   <soap:operation soapAction="isOnline" style="document"/>
+   <wsdl:input>
+    <soap:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="NetMsmqBinding_OrderProcessorService" type="i0:OrderProcessorService">
+  <wsp:PolicyReference URI="#NetMsmqBinding_OrderProcessorService_policy"/>
+  <soap12:binding transport="http://schemas.microsoft.com/soap/msmq"/>
+  <wsdl:operation name="SubmitOrderTransactedQueue">
+   <soap12:operation soapAction="SubmitOrder" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="SubmitOrder">
+   <soap12:operation soapAction="SubmitOrderOnePhase" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="isOnline">
+   <soap12:operation soapAction="isOnline" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="NetMsmqBinding_OrderProcessorService1" type="i0:OrderProcessorService">
+  <wsp:PolicyReference URI="#NetMsmqBinding_OrderProcessorService1_policy"/>
+  <soap12:binding transport="http://schemas.microsoft.com/soap/msmq"/>
+  <wsdl:operation name="SubmitOrderTransactedQueue">
+   <soap12:operation soapAction="SubmitOrder" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="SubmitOrder">
+   <soap12:operation soapAction="SubmitOrderOnePhase" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="isOnline">
+   <soap12:operation soapAction="isOnline" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="CustomBinding_OrderProcessorService" type="i0:OrderProcessorService">
+  <wsp:PolicyReference URI="#CustomBinding_OrderProcessorService_policy"/>
+  <soap12:binding transport="http://schemas.microsoft.com/soap/tcp"/>
+  <wsdl:operation name="SubmitOrderTransactedQueue">
+   <soap12:operation soapAction="SubmitOrder" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="SubmitOrder">
+   <soap12:operation soapAction="SubmitOrderOnePhase" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+  <wsdl:operation name="isOnline">
+   <soap12:operation soapAction="isOnline" style="document"/>
+   <wsdl:input>
+    <soap12:body use="literal"/>
+   </wsdl:input>
+  </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="OrderProcessor">
+  <wsdl:port name="BasicHttpBinding_OrderProcessorService" binding="tns:BasicHttpBinding_OrderProcessorService">
+	  <soap:address location="http://localhost:8083/order_processor/order_processor_svc.php"/>
+  </wsdl:port>
+  <!--
+  <wsdl:port name="NetMsmqBinding_OrderProcessorService" binding="tns:NetMsmqBinding_OrderProcessorService">
+   <soap12:address location="net.msmq://shankar/private/tradeordersqueuedurable"/>
+   <wsa10:EndpointReference>
+    <wsa10:Address>net.msmq://shankar/private/tradeordersqueuedurable</wsa10:Address>
+   </wsa10:EndpointReference>
+  </wsdl:port>
+  <wsdl:port name="NetMsmqBinding_OrderProcessorService1" binding="tns:NetMsmqBinding_OrderProcessorService1">
+   <soap12:address location="net.msmq://shankar/private/tradeordersqueuevolatile"/>
+   <wsa10:EndpointReference>
+    <wsa10:Address>net.msmq://shankar/private/tradeordersqueuevolatile</wsa10:Address>
+   </wsa10:EndpointReference>
+  </wsdl:port>
+  <wsdl:port name="CustomBinding_OrderProcessorService" binding="tns:CustomBinding_OrderProcessorService">
+   <soap12:address location="net.tcp://shankar:9001/TradeOrders"/>
+   <wsa10:EndpointReference>
+    <wsa10:Address>net.tcp://shankar:9001/TradeOrders</wsa10:Address>
+   </wsa10:EndpointReference>
+  </wsdl:port>
+  -->
+ </wsdl:service>
+</wsdl:definitions>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl0
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl0?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl0 (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.wsdl0 Thu Feb  5 17:36:46 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions targetNamespace="http://Trade.TraderOrderHost" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://Trade.TraderOrderHost" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+ <wsdl:types>
+  <xsd:schema targetNamespace="http://Trade.TraderOrderHost/Imports">
+   <xsd:import schemaLocation="TradeOrders.xsd0" namespace="http://Trade.TraderOrderHost"/>
+   <xsd:import schemaLocation="TradeOrders.xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
+   <xsd:import schemaLocation="TradeOrders.xsd2" namespace="http://trade.samples.websphere.ibm.com"/>
+  </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="OrderProcessorService_SubmitOrderTransactedQueue_InputMessage">
+  <wsdl:part name="parameters" element="tns:SubmitOrderTransactedQueue"/>
+ </wsdl:message>
+ <wsdl:message name="OrderProcessorService_SubmitOrder_InputMessage">
+  <wsdl:part name="parameters" element="tns:SubmitOrder"/>
+ </wsdl:message>
+ <wsdl:message name="OrderProcessorService_isOnline_InputMessage">
+  <wsdl:part name="parameters" element="tns:isOnline"/>
+ </wsdl:message>
+ <wsdl:portType name="OrderProcessorService">
+  <wsdl:operation name="SubmitOrderTransactedQueue">
+   <wsdl:input wsaw:Action="SubmitOrder" message="tns:OrderProcessorService_SubmitOrderTransactedQueue_InputMessage"/>
+  </wsdl:operation>
+  <wsdl:operation name="SubmitOrder">
+   <wsdl:input wsaw:Action="SubmitOrderOnePhase" message="tns:OrderProcessorService_SubmitOrder_InputMessage"/>
+  </wsdl:operation>
+  <wsdl:operation name="isOnline">
+   <wsdl:input wsaw:Action="isOnline" message="tns:OrderProcessorService_isOnline_InputMessage"/>
+  </wsdl:operation>
+ </wsdl:portType>
+</wsdl:definitions>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd0
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd0?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd0 (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd0 Thu Feb  5 17:36:46 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema elementFormDefault="qualified" targetNamespace="http://Trade.TraderOrderHost" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://Trade.TraderOrderHost">
+ <xs:import schemaLocation="TradeOrders.xsd2" namespace="http://trade.samples.websphere.ibm.com"/>
+ <xs:element name="SubmitOrderTransactedQueue">
+  <xs:complexType>
+   <xs:sequence>
+    <xs:element minOccurs="0" name="order" nillable="true" type="q1:OrderDataBean" xmlns:q1="http://trade.samples.websphere.ibm.com"/>
+   </xs:sequence>
+  </xs:complexType>
+ </xs:element>
+ <xs:element name="SubmitOrder">
+  <xs:complexType>
+   <xs:sequence>
+    <xs:element minOccurs="0" name="order" nillable="true" type="q2:OrderDataBean" xmlns:q2="http://trade.samples.websphere.ibm.com"/>
+   </xs:sequence>
+  </xs:complexType>
+ </xs:element>
+ <xs:element name="isOnline">
+  <xs:complexType>
+   <xs:sequence/>
+  </xs:complexType>
+ </xs:element>
+</xs:schema>

Added: incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd1
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd1?rev=741201&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd1 (added)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/wsdl/TradeOrders.xsd1 Thu Feb  5 17:36:46 2009
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/">
+ <xs:element name="anyType" nillable="true" type="xs:anyType"/>
+ <xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
+ <xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
+ <xs:element name="boolean" nillable="true" type="xs:boolean"/>
+ <xs:element name="byte" nillable="true" type="xs:byte"/>
+ <xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
+ <xs:element name="decimal" nillable="true" type="xs:decimal"/>
+ <xs:element name="double" nillable="true" type="xs:double"/>
+ <xs:element name="float" nillable="true" type="xs:float"/>
+ <xs:element name="int" nillable="true" type="xs:int"/>
+ <xs:element name="long" nillable="true" type="xs:long"/>
+ <xs:element name="QName" nillable="true" type="xs:QName"/>
+ <xs:element name="short" nillable="true" type="xs:short"/>
+ <xs:element name="string" nillable="true" type="xs:string"/>
+ <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
+ <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
+ <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
+ <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
+ <xs:element name="char" nillable="true" type="tns:char"/>
+ <xs:simpleType name="char">
+  <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ <xs:element name="duration" nillable="true" type="tns:duration"/>
+ <xs:simpleType name="duration">
+  <xs:restriction base="xs:duration">
+   <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
+   <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
+   <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
+  </xs:restriction>
+ </xs:simpleType>
+ <xs:element name="guid" nillable="true" type="tns:guid"/>
+ <xs:simpleType name="guid">
+  <xs:restriction base="xs:string">
+   <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
+  </xs:restriction>
+ </xs:simpleType>
+ <xs:attribute name="FactoryType" type="xs:QName"/>
+</xs:schema>



Mime
View raw message