You are viewing a plain text version of this content. The canonical link for it is here.
Posted to stonehenge-commits@incubator.apache.org by ch...@apache.org on 2009/09/01 12:42:29 UTC

svn commit: r810009 - /incubator/stonehenge/trunk/stocktrader/php/trader_client/request_processor.php

Author: chintana
Date: Tue Sep  1 12:42:29 2009
New Revision: 810009

URL: http://svn.apache.org/viewvc?rev=810009&view=rev
Log:
* Removing unused classes.  Getting the class map from class_info.php.
* Using the new operation to get the BS endpoint URL.


Modified:
    incubator/stonehenge/trunk/stocktrader/php/trader_client/request_processor.php

Modified: incubator/stonehenge/trunk/stocktrader/php/trader_client/request_processor.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/request_processor.php?rev=810009&r1=810008&r2=810009&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/request_processor.php (original)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/request_processor.php Tue Sep  1 12:42:29 2009
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+require_once('../config_service/class_info.php');
+
 define ("STATUS_SUCCESS", 1);
 define ("STATUS_FAILURE", 0);
 define ("TRUE", 1);
@@ -488,55 +490,22 @@
 }
 
 /*
- * Request send to get configurations parameter needed by client
- */
-class ClientConfigRequest 
-{
-    /**
-     * @var string
-     */
-    public $Client;
-}
-
-/*
- * contains information needed by client 
- */
-class ClientConfigResponse 
-{
-    /**
-     * @var anyURI
-     */
-    public $BS;
-}
-
-/*
  * Get the endpoint of business service
  */
 function GetBSEndPoint()
 {
+	global $class_map;
+	
+	$client = new WSClient(array("wsdl" => "../resources/wsdl/config_svc.wsdl",
+								 "classmap" => $class_map));
+	$proxy = $client->getProxy();
+	
+	$input = new GetClientConfig();
+	$input->client = new ClientConfigRequest();
+	$input->client->ClientName = CLIENT_NAME;
+	$response = $proxy->GetClientConfig($input);	
 
-	// define the class map
-	$class_map = array(
-		"ClientConfigRequest" => "ClientConfigRequest",
-		"ClientConfigResponse" => "ClientConfigResponse");
-
-    // create client in WSDL mode
-    $client = new WSClient(array ("wsdl" =>"../resources/wsdl/config_svc.wsdl",
-		"classmap" => $class_map, 
-		"to" => GetEndpoint()));
-
-    // get proxy object reference form client 
-    $proxy = $client->getProxy();
-	$input = new ClientConfigRequest();
-	$input->Client = CLIENT_NAME;
-
-    $response = $proxy->ClientConfigRequest($input);
-	if($response)
-	{
-		$endPoint = $response->BS;
-	}
-
-	return $endPoint;
+	return $response->GetClientConfigResult->BS;
 }
 
 /**