Author: shankar Date: Mon Nov 23 14:14:44 2009 New Revision: 883349 URL: http://svn.apache.org/viewvc?rev=883349&view=rev Log: Fixing config service client
Modified: incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php Modified: 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=883349&r1=883348&r2=883349&view=diff ============================================================================== --- incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php (original) +++ incubator/stonehenge/trunk/stocktrader/php/business_service/order_processor_proxy.php Mon Nov 23 14:14:44 2009 @@ -45,24 +45,63 @@ public $order; // (object)OrderDataBean } -/* - * request send to get information needed by business service - */ -class BSConfigRequest -{ - public $BS; +class GetBSConfig { + + /** + * @var (object)BSConfigRequest + */ + public $bs; + } -/* - * configuration parameters needed by business service - */ -class BSConfigResponse -{ - public $DBName; +class BSConfigRequest { + /** + * @var string $BSName BS Name + */ + public $BSName; +} + +class GetBSConfigResponse { + + /** + * @var (object)BSConfigResponse + */ + public $GetBSConfigResult; + +} + +class BSConfigResponse { + + /** + * @var string $DBHost Database host + */ public $DBHostName; + + /** + * @var string $DBName Database name + */ + public $DBName; + + /** + * @var string $DBPort Database port + */ public $DBPort; + + /** + * @var string $OPS OPS endpoint URL + */ public $OPS; + + /** + * @var string $OPSName OPS Name + */ + public $OPSName; + + /** + * @var boolean $Sec Service is secured or not + */ public $Sec; + } /** @@ -74,6 +113,8 @@ // define the class map $class_map = array( "BSConfigRequest" => "BSConfigRequest", + "GetBSConfig" => "GetBSConfig", + "GetBSConfigResponse" => "GetBSConfigResponse", "BSConfigResponse" => "BSConfigResponse"); // create client in WSDL mode @@ -83,10 +124,11 @@ // get proxy object reference form client $proxy = $client->getProxy(); - $input = new BSConfigRequest(); - $input->BS = SERVICE_NAME; + $input = new GetBSConfig(); + $input->bs = new BSConfigRequest(); + $input->bs->BSName = SERVICE_NAME; - $response = $proxy->BSConfigRequest($input); + $response = $proxy->GetBSConfig($input); return $response; } @@ -98,14 +140,14 @@ function GetProxy() { $OPSConfig = GetOPSConfig(); - if($OPSConfig) + if(($OPSConfig) && ($OPSConfig->GetBSConfigResult)) { $class_map = array( "SubmitOrderTransactedQueue" => "SubmitOrderTransactedQueue", "OrderDataBean" => "OrderDataBean", "SubmitOrder" => "SubmitOrder"); - if ($OPSConfig->Sec) + if ($OPSConfig->GetBSConfigResult->Sec) { //This is the security information $rec_cert = ws_get_key_from_file("../resources/keys/OPS.cert"); @@ -118,7 +160,7 @@ "policy" => $policy, "securityToken" => $sec_token, "useSOAP" => "1.2", - "to" => $OPSConfig->OPS)); + "to" => $OPSConfig->GetBSConfigResult->OPS)); } else { @@ -126,7 +168,7 @@ $client = new WSClient(array ( "wsdl" => "../resources/wsdl/TradeOrders.wsdl", "classmap" => $class_map, - "to" => $OPSConfig->OPS)); + "to" => $OPSConfig->GetBSConfigResult->OPS)); } // get proxy object reference form client