Author: shankar
Date: Wed Feb 11 04:10:09 2009
New Revision: 743211

URL: http://svn.apache.org/viewvc?rev=743211&view=rev
Log:
config service added. 

Added:
    incubator/stonehenge/trunk/stocktrader/php/config_service/
    incubator/stonehenge/trunk/stocktrader/php/config_service/class_info.php
    incubator/stonehenge/trunk/stocktrader/php/config_service/conf/
    
incubator/stonehenge/trunk/stocktrader/php/config_service/conf/database_config.xml
    incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc.php
    
incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc_processor.php
    
incubator/stonehenge/trunk/stocktrader/php/config_service/data_access_layer.php
    incubator/stonehenge/trunk/stocktrader/php/config_service/wsdl/
    
incubator/stonehenge/trunk/stocktrader/php/config_service/wsdl/config_svc.wsdl

Added: incubator/stonehenge/trunk/stocktrader/php/config_service/class_info.php
URL: 
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/config_service/class_info.php?rev=743211&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/config_service/class_info.php 
(added)
+++ incubator/stonehenge/trunk/stocktrader/php/config_service/class_info.php 
Wed Feb 11 04:10:09 2009
@@ -0,0 +1,290 @@
+<?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.
+ */
+
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class DBConfig
+{
+       /**
+        * @var string $DBName Name of the database server.
+        * (maps to the xs:string XML schema type )
+        */
+       public $DBName;
+
+       /**
+        * @var string $DBHostName host name of the database server
+        * (maps to the xs:anyURI XML schema type)
+        */
+       public $DBHostName;
+
+       /**
+        * @var int $DBPort port of the database server
+        * (maps to the xs:unsignedInt XML schema type )
+        */
+       public $DBPort;
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class GetDBConfigs
+{
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class DBConfigs
+{
+       /**
+        * @var array of object DBConfig $DBConfig
+        */
+       public $DBConfig;
+}
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class ActiveDB
+{
+       /**
+        * @var string $DBName Name of the database server.
+        * (maps to the xs:string XML schema type )
+        */
+       public $DBName;
+}
+
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class GetActiveDB
+{
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class ServiceLocation
+{
+       /**
+        * @var string $ServiceName Name of the service
+        * (maps to the xs:string XML schema type )
+        */
+       public $ServiceName;
+
+       /**
+        * @var string $ServiceURL end point url of the service
+        * (maps to the xs:anyURI XML schema type)
+        */
+       public $ServiceURL;
+}
+
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class GetServiceLocations
+{
+}
+
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class ServiceLocations
+{
+       /**
+        * @var array of object ServiceLocation $ServiceLocation
+        */
+       public $ServiceLocation;
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class ClientToBS
+{
+       /**
+        * @var string $Client Name of the client
+        * (maps to the xs:string XML schema type )
+        */
+       public $Client;
+
+       /**
+        * @var string $BS Name of the business service
+        * (maps to the xs:string XML schema type)
+        */
+       public $BS;
+}
+
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class GetClientToBSConnections
+{
+}
+
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class ClientToBSConnections
+{
+       /**
+        * @var array of object ClientToBS $ClientToBS
+        */
+       public $ClientToBS;
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class BSToOPS
+{
+       /**
+        * @var string $BS Name of the business service
+        * (maps to the xs:string XML schema type )
+        */
+       public $BS;
+
+       /**
+        * @var string $OPS Name of the order processor service
+        * (maps to the xs:string XML schema type)
+        */
+       public $OPS;
+}
+
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class GetBSToOPSConnections
+{
+}
+
+/** 
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class BSToOPSConnections
+{
+       /**
+        * @var array of object BSToOPS $BSToOPS
+        */
+       public $BSToOPS;
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class ClientConfigRequest
+{
+       /**
+        * @var string $Client Name of the client
+        * (maps to the xs:string XML schema type )
+        */
+       public $Client;
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class ClientConfigResponse
+{
+       /**
+        * @var string $BS end point url of business service
+        * (maps to the xs:anyURI XML schema type )
+        */
+       public $BS;
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class BSConfigRequest
+{
+       /**
+        * @var string $BS Name of the business service
+        * (maps to the xs:unsignedInt XML schema type )
+        */
+       public $BS;
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class BSConfigResponse
+{
+       /**
+        * @var string $DBName name of the database
+        * (maps to the xs:string XML schema type )
+        */
+       public $DBName;
+
+       /**
+        * @var string $DBHostName host name of database server
+        * (maps to the xs:anyURI XML schema type )
+        */
+       public $DBHostName;
+
+       /**
+        * @var int $DBPort port of the database server
+        * (maps to the xs:unsignedInt XML schema type )
+        */
+       public $DBPort;
+
+       /**
+        * @var string $OPS end point url of order processor service
+        * (maps to the xs:anyURI XML schema type )
+        */
+       public $OPS;
+
+       /**
+        * @var boolean $Sec denotes whether secure version of order processor
+        */
+       public $Sec;
+
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class OPSConfigRequest
+{
+}
+
+/**
+ * @namespace http://wso2.org/interop/stocktrader/xsd
+ */
+class OPSConfigResponse
+{
+       /**
+        * @var string $DBName name of the database
+        * (maps to the xs:string XML schema type )
+        */
+       public $DBName;
+
+       /**
+        * @var string $DBhostName host name of database server
+        * (maps to the xs:anyURI XML schema type )
+        */
+       public $DBHostName;
+
+       /**
+        * @var int $DBport port of the database server
+        * (maps to the xs:unsignedInt XML schema type )
+        */
+       public $DBPort;
+}
+?>

Added: 
incubator/stonehenge/trunk/stocktrader/php/config_service/conf/database_config.xml
URL: 
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/config_service/conf/database_config.xml?rev=743211&view=auto
==============================================================================
--- 
incubator/stonehenge/trunk/stocktrader/php/config_service/conf/database_config.xml
 (added)
+++ 
incubator/stonehenge/trunk/stocktrader/php/config_service/conf/database_config.xml
 Wed Feb 11 04:10:09 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/config_service/config_svc.php
URL: 
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc.php?rev=743211&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc.php 
(added)
+++ incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc.php 
Wed Feb 11 04:10:09 2009
@@ -0,0 +1,660 @@
+<?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 ("config_svc_processor.php");
+
+/** Set database configurations of a DB
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object DBConfig $DBConfig
+ */
+function storeDBConfig($DBConfig)
+{
+       if($DBConfig)
+       {
+               /* we support MSSQL and MySQL only. If DBName is something 
else, we should not process anything */
+               if(($DBConfig->DBName == DBNAME_MSSQL) || ($DBConfig->DBName == 
DBNAME_MYSQL))
+               {
+                       $dbhandle = ConnectToDatabase();
+
+                       /* "BEGIN TRAN" initialize a transaction; which 
privides control so that later we can cancel 
+                        * the transaction, if something goes wrong. */
+                       if(ExecuteQuery("BEGIN TRAN"))
+                       {
+                               $result = getDBConfig($DBConfig->DBName);
+                               if($result)
+                               {
+                                       /* this detail is already available. So 
we should update the records */
+                                       $query = "UPDATE DBCONFIG WITH 
(ROWLOCK) SET HOSTNAME='$DBConfig->DBHostName', ".
+                                          "PORT='$DBConfig->DBPort' WHERE 
DBNAME = '$DBConfig->DBName'";
+                                       $status = ExecuteQuery($query);
+                               }
+                               else
+                               {
+                                       /* details related to this database is 
not stored. So we have to insert a new record */
+                                       $query = "INSERT INTO DBCONFIG (DBNAME, 
HOSTNAME, PORT, ACTIVE) VALUES (".
+                                               "'$DBConfig->DBName', 
'$DBConfig->DBHostName', '$DBConfig->DBPort', 'N');";
+                                       $status = ExecuteQuery($query);
+                               }
+
+                               if($status)
+                               {
+                                       /* Transaction is successfull, we can 
safely commit the transaction into the database. */
+                                       ExecuteQuery("COMMIT TRAN");
+                               }
+                               else
+                               {
+                                       /* Transaction is not successfull, we 
have to rollback the transaction */
+                                       ExecuteQuery("ROLLBACK TRAN");
+                                       error_log("Storing DBConfig failed. 
\n");
+                               }
+                       }
+                       else
+                       {
+                               error_log("Cannot initialise a transaction 
using BEGIN TRAN. \n");
+                       }
+
+                       CloseDatabase($dbhandle);
+               }
+               else
+               {
+                       error_log("Cannot support database $DBConfig->DBName. 
Supported databases are ".
+                               DBNAME_MSSQL." and ".DBNAME_MYSQL.".\n");
+               }
+       }
+}
+
+/** Get database configuration for all DBs
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object GetDBConfigs $GetDBConfigs
+ * @return object DBConfigs $DBConfigs
+ */
+function getDBConfigs($GetDBConfigs)
+{
+       $dbhandle = ConnectToDatabase();
+
+       $query = "Set NOCOUNT ON; SELECT DBNAME, HOSTNAME, PORT FROM DBCONFIG";
+
+       $result =  ExecuteQuery($query);
+       if ($result)
+       {
+               $rowNum = 0;
+               $DBConfigs = new DBConfigs();
+               while($DBName = GetMSSQLValue($result, $rowNum, 0))
+               {
+                       $config = new DBConfig();
+                       $config->DBName =  $DBName;     //Get the DB Name
+                       $config->DBHostName = GetMSSQLValue($result, $rowNum, 
1); //Get the host name.
+                       $config->DBPort = GetMSSQLValue($result, $rowNum, 2);   
//Get the port
+                       $DBConfigs->DBConfig[$rowNum] = $config;
+                       $rowNum = $rowNum + 1;
+               }
+       }
+
+       CloseDatabase($dbhandle);
+       return $DBConfigs;
+}
+
+/** Sets active database.
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object ActiveDB $ActiveDB Name of the active database
+ */
+function setActiveDB($ActiveDB)
+{
+       if($ActiveDB)
+       {
+               $DBName = $ActiveDB->DBName;
+               /* we support MSSQL and MySQL only. If DBName is something 
else, we should not process anything */
+               if(($DBName == DBNAME_MSSQL) || ($DBName == DBNAME_MYSQL))
+               {
+                       
+                       $dbhandle = ConnectToDatabase();
+
+                       /* check whether DBConfig related to this database is 
already there. If not there, we can't 
+                        * set it as active */
+                       if(getDBConfig($DBName))
+                       {
+                               /* "BEGIN TRAN" initialize a transaction; which 
privides control so that later we can cancel 
+                                * the transaction, if something goes wrong. */
+                               if(ExecuteQuery("BEGIN TRAN"))
+                               {
+                                       $query = "UPDATE DBCONFIG WITH 
(ROWLOCK) SET ACTIVE='Y' WHERE DBNAME='$DBName'";
+                                       $status = ExecuteQuery($query);
+
+                                       if($status)
+                                       {
+                                               /* Transaction is successfull, 
we can safely commit the transaction into the database. */
+                                               ExecuteQuery("COMMIT TRAN");
+                                       }
+                                       else
+                                       {
+                                               /* Transaction is not 
successfull, we have to rollback the transaction */
+                                               ExecuteQuery("ROLLBACK TRAN");
+                                               error_log("Storing Active DB 
failed. \n");
+                                       }
+                               }
+                               else
+                               {
+                                       error_log("Cannot initialise a 
transaction using BEGIN TRAN. \n");
+                               }
+                       }
+                       else
+                       {
+                               error_log("Cannot find DBConfig related to 
$DBName. Could not be able to set active \n");
+                       }
+                       CloseDatabase($dbhandle);
+               }
+               else
+               {
+                       error_log("Cannot set database $DBName as active. 
Supported databases are ".
+                               DBNAME_MSSQL." and ".DBNAME_MYSQL.".\n");
+               }
+       }
+}
+
+/** Get active database.
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object GetActiveDB $GetActiveDB
+ * @return object ActiveDB $CurrentActiveDB Name of the active database
+ */
+function getActiveDB($GetActiveDB)
+{
+       $dbhandle = ConnectToDatabase();
+
+       $DBConfig = getActiveDBConfig();
+       if($DBConfig)
+       {
+               $config = new ActiveDB();
+               $config->DBName = $DBConfig->DBName;
+       }
+       else
+       {
+               error_log("Cannot find details about active database \n");
+       }
+
+       CloseDatabase($dbhandle);
+       return $config;
+}
+
+/** Sets service location (End point URL) of a given service.
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object ServiceLocation $ServiceLocation
+ */
+function setServiceLocation($ServiceLocation)
+{
+       if($ServiceLocation)
+       {
+               if(isBusinessServiceDefined($ServiceLocation->ServiceName)
+                       || 
isOrderProcessorServiceDefined($ServiceLocation->ServiceName)
+                       || 
isOrderProcessorSecDefined($ServiceLocation->ServiceName))
+               {
+                       $dbhandle = ConnectToDatabase();
+
+                       /* "BEGIN TRAN" initialize a transaction; which 
privides control so that later we can cancel 
+                        * the transaction, if something goes wrong. */
+                       if(ExecuteQuery("BEGIN TRAN"))
+                       {
+                               $result = 
getServiceLocation($ServiceLocation->ServiceName);
+                               if($result)
+                               {
+                                       /* this detail is already available. So 
we should update the records */
+                                       $query = "UPDATE SERVICE WITH (ROWLOCK) 
SET URL='$ServiceLocation->ServiceURL' ".
+                                          "WHERE SERVICENAME = 
'$ServiceLocation->ServiceName'";
+                                       $status = ExecuteQuery($query);
+                               }
+                               else
+                               {
+                                       /* details related to this database is 
not stored. So we have to insert a new record */
+                                       $query = "INSERT INTO SERVICE 
(SERVICENAME, URL) VALUES (".
+                                               
"'$ServiceLocation->ServiceName', '$ServiceLocation->ServiceURL')";
+                                       $status = ExecuteQuery($query);
+                               }
+                               
+
+                               if($status)
+                               {
+                                       /* Transaction is successfull, we can 
safely commit the transaction into the database. */
+                                       ExecuteQuery("COMMIT TRAN");
+                               }
+                               else
+                               {
+                                       /* Transaction is not successfull, we 
have to rollback the transaction */
+                                       ExecuteQuery("ROLLBACK TRAN");
+                                       error_log("Storing service location 
configuration failed. \n");
+                               }
+                       }
+                       else
+                       {
+                               error_log("Cannot initialise a transaction 
using BEGIN TRAN. \n");
+                       }
+
+                       CloseDatabase($dbhandle);
+               }
+               else
+               {
+                       error_log("Service name $ServiceLocation->ServiceName 
is not supported by the system.\n");
+               }
+       }
+}
+
+/** Gets all service locations
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object GetServiceLocations $GetServiceLocations
+ * @return object ServiceLocations $ServiceLocations
+ */
+function getServiceLocations($GetServiceLocations)
+{
+       $dbhandle = ConnectToDatabase();
+
+       $query = "Set NOCOUNT ON; SELECT SERVICENAME, URL FROM SERVICE";
+
+       $result =  ExecuteQuery($query);
+       if ($result)
+       {
+               $rowNum = 0;
+               $ServiceLocations = new ServiceLocations();
+               while($ServiceName = GetMSSQLValue($result, $rowNum, 0))
+               {
+                       $config = new ServiceLocation();
+                       $config->ServiceName =  $ServiceName;   //Get the 
service name 
+                       $config->ServiceURL = GetMSSQLValue($result, $rowNum, 
1); //Get the URL
+                       $ServiceLocations->ServiceLocation[$rowNum] = $config;
+                       $rowNum = $rowNum + 1;
+               }
+       }
+
+       CloseDatabase($dbhandle);
+       return $ServiceLocations;
+}
+
+/** Sets connection from client to business service
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object ClientToBS $ClientToBS
+ */
+function setConnectionFromClientToBS($ClientToBS)
+{
+       if($ClientToBS)
+       {
+               /* check whether given business service and client name are 
valid */
+               if(isBusinessServiceDefined($ClientToBS->BS))
+               {
+                       if(isClientDefined($ClientToBS->Client))
+                       {
+                               /* both client name and business service are 
valid. we can store it */
+                               $dbhandle = ConnectToDatabase();
+
+                               /* "BEGIN TRAN" initialize a transaction; which 
privides control so that later we can cancel 
+                                * the transaction, if something goes wrong. */
+                               if(ExecuteQuery("BEGIN TRAN"))
+                               {
+                                       $result = 
getClientToBS($ClientToBS->Client);
+                                       if($result)
+                                       {
+                                               /* this detail is already 
available. So we should update the records */
+                                               $query = "UPDATE CLIENTTOBS 
WITH (ROWLOCK) SET BS='$ClientToBS->BS' ".
+                                                  "WHERE CLIENT = 
'$ClientToBS->Client'";
+                                               $status = ExecuteQuery($query);
+                                       }
+                                       else
+                                       {
+                                               /* details related to this 
database is not stored. So we have to insert a new record */
+                                               $query = "INSERT INTO 
CLIENTTOBS (CLIENT, BS) VALUES (".
+                                                       "'$ClientToBS->Client', 
'$ClientToBS->BS')";
+                                               $status = ExecuteQuery($query);
+                                       }
+
+                                       if($status)
+                                       {
+                                               /* Transaction is successfull, 
we can safely commit the transaction into the database. */
+                                               ExecuteQuery("COMMIT TRAN");
+                                       }
+                                       else
+                                       {
+                                               /* Transaction is not 
successfull, we have to rollback the transaction */
+                                               ExecuteQuery("ROLLBACK TRAN");
+                                               error_log("Storing service 
location configuration failed. \n");
+                                       }
+                               }
+                               else
+                               {
+                                       error_log("Cannot initialise a 
transaction using BEGIN TRAN. \n");
+                               }
+
+                               CloseDatabase($dbhandle);
+                       }
+                       else
+                       {
+                               error_log("Client with name $ClientToBS->Client 
is not supported by the system. \n");
+                       }
+               }
+               else
+               {
+                       error_log("Business service with name $ClientToBS->BS 
is not supported by the system. \n");
+               }
+       }
+}
+
+/** Get all connections from client to business service
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object GetClientToBSConnections $GetClientToBSConnections 
+ * @return object ClientToBSConnections $ClientToBSConnections
+ */
+function getClientToBSConnections($GetClientToBSConnections)
+{
+       $dbhandle = ConnectToDatabase();
+
+       $query = "Set NOCOUNT ON; SELECT CLIENT, BS FROM CLIENTTOBS";
+
+       $result =  ExecuteQuery($query);
+       if ($result)
+       {
+               $rowNum = 0;
+               $ClientToBSConnections = new ClientToBSConnections();
+               while($ClientName = GetMSSQLValue($result, $rowNum, 0))
+               {
+                       $config = new ClientToBS();
+                       $config->Client =  $ClientName; //Get the client name 
+                       $config->BS = GetMSSQLValue($result, $rowNum, 1); //Get 
the BS Name
+                       $ClientToBSConnections->ClientToBS[$rowNum] = $config;
+                       $rowNum = $rowNum + 1;
+               }
+       }
+
+       CloseDatabase($dbhandle);
+       return $ClientToBSConnections;
+}
+
+/** Sets connection from business service to order processor service
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object BSToOPS $BSToOPS
+ */
+function setConnectionFromBSToOPS($BSToOPS)
+{
+       if($BSToOPS)
+       {
+               /* check whether given business service and order processor 
service are valid */
+               if(isBusinessServiceDefined($BSToOPS->BS))
+               {
+                       if(isOrderProcessorServiceDefined($BSToOPS->OPS) || 
isOrderProcessorSecDefined($BSToOPS->OPS))
+                       {
+                               /* both order processor and business service 
are valid. we can store it */
+                               $dbhandle = ConnectToDatabase();
+
+                               /* "BEGIN TRAN" initialize a transaction; which 
privides control so that later we can cancel 
+                                * the transaction, if something goes wrong. */
+                               if(ExecuteQuery("BEGIN TRAN"))
+                               {
+                                       $result = getBSToOPS($BSToOPS->BS);
+                                       if($result)
+                                       {
+                                               /* this detail is already 
available. So we should update the records */
+                                               $query = "UPDATE BSTOOPS WITH 
(ROWLOCK) SET OPS='$BSToOPS->OPS' ".
+                                                  "WHERE BS = '$BSToOPS->BS'";
+                                               $status = ExecuteQuery($query);
+                                       }
+                                       else
+                                       {
+                                               /* details related to this 
database is not stored. So we have to insert a new record */
+                                               $query = "INSERT INTO BSTOOPS 
(BS, OPS) VALUES ('$BSToOPS->BS', '$BSToOPS->OPS')";
+                                               $status = ExecuteQuery($query);
+                                       }
+
+                                       if($status)
+                                       {
+                                               /* Transaction is successfull, 
we can safely commit the transaction into the database. */
+                                               ExecuteQuery("COMMIT TRAN");
+                                       }
+                                       else
+                                       {
+                                               /* Transaction is not 
successfull, we have to rollback the transaction */
+                                               ExecuteQuery("ROLLBACK TRAN");
+                                               error_log("Storing service 
location configuration failed. \n");
+                                       }
+                               }
+                               else
+                               {
+                                       error_log("Cannot initialise a 
transaction using BEGIN TRAN. \n");
+                               }
+
+                               CloseDatabase($dbhandle);
+                       }
+                       else
+                       {
+                               error_log("Order processor with name 
$BSToOPS->OPS is not supported by the system. \n");
+                       }
+               }
+               else
+               {
+                       error_log("Business service with name $BSToOPS->BS is 
not supported by the system. \n");
+               }
+       }
+}
+
+/** Get all connections from business service to order processor service
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object GetBSToOPSConnections $GetBSToOPSConnections 
+ * @return object BSToOPSConnections $BSToOPSConnections
+ */
+function getBSToOPSConnections($GetBSToOPSConnections)
+{
+       $dbhandle = ConnectToDatabase();
+
+       $query = "Set NOCOUNT ON; SELECT BS, OPS FROM BSTOOPS";
+
+       $result =  ExecuteQuery($query);
+       if ($result)
+       {
+               $rowNum = 0;
+               $BSToOPSConnections = new BSToOPSConnections();
+               while($BSName = GetMSSQLValue($result, $rowNum, 0))
+               {
+                       $config = new BSToOPS();
+                       $config->BS =  $BSName; //Get the BS name 
+                       $config->OPS = GetMSSQLValue($result, $rowNum, 1); 
//Get the OPS Name
+                       $BSToOPSConnections->BSToOPS[$rowNum] = $config;
+                       $rowNum = $rowNum + 1;
+               }
+       }
+
+       CloseDatabase($dbhandle);
+       return $BSToOPSConnections;
+}
+
+/** Get configurations of a client
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object ClientConfigRequest $ClientConfigRequest
+ * @return object ClientConfigResponse $ClientConfigResponse End point url of 
business service
+ */
+function getClientConfig($ClientConfigRequest)
+{
+       if($ClientConfigRequest)
+       {
+               $dbhandle = ConnectToDatabase();
+
+               $ClientToBS = getClientToBS($ClientConfigRequest->Client);
+               if($ClientToBS)
+               {
+                       $serviceLocation = getServiceLocation($ClientToBS->BS);
+                       if($serviceLocation)
+                       {
+                               $config = new ClientConfigResponse();
+                               $config->BS = $serviceLocation->ServiceURL;
+                       }
+                       else
+                       {
+                               error_log("Cannot find service location for 
business service $ClientToBS->BS \n");
+                       }
+               }
+               else
+               {
+                       error_log("Cannot find details about business service 
connected to clinet ".
+                               "[$ClientConfigRequest->Client]. \n");
+               }
+
+               CloseDatabase($dbhandle);
+       }
+
+       return $config;
+}
+
+/** Get configurations of a business service
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object BSConfigRequest $BSConfigRequest Name of the business service
+ * @return object BSConfigResponse $BSConfigResponse
+ */
+function getBSConfig($BSConfigRequest)
+{
+       if($BSConfigRequest)
+       {
+               $dbhandle = ConnectToDatabase();
+
+               $BSToOPS = getBSToOPS($BSConfigRequest->BS);
+               if($BSToOPS)
+               {
+                       $serviceLocation = getServiceLocation($BSToOPS->OPS);
+                       if($serviceLocation)
+                       {
+                               /* found the end point url of order processor 
service. Now check for active database settings */
+                               $DBConfig = getActiveDBConfig();
+                               if($DBConfig)
+                               {
+                                       $config = new BSConfigResponse();
+                                       $config->DBName = $DBConfig->DBName;
+                                       $config->DBHostName = 
$DBConfig->DBHostName;
+                                       $config->DBPort = $DBConfig->DBPort;
+                                       $config->OPS = 
$serviceLocation->ServiceURL;
+                                       
if(isOrderProcessorSecDefined($BSToOPS->OPS))
+                                       {
+                                               $config->Sec = true;
+                                       }
+                                       else
+                                       {
+                                               $config->Sec = false;
+                                       }
+                               }
+                               else
+                               {
+                                       error_log("Cannot find details about 
active database \n");
+                               }
+                       }
+                       else
+                       {
+                               error_log("Cannot find service location for 
order processor service $BSToOPS->OPS \n");
+                       }
+               }
+               else
+               {
+                       error_log("Cannot find details about order processor 
service connected to business service ".
+                          " [$BSConfigRequest->BS]. \n");
+               }
+
+               CloseDatabase($dbhandle);
+       }
+       return $config;
+}
+
+/** Get configurations of a order processor service
+ * @namespace http://wso2.org/interop/stocktrader
+ * @param object OPSConfigRequest $OPSConfigRequest
+ * @return object OPSConfigResponse $OPSConfigResponse
+ */
+function getOPSConfig($OPS)
+{
+       $dbhandle = ConnectToDatabase();
+
+       $DBConfig = getActiveDBConfig();
+       if($DBConfig)
+       {
+               $config = new OPSConfigResponse();
+               $config->DBName = $DBConfig->DBName;
+               $config->DBHostName = $DBConfig->DBHostName;
+               $config->DBPort = $DBConfig->DBPort;
+       }
+       else
+       {
+               error_log("Cannot find details about active database \n");
+       }
+
+       CloseDatabase($dbhandle);
+       return $config;
+}
+
+$operations = array(
+       "DBConfig"=>"storeDBConfig", 
+       "GetDBConfigs" => "getDBConfigs",
+       "ActiveDB" => "setActiveDB", 
+       "GetActiveDB" => "getActiveDB",
+       "ServiceLocation" => "setServiceLocation", 
+       "GetServiceLocations" => "getServiceLocations",
+       "ClientToBS" => "setConnectionFromClientToBS",
+       "GetClientToBSConnections" => "getClientToBSConnections",
+       "BSToOPS" => "setConnectionFromBSToOPS",
+       "GetBSToOPSConnections" => "getBSToOPSConnections", 
+       "ClientConfigRequest" => "getClientConfig", 
+       "BSConfigRequest" => "getBSConfig",
+       "OPSConfigRequest" => "getOPSConfig"
+);
+
+$opParams = array(
+       "storeDBConfig"=>"MIXED", 
+       "getDBConfigs" => "MIXED",
+       "setActiveDB" => "MIXED", 
+       "getActiveDB" => "MIXED",
+       "setServiceLocation" => "MIXED",
+       "getServiceLocations" => "MIXED",
+       "setConnectionFromClientToBS" => "MIXED",
+       "getClientToBSConnections" => "MIXED",
+       "setConnectionFromBSToOPS" => "MIXED",
+       "getBSToOPSConnections" => "MIXED",
+       "getClientConfig" => "MIXED",
+       "getBSConfig" => "MIXED",
+       "getOPSConfig" => "MIXED"
+);
+
+$classmap = array(
+       "DBConfig" => "DBConfig",
+       "GetDBConfigs" => "GetDBConfigs",
+       "DBConfigs" => "DBConfigs",
+       "ActiveDB" => "ActiveDB",
+       "GetActiveDB" => "GetActiveDB",
+       "ServiceLocation" => "ServiceLocation",
+       "GetServiceLocations" => "GetServiceLocations",
+       "ServiceLocations" => "ServiceLocations",
+       "ClientToBS" => "ClientToBS", 
+       "GetClientToBSConnections" => "GetClientToBSConnections",
+       "BSToOPS" => "BSToOPS",
+       "GetBSToOPSConnections" => "GetBSToOPSConnections",
+       "ClientConfigRequest" => "ClientConfigRequest", 
+       "ClientConfigResponse" => "ClientConfigResponse",
+       "BSConfigRequest" => "BSConfigRequest",
+       "BSConfigResponse" => "BSConfigResponse",
+       "OPSConfigRequest" => "OPSConfigRequest",
+       "OPSConfigResponse" => "OPSConfigResponse");
+
+$svr = new WSService(array(
+       "operations"=>$operations, 
+       "bindingStyle"=>"doclit", 
+       "opParams" => $opParams, 
+       "serviceName" => "config_svc",
+       "wsdl" => "wsdl/config_svc.wsdl",
+       "classmap" => $classmap));
+
+
+$svr->reply();
+
+
+?>

Added: 
incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc_processor.php
URL: 
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc_processor.php?rev=743211&view=auto
==============================================================================
--- 
incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc_processor.php
 (added)
+++ 
incubator/stonehenge/trunk/stocktrader/php/config_service/config_svc_processor.php
 Wed Feb 11 04:10:09 2009
@@ -0,0 +1,229 @@
+<?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 ("data_access_layer.php");
+require_once ("class_info.php");
+
+define ("DBNAME_MSSQL", "MSSQL");
+define ("DBNAME_MYSQL", "MySQL");
+define ("STATUS_SUCCESS", 1);  //This represents a success status.
+define ("STATUS_FAILURE", 0);  //This represents a failure status.
+
+define ("SERVICE_NAME_DOTNET_BS", "DOTNET_BS");
+define ("SERVICE_NAME_PHP_BS", "PHP_BS");
+define ("SERVICE_NAME_JAVA_BS", "JAVA_BS");
+define ("SERVICE_NAME_SPRING_BS", "SPRING_BS");
+define ("SERVICE_NAME_PERL_BS", "PERL_BS");
+define ("SERVICE_NAME_DOTNET_OPS", "DOTNET_OPS");
+define ("SERVICE_NAME_PHP_OPS", "PHP_OPS");
+define ("SERVICE_NAME_JAVA_OPS", "JAVA_OPS");
+define ("SERVICE_NAME_SPRING_OPS", "SPRING_OPS");
+define ("SERVICE_NAME_PERL_OPS", "PERL_OPS");
+define ("SERVICE_NAME_RUBY_OPS", "RUBY_OPS");
+define ("SERVICE_NAME_DOTNET_OPSSEC", "DOTNET_OPSSEC");
+define ("SERVICE_NAME_PHP_OPSSEC", "PHP_OPSSEC");
+define ("SERVICE_NAME_JAVA_OPSSEC", "JAVA_OPSSEC");
+define ("SERVICE_NAME_SPRING_OPSSEC", "SPRING_OPSSEC");
+define ("SERVICE_NAME_PERL_OPSSEC", "PERL_OPSSEC");
+define ("SERVICE_NAME_RUBY_OPSSEC", "RUBY_OPSSEC");
+define ("CLIENT_NAME_DOTNET", "DOTNET_CLIENT");
+define ("CLIENT_NAME_PHP", "PHP_CLIENT");
+define ("CLIENT_NAME_RUBY", "RUBY_CLIENT");
+
+/** 
+ * Checks whether given name is a valid Business Service name 
+ * @param $serviceName name of the service
+ * @return STATUS_SUCCESS if valid BS Name. STATUS_FAILURE if not
+ */
+function isBusinessServiceDefined($serviceName)
+{
+       if(($serviceName == SERVICE_NAME_DOTNET_BS) ||
+          ($serviceName == SERVICE_NAME_PHP_BS) ||
+          ($serviceName == SERVICE_NAME_JAVA_BS) ||
+          ($serviceName == SERVICE_NAME_SPRING_BS) ||
+          ($serviceName == SERVICE_NAME_PERL_BS))
+       {
+               return STATUS_SUCCESS;
+       }
+       else
+       {
+               return STATUS_FAILURE;
+       }
+}
+
+/** 
+ * Checks whether given name is a valid Order Processor Service (Non-secure) 
name 
+ * @param $serviceName name of the service
+ * @return STATUS_SUCCESS if valid BS Name. STATUS_FAILURE if not
+ */
+function isOrderProcessorServiceDefined($serviceName)
+{
+       if(($serviceName == SERVICE_NAME_DOTNET_OPS) ||
+          ($serviceName == SERVICE_NAME_PHP_OPS) ||
+          ($serviceName == SERVICE_NAME_JAVA_OPS) ||
+          ($serviceName == SERVICE_NAME_SPRING_OPS) ||
+          ($serviceName == SERVICE_NAME_RUBY_OPS) ||
+          ($serviceName == SERVICE_NAME_PERL_OPS))
+       {
+               return STATUS_SUCCESS;
+       }
+       else
+       {
+               return STATUS_FAILURE;
+       }
+}
+
+/** 
+ * Checks whether given name is a valid Order Processor Service (secure) name 
+ * @param $serviceName name of the service
+ * @return STATUS_SUCCESS if valid BS Name. STATUS_FAILURE if not
+ */
+function isOrderProcessorSecDefined($serviceName)
+{
+       if(($serviceName == SERVICE_NAME_DOTNET_OPSSEC) ||
+          ($serviceName == SERVICE_NAME_PHP_OPSSEC) ||
+          ($serviceName == SERVICE_NAME_JAVA_OPSSEC) ||
+          ($serviceName == SERVICE_NAME_SPRING_OPSSEC) ||
+          ($serviceName == SERVICE_NAME_RUBY_OPSSEC) ||
+          ($serviceName == SERVICE_NAME_PERL_OPSSEC))
+       {
+               return STATUS_SUCCESS;
+       }
+       else
+       {
+               return STATUS_FAILURE;
+       }
+}
+
+/** 
+ * Checks whether given name is a valid client name 
+ * @param $clientName name of the client
+ * @return STATUS_SUCCESS if valid client Name. STATUS_FAILURE if not
+ */
+function isClientDefined($clientName)
+{
+       if(($clientName == CLIENT_NAME_DOTNET) ||
+          ($clientName == CLIENT_NAME_PHP) ||
+          ($clientName == CLIENT_NAME_RUBY))
+       {
+               return STATUS_SUCCESS;
+       }
+       else
+       {
+               return STATUS_FAILURE;
+       }
+}
+
+/**
+ * gets Service Location of given service
+ * @param $serviceName service name for which we have to find config details
+ * @return if successful, ServiceLocation object filled with information. NULL 
otherwise
+ */
+function getServiceLocation($serviceName)
+{
+       $query = "Set NOCOUNT ON; SELECT SERVICENAME, URL FROM SERVICE WHERE 
SERVICENAME = '$serviceName'";
+
+       $result =  ExecuteQuery($query);
+       if (($result) && (GetMSSQLValue($result, 0, 0)))        //return value 
is having atleast one row
+       {
+               $config = new ServiceLocation();
+               $config->ServiceName =  $serviceName;
+               $config->ServiceURL = GetMSSQLValue($result, 0, 1); //Get the 
url of the service
+       }
+       return $config;
+}
+
+/**
+ * gets connection between client and BS
+ * @param $client client name for which we have to find config details
+ * @return if successful, ClientToBS object filled with information. NULL 
otherwise
+ */
+function getClientToBS($client)
+{
+       $query = "Set NOCOUNT ON; SELECT CLIENT, BS FROM CLIENTTOBS WHERE 
CLIENT = '$client'";
+
+       $result =  ExecuteQuery($query);
+       if (($result) && (GetMSSQLValue($result, 0, 0)))        //return value 
is having atleast one row
+       {
+               $config = new ClientToBS();
+               $config->Client =  $client;
+               $config->BS = GetMSSQLValue($result, 0, 1); //Get the BS name 
connected to client
+       }
+       return $config;
+}
+
+/**
+ * gets connection between BS and OPS
+ * @param $BS business service name for which we have to find config details
+ * @return if successful, BSToOPS object filled with information. NULL 
otherwise
+ */
+function getBSToOPS($BS)
+{
+       $query = "Set NOCOUNT ON; SELECT BS, OPS FROM BSTOOPS WHERE BS = '$BS'";
+
+       $result =  ExecuteQuery($query);
+       if (($result) && (GetMSSQLValue($result, 0, 0)))                
//return value is having atleast one row
+       {
+               $config = new BSToOPS();
+               $config->BS =  $BS;
+               $config->OPS = GetMSSQLValue($result, 0, 1); //Get the OPS name 
connected to BS
+       }
+       return $config;
+}
+
+/**
+ * gets DBConfig of given database
+ * @param $DBName database name for which we have to find config details
+ * @return if successful, DBConfig object filled with information. NULL 
otherwise
+ */
+function getDBConfig($DBName)
+{
+       $query = "Set NOCOUNT ON; SELECT DBNAME, HOSTNAME, PORT FROM DBCONFIG 
WHERE DBNAME = '$DBName'";
+
+       $result =  ExecuteQuery($query);
+       if (($result) && (GetMSSQLValue($result, 0, 0)))                
//return value is having atleast one row
+       {
+               $config = new DBConfig();
+               $config->DBName =  $DBName;
+               $config->DBHostName = GetMSSQLValue($result, 0, 1); //Get the 
host name.
+               $config->DBPort = GetMSSQLValue($result, 0, 2);         //Get 
the port
+       }
+       return $config;
+}
+
+/**
+ * gets DBConfig of active database
+ * @return if successful, DBConfig object filled with information. NULL 
otherwise
+ */
+function getActiveDBConfig()
+{
+       $query = "Set NOCOUNT ON; SELECT DBNAME, HOSTNAME, PORT FROM DBCONFIG 
WHERE ACTIVE = 'Y'";
+
+       $result =  ExecuteQuery($query);
+       if (($result) && (GetMSSQLValue($result, 0, 0)))                
//return value is having atleast one row
+       {
+               $config = new DBConfig();
+               $config->DBName =  GetMSSQLValue($result, 0, 0);        //Get 
the db name.
+               $config->DBHostName = GetMSSQLValue($result, 0, 1); //Get the 
host name.
+               $config->DBPort = GetMSSQLValue($result, 0, 2);         //Get 
the port
+       }
+       return $config;
+}
+
+?>

Added: 
incubator/stonehenge/trunk/stocktrader/php/config_service/data_access_layer.php
URL: 
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/config_service/data_access_layer.php?rev=743211&view=auto
==============================================================================
--- 
incubator/stonehenge/trunk/stocktrader/php/config_service/data_access_layer.php 
(added)
+++ 
incubator/stonehenge/trunk/stocktrader/php/config_service/data_access_layer.php 
Wed Feb 11 04:10:09 2009
@@ -0,0 +1,123 @@
+<?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.
+ */
+
+
+/**
+ * This class encapsulates information regarding the establishment
+ * of database connection.
+ */
+
+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/config_service/wsdl/config_svc.wsdl
URL: 
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/config_service/wsdl/config_svc.wsdl?rev=743211&view=auto
==============================================================================
--- 
incubator/stonehenge/trunk/stocktrader/php/config_service/wsdl/config_svc.wsdl 
(added)
+++ 
incubator/stonehenge/trunk/stocktrader/php/config_service/wsdl/config_svc.wsdl 
Wed Feb 11 04:10:09 2009
@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:tns="http://wso2.org/interop/stocktrader"; 
xmlns:tnx="http://wso2.org/interop/stocktrader/xsd"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:http="http://www.w3.org/2003/05/soap/bindings/HTTP/"; 
targetNamespace="http://wso2.org/interop/stocktrader";>
+ <types>
+  <xsd:schema elementFormDefault="qualified" 
targetNamespace="http://wso2.org/interop/stocktrader/xsd"; 
xmlns:ns0="http://wso2.org/interop/stocktrader/xsd"; 
xmlns:ns1="http://wso2.org/interop/stocktrader/xsd"; 
xmlns:ns2="http://wso2.org/interop/stocktrader/xsd"; 
xmlns:ns3="http://wso2.org/interop/stocktrader/xsd"; 
xmlns:ns4="http://wso2.org/interop/stocktrader/xsd"; 
xmlns:ns5="http://wso2.org/interop/stocktrader/xsd";>
+   <xsd:complexType name="OPSConfigRequest">
+    <xsd:sequence/>
+   </xsd:complexType>
+   <xsd:element name="OPSConfigRequest" type="ns0:OPSConfigRequest"/>
+   <xsd:complexType name="OPSConfigResponse">
+    <xsd:sequence>
+     <xsd:element name="DBName" type="xsd:string"/>
+     <xsd:element name="DBHostName" type="xsd:anyURI"/>
+     <xsd:element name="DBPort" type="xsd:unsignedInt"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="OPSConfigResponse" type="ns0:OPSConfigResponse"/>
+   <xsd:complexType name="ActiveDB">
+    <xsd:sequence>
+     <xsd:element name="DBName" type="xsd:string"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="ActiveDB" type="ns0:ActiveDB"/>
+   <xsd:element name="setActiveDBResponse">
+    <xsd:complexType>
+     <xsd:sequence/>
+    </xsd:complexType>
+   </xsd:element>
+   <xsd:complexType name="GetActiveDB">
+    <xsd:sequence/>
+   </xsd:complexType>
+   <xsd:element name="GetActiveDB" type="ns0:GetActiveDB"/>
+   <xsd:element name="CurrentActiveDB" type="ns1:ActiveDB"/>
+   <xsd:complexType name="BSConfigRequest">
+    <xsd:sequence>
+     <xsd:element name="BS" type="xsd:string"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="BSConfigRequest" type="ns0:BSConfigRequest"/>
+   <xsd:complexType name="BSConfigResponse">
+    <xsd:sequence>
+     <xsd:element name="DBName" type="xsd:string"/>
+     <xsd:element name="DBHostName" type="xsd:anyURI"/>
+     <xsd:element name="DBPort" type="xsd:unsignedInt"/>
+     <xsd:element name="OPS" type="xsd:anyURI"/>
+     <xsd:element name="Sec" type="xsd:boolean"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="BSConfigResponse" type="ns0:BSConfigResponse"/>
+   <xsd:complexType name="ClientToBS">
+    <xsd:sequence>
+     <xsd:element name="Client" type="xsd:string"/>
+     <xsd:element name="BS" type="xsd:string"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="ClientToBS" type="ns0:ClientToBS"/>
+   <xsd:element name="setConnectionFromClientToBSResponse">
+    <xsd:complexType>
+     <xsd:sequence/>
+    </xsd:complexType>
+   </xsd:element>
+   <xsd:complexType name="ServiceLocation">
+    <xsd:sequence>
+     <xsd:element name="ServiceName" type="xsd:string"/>
+     <xsd:element name="ServiceURL" type="xsd:anyURI"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="ServiceLocation" type="ns0:ServiceLocation"/>
+   <xsd:element name="setServiceLocationResponse">
+    <xsd:complexType>
+     <xsd:sequence/>
+    </xsd:complexType>
+   </xsd:element>
+   <xsd:complexType name="GetClientToBSConnections">
+    <xsd:sequence/>
+   </xsd:complexType>
+   <xsd:element name="GetClientToBSConnections" 
type="ns0:GetClientToBSConnections"/>
+   <xsd:complexType name="ClientToBSConnections">
+    <xsd:sequence>
+     <xsd:element name="ClientToBS" maxOccurs="unbounded" 
type="ns2:ClientToBS"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="ClientToBSConnections" type="ns0:ClientToBSConnections"/>
+   <xsd:complexType name="BSToOPS">
+    <xsd:sequence>
+     <xsd:element name="BS" type="xsd:string"/>
+     <xsd:element name="OPS" type="xsd:string"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="BSToOPS" type="ns0:BSToOPS"/>
+   <xsd:element name="setConnectionFromBSToOPSResponse">
+    <xsd:complexType>
+     <xsd:sequence/>
+    </xsd:complexType>
+   </xsd:element>
+   <xsd:complexType name="DBConfig">
+    <xsd:sequence>
+     <xsd:element name="DBName" type="xsd:string"/>
+     <xsd:element name="DBHostName" type="xsd:anyURI"/>
+     <xsd:element name="DBPort" type="xsd:unsignedInt"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="DBConfig" type="ns0:DBConfig"/>
+   <xsd:element name="storeDBConfigResponse">
+    <xsd:complexType>
+     <xsd:sequence/>
+    </xsd:complexType>
+   </xsd:element>
+   <xsd:complexType name="GetServiceLocations">
+    <xsd:sequence/>
+   </xsd:complexType>
+   <xsd:element name="GetServiceLocations" type="ns0:GetServiceLocations"/>
+   <xsd:complexType name="ServiceLocations">
+    <xsd:sequence>
+     <xsd:element name="ServiceLocation" maxOccurs="unbounded" 
type="ns3:ServiceLocation"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="ServiceLocations" type="ns0:ServiceLocations"/>
+   <xsd:complexType name="GetBSToOPSConnections">
+    <xsd:sequence/>
+   </xsd:complexType>
+   <xsd:element name="GetBSToOPSConnections" type="ns0:GetBSToOPSConnections"/>
+   <xsd:complexType name="BSToOPSConnections">
+    <xsd:sequence>
+     <xsd:element name="BSToOPS" maxOccurs="unbounded" type="ns4:BSToOPS"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="BSToOPSConnections" type="ns0:BSToOPSConnections"/>
+   <xsd:complexType name="ClientConfigRequest">
+    <xsd:sequence>
+     <xsd:element name="Client" type="xsd:string"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="ClientConfigRequest" type="ns0:ClientConfigRequest"/>
+   <xsd:complexType name="ClientConfigResponse">
+    <xsd:sequence>
+     <xsd:element name="BS" type="xsd:anyURI"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="ClientConfigResponse" type="ns0:ClientConfigResponse"/>
+   <xsd:complexType name="GetDBConfigs">
+    <xsd:sequence/>
+   </xsd:complexType>
+   <xsd:element name="GetDBConfigs" type="ns0:GetDBConfigs"/>
+   <xsd:complexType name="DBConfigs">
+    <xsd:sequence>
+     <xsd:element name="DBConfig" maxOccurs="unbounded" type="ns5:DBConfig"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="DBConfigs" type="ns0:DBConfigs"/>
+  </xsd:schema>
+ </types>
+ <message name="OPSConfigRequest">
+  <part name="parameters" element="tnx:OPSConfigRequest"/>
+ </message>
+ <message name="OPSConfigRequestResponse">
+  <part name="parameters" element="tnx:OPSConfigResponse"/>
+ </message>
+ <message name="ActiveDB">
+  <part name="parameters" element="tnx:ActiveDB"/>
+ </message>
+ <message name="GetActiveDB">
+  <part name="parameters" element="tnx:GetActiveDB"/>
+ </message>
+ <message name="GetActiveDBResponse">
+  <part name="parameters" element="tnx:CurrentActiveDB"/>
+ </message>
+ <message name="BSConfigRequest">
+  <part name="parameters" element="tnx:BSConfigRequest"/>
+ </message>
+ <message name="BSConfigRequestResponse">
+  <part name="parameters" element="tnx:BSConfigResponse"/>
+ </message>
+ <message name="ClientToBS">
+  <part name="parameters" element="tnx:ClientToBS"/>
+ </message>
+ <message name="ServiceLocation">
+  <part name="parameters" element="tnx:ServiceLocation"/>
+ </message>
+ <message name="GetClientToBSConnections">
+  <part name="parameters" element="tnx:GetClientToBSConnections"/>
+ </message>
+ <message name="GetClientToBSConnectionsResponse">
+  <part name="parameters" element="tnx:ClientToBSConnections"/>
+ </message>
+ <message name="BSToOPS">
+  <part name="parameters" element="tnx:BSToOPS"/>
+ </message>
+ <message name="DBConfig">
+  <part name="parameters" element="tnx:DBConfig"/>
+ </message>
+ <message name="GetServiceLocations">
+  <part name="parameters" element="tnx:GetServiceLocations"/>
+ </message>
+ <message name="GetServiceLocationsResponse">
+  <part name="parameters" element="tnx:ServiceLocations"/>
+ </message>
+ <message name="GetBSToOPSConnections">
+  <part name="parameters" element="tnx:GetBSToOPSConnections"/>
+ </message>
+ <message name="GetBSToOPSConnectionsResponse">
+  <part name="parameters" element="tnx:BSToOPSConnections"/>
+ </message>
+ <message name="ClientConfigRequest">
+  <part name="parameters" element="tnx:ClientConfigRequest"/>
+ </message>
+ <message name="ClientConfigRequestResponse">
+  <part name="parameters" element="tnx:ClientConfigResponse"/>
+ </message>
+ <message name="GetDBConfigs">
+  <part name="parameters" element="tnx:GetDBConfigs"/>
+ </message>
+ <message name="GetDBConfigsResponse">
+  <part name="parameters" element="tnx:DBConfigs"/>
+ </message>
+ <portType name="config_svcPortType">
+  <operation name="OPSConfigRequest">
+   <input message="tns:OPSConfigRequest"/>
+   <output message="tns:OPSConfigRequestResponse"/>
+  </operation>
+  <operation name="ActiveDB">
+   <input message="tns:ActiveDB"/>
+  </operation>
+  <operation name="GetActiveDB">
+   <input message="tns:GetActiveDB"/>
+   <output message="tns:GetActiveDBResponse"/>
+  </operation>
+  <operation name="BSConfigRequest">
+   <input message="tns:BSConfigRequest"/>
+   <output message="tns:BSConfigRequestResponse"/>
+  </operation>
+  <operation name="ClientToBS">
+   <input message="tns:ClientToBS"/>
+  </operation>
+  <operation name="ServiceLocation">
+   <input message="tns:ServiceLocation"/>
+  </operation>
+  <operation name="GetClientToBSConnections">
+   <input message="tns:GetClientToBSConnections"/>
+   <output message="tns:GetClientToBSConnectionsResponse"/>
+  </operation>
+  <operation name="BSToOPS">
+   <input message="tns:BSToOPS"/>
+  </operation>
+  <operation name="DBConfig">
+   <input message="tns:DBConfig"/>
+  </operation>
+  <operation name="GetServiceLocations">
+   <input message="tns:GetServiceLocations"/>
+   <output message="tns:GetServiceLocationsResponse"/>
+  </operation>
+  <operation name="GetBSToOPSConnections">
+   <input message="tns:GetBSToOPSConnections"/>
+   <output message="tns:GetBSToOPSConnectionsResponse"/>
+  </operation>
+  <operation name="ClientConfigRequest">
+   <input message="tns:ClientConfigRequest"/>
+   <output message="tns:ClientConfigRequestResponse"/>
+  </operation>
+  <operation name="GetDBConfigs">
+   <input message="tns:GetDBConfigs"/>
+   <output message="tns:GetDBConfigsResponse"/>
+  </operation>
+ </portType>
+ <binding name="config_svcSOAPBinding" type="tns:config_svcPortType">
+  <soap:binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="OPSConfigRequest">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getOPSConfig"; 
style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="ActiveDB">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/setActiveDB"; 
style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="GetActiveDB">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getActiveDB"; 
style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="BSConfigRequest">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getBSConfig"; 
style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="ClientToBS">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/setConnectionFromClientToBS";
 style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="ServiceLocation">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/setServiceLocation";
 style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="GetClientToBSConnections">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getClientToBSConnections";
 style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="BSToOPS">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/setConnectionFromBSToOPS";
 style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="DBConfig">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/storeDBConfig"; 
style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="GetServiceLocations">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getServiceLocations";
 style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="GetBSToOPSConnections">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getBSToOPSConnections";
 style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="ClientConfigRequest">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getClientConfig";
 style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+  <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="GetDBConfigs">
+   <soap:operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
soapAction="http://localhost:8080/config_service/config_svc.php/getDBConfigs"; 
style="document"/>
+   <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </input>
+   <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+    <soap:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; use="literal"/>
+   </output>
+  </operation>
+ </binding>
+ <service name="config_svc">
+  <port xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"; 
name="config_svcSOAPPort_Http" binding="tns:config_svcSOAPBinding">
+   <soap:address xmlns="http://schemas.xmlsoap.org/wsdl/soap/"; 
location="http://localhost:8080/config_service/config_svc.php"/>
+  </port>
+ </service>
+</definitions>


Reply via email to