incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bende...@apache.org
Subject svn commit: r792384 [2/4] - in /incubator/stonehenge/trunk/stocktrader/dotnet: ./ business_service/ business_service/BusinessServiceConfigurationSettings/ business_service/BusinessServiceConsole/ business_service/BusinessServiceImplementation/ business...
Date Thu, 09 Jul 2009 03:37:58 GMT
Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.cs?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.cs Thu Jul  9 03:37:55 2009
@@ -0,0 +1,190 @@
+//
+// 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.
+//
+
+//  .Net StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications
+
+//======================================================================================================
+// This is the client for the OrderProcessorService.
+//======================================================================================================
+
+//======================================================================================================
+// Code originally contributed by Microsoft Corporation.
+// This contribution to the Stonehenge project is limited strictly 
+// to the source code that is submitted in this submission.  
+// Any technology, including underlying platform technology, 
+// that is referenced or required by the submitted source code 
+// is not a part of the contribution.  
+// For example and not by way of limitation, 
+// any systems/Windows libraries (WPF, WCF, ASP.NET etc.) 
+// required to run the submitted source code is not a part of the contribution
+//======================================================================================================
+
+using System;
+using System.Diagnostics;
+using System.Data;
+using System.Collections.Generic;
+using System.Text;
+using System.ServiceModel;
+using System.Threading;
+using System.ServiceModel.Channels;
+using System.Runtime.Serialization;
+using System.Globalization;
+using System.Reflection;
+using Trade.Client;
+using Trade.Utility;
+using System.Configuration;
+using Trade.ConfigServiceContract;
+using Trade.ConfigServiceDataContract;
+
+namespace Trade.ConfigClient
+{
+
+    /// <summary>
+    /// This is the WCF client class for the remote Order Processor Services. This class implements channel initialization and
+    /// load balancing/failover logic across cached channel instances specific to the Configuration Management/Node services
+    /// implemented in StockTrader via the LoadBalancingClient.Client class, now re-used across all clients 
+    /// implementing the configuration service. 
+    /// </summary>
+    public class ConfigServiceClient : IConfigService
+    {
+        public Client.Client csclient;
+
+        /// <summary>
+        /// This will initialize a new Config Service Client
+        /// The endpoint for the ConfigService needs to be specified in the config file of the application calling this Client
+        /// </summary>
+        public ConfigServiceClient()
+        {
+            //Changed this from Settings.CS_DOTNET_ENDPOINT to remove the dependency on settings
+            //Now one config client can be used that's common to the Business Service, OPS and Trade Client
+            csclient = new Client.Client(typeof(IConfigService), ConfigurationManager.AppSettings.Get("CS_DOTNET_ENDPOINT_CONFIG_HTTP"));
+        }
+
+        /// <summary>
+        /// This returns the base channel type, cast to the specific contract type.
+        /// </summary>
+        public IConfigService Channel
+        {
+            get
+            {
+                return (IConfigService)csclient.Channel;
+            }
+            set
+            {
+                csclient.Channel = (IChannel)value;
+            }
+        }
+
+        /// <summary>
+        /// A Static method that clears the cache of the Client Service
+        /// </summary>
+        public static void Initialize()
+        {
+            Client.Client.ClearCache();
+        }
+
+
+
+        #region IConfigService Members
+
+        public ClientConfigResponse GetClientConfig(ClientConfigRequest client)
+        {
+            try
+            {
+                return this.Channel.GetClientConfig(client);
+                
+            }
+            catch
+            {
+                this.Channel = null;
+                throw;
+            }
+        }
+
+        public BSConfigResponse GetBSConfig(BSConfigRequest bs)
+        {
+            try
+            {
+                return this.Channel.GetBSConfig(bs);
+
+            }
+            catch
+            {
+                this.Channel = null;
+                throw;
+            }
+        }
+
+        public void SetClientToBS(ClientToBS clientConfig)
+        {
+            try
+            {
+                this.Channel.SetClientToBS(clientConfig);
+
+            }
+            catch
+            {
+                this.Channel = null;
+                throw;
+
+            }
+        }
+
+        public void SetBSToOPS(BSToOPS bsConfig)
+        {
+            try
+            {
+                this.Channel.SetBSToOPS(bsConfig);
+            }
+            catch
+            {
+                this.Channel = null;
+                throw;
+            }
+        }
+
+        public ServiceLocation[] GetBSLocations()
+        {
+            try
+            {
+                return this.Channel.GetBSLocations();
+            }
+            catch
+            {
+                this.Channel = null;
+                throw;
+            }
+
+        }
+
+        public ServiceLocation[] GetOPSLocations()
+        {
+            try
+            {
+                return this.Channel.GetOPSLocations();
+            }
+            catch
+            {
+                this.Channel = null;
+                throw;
+            }
+
+        }
+
+        #endregion
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.csproj?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.csproj (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.csproj Thu Jul  9 03:37:55 2009
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{D82DED61-E8CC-4530-A271-C74500ABBFA9}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Trade.ConfigClient</RootNamespace>
+    <AssemblyName>Trade.ConfigClient</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>stocktrader.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Runtime.Serialization">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.ServiceModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ConfigClient.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\common\StockTraderUtility\Utility.csproj">
+      <Project>{382E6E1C-E430-4F6C-BC41-5D84A3798B02}</Project>
+      <Name>Utility</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\config_service\ConfigServiceContract\ConfigServiceContract.csproj">
+      <Project>{B0D086A8-B168-4DCD-8D2C-6F08CE159B5C}</Project>
+      <Name>ConfigServiceContract</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\config_service\ConfigServiceDataContract\ConfigServiceDataContract.csproj">
+      <Project>{82B5FA73-8A82-4DC0-B473-43B78543668B}</Project>
+      <Name>ConfigServiceDataContract</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\BasicClient\BasicClient.csproj">
+      <Project>{A4759510-6CE9-4692-B348-B8483BCD1447}</Project>
+      <Name>BasicClient</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="stocktrader.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PostBuildEvent>if not exist "$(SolutionDir)$(OutDir)\" mkdir  "$(SolutionDir)$(OutDir)\"
+copy "$(TargetPath)"  "$(SolutionDir)$(OutDir)\"
+copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)$(OutDir)\"</PostBuildEvent>
+  </PropertyGroup>
+</Project>
\ No newline at end of file

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/Properties/AssemblyInfo.cs?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/Properties/AssemblyInfo.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/Properties/AssemblyInfo.cs Thu Jul  9 03:37:55 2009
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ConfigClient")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("ConfigClient")]
+[assembly: AssemblyCopyright("Copyright ? Microsoft 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("419e76e8-ba9c-4a57-a3ee-bae550c73236")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/stocktrader.snk
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/stocktrader.snk?rev=792384&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/stocktrader.snk
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/Config.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/Config.cs?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/Config.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/Config.cs Thu Jul  9 03:37:55 2009
@@ -0,0 +1,53 @@
+//
+// 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.
+//
+
+//  .Net StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications
+
+//======================================================================================================
+// The Factory class that returns an instance of the Config Data Access Class, part of the Data Access 
+// Layer (DAL).  This will return either a SQL Server DAL, or an Oracle DAL, depending on the configuration
+// the .NET StockTrader application is running in, as set in the repository via ConfigWeb. To run against
+// Oracle 10G or 11G, you will need to download Oracle's .NET ODP and Oracle client for Windows, and install
+// on your nodes.
+//======================================================================================================
+
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Reflection;
+using System.Configuration;
+using System.Security.Policy;
+using Trade.IDAL;
+
+namespace Trade.DALFactory
+{
+    public sealed class Config
+    {
+
+        public static Trade.IDAL.IConfig Create(string path)
+        {
+
+
+            string className = path + ".Config";
+
+            // Using the evidence given in the config file load the appropriate assembly and class
+            return (Trade.IDAL.IConfig)Assembly.Load(path).CreateInstance(className);
+        }
+    }
+}
+

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/StockTraderDALFactory.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/StockTraderDALFactory.csproj?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/StockTraderDALFactory.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALFactory/StockTraderDALFactory.csproj Thu Jul  9 03:37:55 2009
@@ -54,6 +54,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Config.cs" />
     <Compile Include="Customer.cs" />
     <Compile Include="MarketSummary.cs" />
     <Compile Include="Order.cs" />
@@ -62,12 +63,6 @@
   <ItemGroup>
     <Content Include="stocktrader.snk" />
   </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\IDAL\StockTraderIDAL.csproj">
-      <Project>{509EB16A-6586-4200-8323-32438C9B47DC}</Project>
-      <Name>StockTraderIDAL</Name>
-    </ProjectReference>
-  </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
     <PostBuildEvent>if not exist "$(SolutionDir)$(OutDir)\
" mkdir  "$(SolutionDir)$(OutDir)\
"

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs Thu Jul  9 03:37:55 2009
@@ -0,0 +1,300 @@
+//
+// 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.
+//
+
+//  .Net StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications
+
+//===============================================================================================
+// Config is part of the SQLServer DAL for StockTrader.  This is called from the
+// BSL to execute commands against the database.  It is constructed to use one SqlConnection per
+// instance.  Hence, BSLs that use this DAL should always be instanced properly.
+// The DAL will work with both ADO.NET and System.Transactions or ServiceComponents/Enterprise
+// Services attributed transactions [autocomplete]. When using ADO.NET transactions,
+// The BSL will control the transaction boundaries with calls to dal.BeginTransaction(); 
+// dal.CommitTransaction(); dal.RollbackTransaction().
+//===============================================================================================
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+using System.Data.SqlClient;
+using System.Data.SqlTypes;
+using Trade.IDAL;
+using Trade.Utility;
+using Trade.ConfigServiceDataContract;
+
+namespace Trade.DALSQLServer
+{
+    public class Config : IConfig
+    {
+        public Config()
+        {
+        }
+
+        //Constructor for internal DAL-DAL calls to use an existing DB connection.
+        public Config(SqlConnection conn)
+        {
+            _internalConnection = conn;
+        }
+
+        //_internalConnection: Used by a DAL instance such that a DAL instance,
+        //associated with a BSL instance, will work off a single connection between BSL calls.
+        private SqlConnection _internalConnection;
+
+        //_internalADOTransaction: Used only when doing ADO.NET transactions.
+        //This will be completely ignored when null, and not attached to a cmd object
+        //In SQLHelper unless it has been initialized explicitly in the BSL with a
+        //dal.BeginADOTransaction().  See app config setting in web.config and 
+        //Trade.BusinessServiceHost.exe.config "Use System.Transactions Globally" which determines
+        //whether user wants to run with ADO transactions or System.Transactions.  The DAL itself
+        //is built to be completely agnostic and will work with either.
+        private SqlTransaction _internalADOTransaction;
+
+        //Used only when doing ADO.NET transactions.
+        public void BeginADOTransaction()
+        {
+            if (_internalConnection.State != ConnectionState.Open)
+                _internalConnection.Open();
+            _internalADOTransaction = _internalConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
+        }
+
+        //Used only when explicitly using ADO.NET transactions from the BSL.
+        public void RollBackTransaction()
+        {
+            _internalADOTransaction.Rollback();
+            _internalADOTransaction = null;
+        }
+
+        //Used only when explicitly using ADO.NET transactions from the BSL.
+        public void CommitADOTransaction()
+        {
+            _internalADOTransaction.Commit();
+            _internalADOTransaction = null;
+        }
+
+        public void Open(string connString)
+        {
+            if (_internalConnection == null)
+                _internalConnection = new SqlConnection(connString);
+            if (_internalConnection.State != ConnectionState.Open)
+                _internalConnection.Open();
+        }
+
+        public void Close()
+        {
+            if (_internalConnection != null && _internalConnection.State != ConnectionState.Closed)
+                _internalConnection.Close();
+        }
+
+        private const string PARM_CLIENT = "@Client";
+        private const string PARM_BS = "@Bs";
+        private const string PARM_OPS = "@Ops";
+
+        //SQL Queries to lookup configuration info for given services
+        private const string SQL_GET_CLIENT_CONFIG = @"SET NOCOUNT ON; 
+SELECT c.BS, s.URL, s.SEC  
+FROM CLIENTTOBS as c INNER JOIN [SERVICE] AS s
+ON c.BS = s.SERVICENAME
+WHERE c.CLIENT = @Client";
+        private const string SQL_GET_BS_CONFIG = @"SET NOCOUNT ON; 
+SELECT b.OPS, b.URL, b.SEC, d.DBNAME, d.HOSTNAME, d.PORT 
+FROM (SELECT 1 as Row, b1.OPS, s.URL, s.SEC  
+	FROM BSTOOPS as b1 INNER JOIN [SERVICE] AS s
+	ON b1.OPS = s.SERVICENAME
+	WHERE b1.BS = @Bs) as b 
+INNER JOIN (SELECT 1 as Row, DBNAME, HOSTNAME, PORT FROM DBCONFIG WHERE ACTIVE='Y') as d 
+ON b.Row = d.Row";
+        private const string SQL_FIND_CLIENT_TO_BS = @"SET NOCOUNT ON;
+SELECT b.CLIENT, b.BS
+FROM dbo.CLIENTTOBS as b
+WHERE b.CLIENT = @Client";
+        private const string SQL_SET_CLIENT_TO_BS = @"INSERT INTO 
+dbo.CLIENTTOBS (CLIENT, BS) VALUES (@Client, @Bs)";
+        private const string SQL_UPDATE_CLIENT_TO_BS = @"UPDATE dbo.CLIENTTOBS WITH 
+(ROWLOCK) SET BS=@Bs WHERE CLIENT=@Client";
+        private const string SQL_FIND_BS_TO_OPS = @"SET NOCOUNT ON;
+SELECT b.BS, b.OPS
+FROM dbo.BSTOOPS as b
+WHERE b.BS = @Bs";
+        private const string SQL_SET_BS_TO_OPS = @"INSERT INTO 
+dbo.BSTOOPS (BS, OPS) VALUES (@Bs, @Ops)";
+        private const string SQL_UPDATE_BS_TO_OPS = @"UPDATE dbo.BSTOOPS WITH 
+(ROWLOCK) SET OPS=@Ops WHERE BS=@Bs";
+        private const string SQL_COUNT_BS = @"SELECT COUNT(*) as count FROM dbo.SERVICE WHERE SERVICENAME LIKE '%_BS'";
+        private const string SQL_COUNT_OPS = @"SELECT COUNT(*) as count FROM dbo.SERVICE WHERE SERVICENAME LIKE '%_OPS' OR SERVICENAME LIKE '%_OPSSEC'";
+        private const string SQL_GET_BS = @"SELECT SERVICENAME, URL FROM dbo.SERVICE WHERE SERVICENAME LIKE '%_BS'";
+        private const string SQL_GET_OPS = @"SELECT SERVICENAME, URL FROM dbo.SERVICE WHERE SERVICENAME LIKE '%_OPS' OR SERVICENAME LIKE '%_OPSSEC'";
+
+        /// <summary>
+        /// Looks up the given Client Service Name in the CLIENTTOBS table in the database 
+        /// for information regarding configuration - of the Business Service and the DB
+        /// </summary>
+        /// <param name="bs">Name of the Order Processing Service</param>
+        /// <returns>ClientConfigResponse object with config information on the BSuri and DB connection info. or null if the given ClientName is not in the database</returns>
+        public ClientConfigResponse GetClientConfig(string client)
+        {
+            SqlParameter[] parm = new SqlParameter[] { new SqlParameter(PARM_CLIENT, SqlDbType.VarChar, 50) };
+            parm[0].Value = client;
+            SqlDataReader rdr = SQLHelper.ExecuteReaderSingleRow(_internalConnection, _internalADOTransaction, CommandType.Text,
+                SQL_GET_CLIENT_CONFIG, parm);
+
+            // Read and Guard
+            if (!rdr.Read())
+                return null;
+
+            var response = new ClientConfigResponse();
+            response.BS = rdr.GetString(rdr.GetOrdinal("URL"));
+            response.BSName = rdr.GetString(rdr.GetOrdinal("BS"));
+            response.Sec = rdr.GetBoolean(rdr.GetOrdinal("SEC"));
+
+            rdr.Close();
+
+            return response;
+        }
+
+        /// <summary>
+        /// Looks up the given Business Service Name in the BSTOOPS table in the database 
+        /// for information regarding configuration - of the Order Processing Service and the DB
+        /// </summary>
+        /// <param name="bs">Name of the Buiness Service</param>
+        /// <returns>BSConfigResponse object with config information on the OPSuri and DB connection info, or null if the given BSName is not in the database</returns>
+        public BSConfigResponse GetBSConfig(string bs)
+        {
+            SqlParameter[] parm = new SqlParameter[] { new SqlParameter(PARM_BS, SqlDbType.VarChar, 50) };
+            parm[0].Value = bs;
+            SqlDataReader rdr = SQLHelper.ExecuteReaderSingleRow(_internalConnection, _internalADOTransaction, CommandType.Text,
+                SQL_GET_BS_CONFIG, parm);
+
+            // Read and Gaurd
+            if (!rdr.Read())
+                return null;
+
+            var response = new BSConfigResponse();
+            response.OPS = rdr.GetString(rdr.GetOrdinal("URL"));
+            response.OPSName = rdr.GetString(rdr.GetOrdinal("OPS"));
+            response.Sec = rdr.GetBoolean(rdr.GetOrdinal("SEC"));
+            response.DBName = rdr.GetString(rdr.GetOrdinal("DBNAME"));
+            response.DBHostName = rdr.GetString(rdr.GetOrdinal("HOSTNAME"));
+            response.DBPort = rdr.GetInt32(rdr.GetOrdinal("PORT"));
+
+            rdr.Close();
+
+            return response;
+        }
+
+
+        /// <summary>
+        /// Sets a connection between the specified client and business service
+        /// If no ClientToBS configuration entry exists for this client, it is created
+        /// or else the configuration for the client is replaced by this one
+        /// </summary>
+        public void SetClientToBS(ClientToBS clientConfig)
+        {
+            SqlParameter[] parm = new SqlParameter[] { new SqlParameter(PARM_CLIENT, SqlDbType.VarChar, 50) };
+            parm[0].Value = clientConfig.Client;
+
+            SqlParameter[] parm2 = new SqlParameter[] { new SqlParameter(PARM_CLIENT, SqlDbType.VarChar, 50), new SqlParameter(PARM_BS, SqlDbType.VarChar, 50) };
+            parm2[0].Value = clientConfig.Client;
+            parm2[1].Value = clientConfig.Bs;
+
+            SqlDataReader rdr = SQLHelper.ExecuteReaderSingleRow(_internalConnection, _internalADOTransaction, CommandType.Text,
+                SQL_FIND_CLIENT_TO_BS, parm);
+            if (!rdr.Read())
+            {
+                rdr.Close();
+                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SET_CLIENT_TO_BS, parm2);
+            }
+            else
+            {
+                rdr.Close();
+                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_UPDATE_CLIENT_TO_BS, parm2);
+            }  
+        }
+
+        /// <summary>
+        /// Sets a connection between the specified client and business service
+        /// If no ClientToBS configuration entry exists for this client, it is created
+        /// or else the configuration for the client is replaced by this one
+        /// </summary>
+        public void SetBSToOPS(BSToOPS bsConfig)
+        {
+            SqlParameter[] parm = new SqlParameter[] { new SqlParameter(PARM_BS, SqlDbType.VarChar, 50) };
+            parm[0].Value = bsConfig.Bs;
+
+            SqlParameter[] parm2 = new SqlParameter[] { new SqlParameter(PARM_BS, SqlDbType.VarChar, 50), new SqlParameter(PARM_OPS, SqlDbType.VarChar, 50) };
+            parm2[0].Value = bsConfig.Bs;
+            parm2[1].Value = bsConfig.Ops;
+
+            SqlDataReader rdr = SQLHelper.ExecuteReaderSingleRow(_internalConnection, _internalADOTransaction, CommandType.Text,
+                SQL_FIND_BS_TO_OPS, parm);
+            if (!rdr.Read())
+            {
+                rdr.Close();
+                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SET_BS_TO_OPS, parm2);
+            }
+            else
+            {
+                rdr.Close();
+                SQLHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_UPDATE_BS_TO_OPS, parm2);
+            }
+        }
+
+        public ServiceLocation[] GetBSLocations()
+        {
+            int count = (int)SQLHelper.ExecuteScalarNoParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_COUNT_BS);
+            ServiceLocation[] bsLocations = new ServiceLocation[count];
+            SqlDataReader rdr = SQLHelper.ExecuteReader(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_GET_BS);
+            int i = 0;
+            while (rdr.Read())
+            {
+                bsLocations[i] = new ServiceLocation();
+                bsLocations[i].ServiceName = (string)rdr["SERVICENAME"];
+                bsLocations[i].ServiceURL = (string)rdr["URL"];
+                i++;
+            }
+
+            return bsLocations;
+        }
+
+        public ServiceLocation[] GetOPSLocations()
+        {
+
+            int count = (int)SQLHelper.ExecuteScalarNoParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_COUNT_OPS);
+            ServiceLocation[] opsLocations = new ServiceLocation[count];
+            SqlDataReader rdr = SQLHelper.ExecuteReader(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_GET_OPS);
+            
+            int i = 0;
+            while (rdr.Read())
+            {
+                opsLocations[i] = new ServiceLocation();
+                opsLocations[i].ServiceName = (string)rdr["SERVICENAME"];
+                opsLocations[i].ServiceURL = (string)rdr["URL"];
+                i++;
+            }
+
+            return opsLocations;
+        }
+
+        private bool ConvertStringToBool(string value)
+        {
+            return value.Equals("Y", StringComparison.InvariantCultureIgnoreCase);
+        }
+
+    }
+}
+

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/StockTraderDALSQLServer.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/StockTraderDALSQLServer.csproj?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/StockTraderDALSQLServer.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/StockTraderDALSQLServer.csproj Thu Jul  9 03:37:55 2009
@@ -56,8 +56,17 @@
     <Reference Include="System.Xml">
       <HintPath>..\..\..\..\Windows\Microsoft.NET\Framework\v2.0.50727\System.XML.dll</HintPath>
     </Reference>
+    <Reference Include="Trade.BusinessServiceDataContract, Version=2.0.2.0, Culture=neutral, PublicKeyToken=aaca655dc76c580b, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\business_service\BusinessServiceDataContract\bin\Debug\Trade.BusinessServiceDataContract.dll</HintPath>
+    </Reference>
+    <Reference Include="Trade.ConfigServiceDataContract, Version=2.0.2.0, Culture=neutral, PublicKeyToken=aaca655dc76c580b, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\config_service\ConfigServiceDataContract\bin\Debug\Trade.ConfigServiceDataContract.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Config.cs" />
     <Compile Include="Customer.cs" />
     <Compile Include="MarketSummary.cs" />
     <Compile Include="Order.cs" />
@@ -67,10 +76,6 @@
     <Content Include="stocktrader.snk" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\business_service\BusinessServiceDataContract\BusinessServiceDataContract.csproj">
-      <Project>{EBB1604B-3F50-4A81-87C3-1AE4029EEEC6}</Project>
-      <Name>BusinessServiceDataContract</Name>
-    </ProjectReference>
     <ProjectReference Include="..\IDAL\StockTraderIDAL.csproj">
       <Project>{509EB16A-6586-4200-8323-32438C9B47DC}</Project>
       <Name>StockTraderIDAL</Name>

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/IConfig.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/IConfig.cs?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/IConfig.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/IConfig.cs Thu Jul  9 03:37:55 2009
@@ -0,0 +1,81 @@
+//
+// 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.
+//
+
+//  .Net StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications
+
+//======================================================================================================
+// An interface implemented by the DAL.
+//======================================================================================================
+
+
+using System;
+using System.Collections;
+using System.Data.SqlClient;
+using Trade.ConfigServiceDataContract;
+
+namespace Trade.IDAL
+{
+    public interface IConfig
+    {
+        void BeginADOTransaction();
+        void RollBackTransaction();
+        void CommitADOTransaction();
+        void Open(string connString);
+        void Close();
+
+        /// <param name="client">The name of the client to get config informaiton for.</param>
+        /// <returns>The client configuration for the supplied name</returns>
+        ClientConfigResponse GetClientConfig(string client);
+
+        /// <param name="bs">the name of the bs to get the config for</param>
+        /// <returns>the endpoint url of the business service that this client points to</returns>
+        BSConfigResponse GetBSConfig(string bs);
+
+        /// <summary>
+        /// Sets a connection between the specified client and business service
+        /// If no ClientToBS configuration entry exists for this client, it is created
+        /// or else the existing configuration for the client is replaced by this one
+        /// </summary>
+        void SetClientToBS(ClientToBS clientConfig);
+
+        /// <summary>
+        /// Sets a connection between the specified business service and order processing service
+        /// If no BSToOPS configuration entry exists for this business service, it is created
+        /// or else the existing configuration for the business service is replaced by this one
+        /// </summary>
+        void SetBSToOPS(BSToOPS bsConfig);
+
+
+        /// <summary>
+        /// Gets all the business service locations
+        /// </summary>
+        ServiceLocation[] GetBSLocations();
+
+        /// <summary>
+        /// Gets all the order processing service locations
+        /// </summary>
+        ServiceLocation[] GetOPSLocations();
+
+        //ClientToBS[] getClientToBS();
+        //BSToOPS[] getBSToOPS();
+
+        //bool setClientToBs(ClientToBS ctb);
+        //bool setBsToOps(BSToOPS bto);
+        //bool setServiceLocation(ServiceLocation sl);
+
+    }
+}

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/StockTraderIDAL.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/StockTraderIDAL.csproj?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/StockTraderIDAL.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/StockTraderIDAL.csproj Thu Jul  9 03:37:55 2009
@@ -52,6 +52,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="IConfig.cs" />
     <Compile Include="ICustomer.cs" />
     <Compile Include="IMarketSummary.cs" />
     <Compile Include="IOrder.cs" />
@@ -65,6 +66,10 @@
       <Project>{EBB1604B-3F50-4A81-87C3-1AE4029EEEC6}</Project>
       <Name>BusinessServiceDataContract</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\config_service\ConfigServiceDataContract\ConfigServiceDataContract.csproj">
+      <Project>{82B5FA73-8A82-4DC0-B473-43B78543668B}</Project>
+      <Name>ConfigServiceDataContract</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/OrderProcessorServiceConfigurationSettings.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/OrderProcessorServiceConfigurationSettings.csproj?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/OrderProcessorServiceConfigurationSettings.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/OrderProcessorServiceConfigurationSettings.csproj Thu Jul  9 03:37:55 2009
@@ -16,10 +16,14 @@
     <UpgradeBackupLocation>
     </UpgradeBackupLocation>
     <OldToolsVersion>2.0</OldToolsVersion>
-    <SccProjectName>Svn</SccProjectName>
-    <SccLocalPath>Svn</SccLocalPath>
-    <SccAuxPath>Svn</SccAuxPath>
-    <SccProvider>SubversionScc</SccProvider>
+    <SccProjectName>
+    </SccProjectName>
+    <SccLocalPath>
+    </SccLocalPath>
+    <SccAuxPath>
+    </SccAuxPath>
+    <SccProvider>
+    </SccProvider>
     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/Settings.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/Settings.cs?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/Settings.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/OrderProcessorServiceConfigurationSettings/Settings.cs Thu Jul  9 03:37:55 2009
@@ -67,7 +67,6 @@
       
         public static string EVENT_LOG = "Order Processor Event Log";
 
-        public static string ORDER_PROCESSING_MODE;
         public static string DBServer;
         public static string Database;
         public static string UserID;
@@ -84,11 +83,6 @@
         public Settings()
         {
 
-            Settings.ORDER_PROCESSING_MODE = ConfigurationManager.AppSettings.Get("ORDER_PROCESSING_MODE");
-            Settings.DBServer = ConfigurationManager.AppSettings.Get("DBServer");
-            Settings.Database = ConfigurationManager.AppSettings.Get("Database");
-            Settings.UserID = ConfigurationManager.AppSettings.Get("UserID");
-            Settings.Password = ConfigurationManager.AppSettings.Get("Password");
             Settings.MinDBConnections = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MinDBConnections"));
             Settings.MaxDBConnections = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MaxDBConnections"));
             Settings.DAL = ConfigurationManager.AppSettings.Get("DAL");

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/Settings.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/Settings.cs?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/Settings.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/Settings.cs Thu Jul  9 03:37:55 2009
@@ -49,6 +49,10 @@
 using System.Text;
 using System.Reflection;
 using Trade.Utility;
+using Trade.ConfigServiceDataContract;
+using Trade.ConfigClient;
+using Trade.ConfigServiceConfigurationSettings;
+using Trade.ConfigServiceContract;
 
 namespace Trade.StockTraderWebApplicationSettings
 {
@@ -67,7 +71,6 @@
         public static string BSL_USERID;
         public static string BSL_PASSWORD;
 
-        public static string ACCESS_MODE;
         public static int MAX_DISPLAY_ORDERS;
         public static int MAX_DISPLAY_TOP_ORDERS;
         public static bool DISPLAY_DUPLICATE_KEY_EXCEPTIONS;
@@ -102,7 +105,6 @@
         /// </summary>
         static Settings()
         {
-            Settings.ACCESS_MODE = ConfigurationManager.AppSettings.Get("ACCESS_MODE");
             Settings.EVENT_LOG = ConfigurationManager.AppSettings.Get("EVENT_LOG");
             Settings.MAX_DISPLAY_ORDERS = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MAX_DISPLAY_ORDERS"));
             Settings.MAX_DISPLAY_TOP_ORDERS = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MAX_DISPLAY_TOP_ORDERS"));
@@ -115,7 +117,7 @@
             Settings.BSL_WSAS_ENDPOINT_CONFIG_HTTP = ConfigurationManager.AppSettings.Get("BSL_WSAS_ENDPOINT_CONFIG_HTTP");
             Settings.BSL_USERID = ConfigurationManager.AppSettings.Get("BSL_USERID");
             Settings.BSL_PASSWORD = ConfigurationManager.AppSettings.Get("BSL_PASSWORD"); 
-
+            
             setAccessMode();
 
         }
@@ -126,27 +128,34 @@
         /// </summary>
         static public int setAccessMode()
         {
-            switch (ACCESS_MODE)
+            //Using the database configuration system - this BusinessServiceClient is created based on the CLIENTTOBS
+            //Configuration Settings specified in the database i.e. the row containing DOTNET_CLIENT
+            var configClient = new ConfigServiceClient();
+            var clientRequest = new ClientConfigRequest();
+            clientRequest.ClientName = "DOTNET_CLIENT";
+            var clientConfig = configClient.GetClientConfig(clientRequest);
+
+            switch (clientConfig.BSName)
             {
-                case StockTraderUtility.ACCESS_STRING_DotNet_Http_WcfService:
+                case StockTraderUtility.DOTNET_BS:
                     {
                         interfaceMode = StockTraderUtility.ACCESS_DotNet_Http_WcfService;
                         break;
                     }
 
-                case StockTraderUtility.ACCESS_STRING_DotNet_WsHttp_WcfService:
+                case StockTraderUtility.DOTNET_BSSEC:
                     {
                         interfaceMode = StockTraderUtility.ACCESS_DotNet_WsHttp_WcfService;
                         break;
                     }
 
-                case StockTraderUtility.ACCESS_STRING_PHP_Http_WebService:
+                case StockTraderUtility.PHP_BS:
                     {
                         interfaceMode = StockTraderUtility.ACCESS_PHP_Http_WebService;
                         break;
                     }
                 
-                case StockTraderUtility.ACCESS_STRING_WSAS_Http_WebService:
+                case StockTraderUtility.JAVA_BS:
                     {
                         interfaceMode = StockTraderUtility.ACCESS_WSAS_Http_WebService;
                         break;
@@ -155,10 +164,11 @@
 
                 default:
                     {
-                        throw new Exception(ACCESS_MODE + ": " + StockTraderUtility.EXCEPTION_MESSAGE_INVALID_ACCESSMODE_CONFIG);
+                        throw new Exception(clientConfig.BSName + ": " + StockTraderUtility.EXCEPTION_MESSAGE_INVALID_ACCESSMODE_CONFIG);
                     }
             }
             return interfaceMode;
         }
+       
     }
 }

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/StockTraderWebApplicationSettings.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/StockTraderWebApplicationSettings.csproj?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/StockTraderWebApplicationSettings.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/ServiceConfigurationSettings/StockTraderWebApplicationSettings.csproj Thu Jul  9 03:37:55 2009
@@ -105,6 +105,22 @@
     </BootstrapperPackage>
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\config_service\ConfigServiceConfigurationSettings\ConfigServiceConfigurationSettings.csproj">
+      <Project>{5A192168-838E-4DD1-A5E9-9EE191B941FE}</Project>
+      <Name>ConfigServiceConfigurationSettings</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\config_service\ConfigServiceContract\ConfigServiceContract.csproj">
+      <Project>{B0D086A8-B168-4DCD-8D2C-6F08CE159B5C}</Project>
+      <Name>ConfigServiceContract</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\config_service\ConfigServiceDataContract\ConfigServiceDataContract.csproj">
+      <Project>{82B5FA73-8A82-4DC0-B473-43B78543668B}</Project>
+      <Name>ConfigServiceDataContract</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\ConfigClient\ConfigClient.csproj">
+      <Project>{D82DED61-E8CC-4530-A271-C74500ABBFA9}</Project>
+      <Name>ConfigClient</Name>
+    </ProjectReference>
     <ProjectReference Include="..\StockTraderUtility\Utility.csproj">
       <Project>{382E6E1C-E430-4F6C-BC41-5D84A3798B02}</Project>
       <Name>Utility</Name>

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/SQLHelper.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/SQLHelper.cs?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/SQLHelper.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/SQLHelper.cs Thu Jul  9 03:37:55 2009
@@ -331,5 +331,21 @@
                 }
             }
         }
+
+        /// <summary>
+        /// Prepares a SQL Server Connection String from the host IP address
+        /// and the port
+        /// Used by the Configuration Service to generate a connection to the DB
+        /// using info in the DBConfig table
+        /// </summary>
+        /// <param name="host">host's IP address</param>
+        /// <param name="port">port</param>
+        /// <returns></returns>
+        public static string GenerateSqlServerConnectionString(string host, int port)
+        {
+            return string.Format("server={0}", host)
+                + ";database=StockTraderDB"
+                + ";user id=trade;password=yyy";
+        }
     }
 }
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.cs?rev=792384&r1=792383&r2=792384&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.cs Thu Jul  9 03:37:55 2009
@@ -78,7 +78,7 @@
         public static readonly string EXCEPTION_MESSAGE_VALID_ACCESSMODEVALUES = "Valid values are: 'DotNet_Http_WcfService' (for SOA activation via WCF Self-Host/Http), 'DotNet_WsHttp_WcfService' (for SOA activation via WCF Self-Host/WsHttp), 'PHP_Http_WebService' (for SOA activation via WCF against PHP (WSF) services) and 'WSAS_Http_WebService' (for SOA activation via WCF against WSAS services).";
         public static readonly string EXCEPTION_MESSAGE_DUPLICATE_PRIMARY_KEY = "User ID Already Exists! Please Try a Different User ID.";
         public static readonly string EXCEPTION_MESSAGE_INVALID_LOGIN = "Error Logging In. Invalid Username or Password!";
-       
+        public static readonly string EXCEPTION_MESSAGE_BAD_CONFIG = "Error Loading Configuration from Configuration Service.  Please confirm that the {0} client is in the configuration database.";
 
         //Define max lengths for input fields; 
         public static readonly int ADDRESS_MAX_LENGTH = 100;
@@ -130,6 +130,20 @@
         public const int ORDER_ASync_WSAS_Http = 5;
         public const int ORDER_ASync_WSAS_WsHttp_MSec = 6;
 
+        //Strings for the database configuration system, which specify the order mode
+        public const string DOTNET_OPS = "DOTNET_OPS";
+        public const string DOTNET_OPSSEC = "DOTNET_OPSSEC";
+        public const string PHP_OPS = "PHP_OPS";
+        public const string PHP_OPSSEC = "PHP_OPSSEC";
+        public const string JAVA_OPS = "JAVA_OPS";
+        public const string JAVA_OPSSEC = "JAVA_OPSSEC";
+
+        //Strings for the database configuration system, which specifu the access mode
+        public const string DOTNET_BS = "DOTNET_BS";
+        public const string DOTNET_BSSEC = "DOTNET_BSSEC";
+        public const string PHP_BS = "PHP_BS";
+        public const string JAVA_BS = "JAVA_BS";
+
         //map user strings to ints for faster lookups. We want to catch invalid settings
         //so the user knows what tx model they are running within a service.
         public const string TRANSACTION_STRING_SYSTEMDOTTRANSACTION_TRANSACTION = "true";
@@ -162,10 +176,6 @@
         public const string DOTNET_SELFHOST_OPS_WSHTTP = ".NET Order Processor Async-Http WS-* (M-Security)";
         public const string WSO2_OPS_WSHTTP = "WSO2 Order Processor Async-Http WS-* (M-Security)";
        
-
-
-      
-
         //Order Codes
         public const string ORDER_TYPE_BUY = "buy";
         public const string ORDER_TYPE_SELL = "sell";

Added: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.csproj?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.csproj (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.csproj Thu Jul  9 03:37:55 2009
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{5A192168-838E-4DD1-A5E9-9EE191B941FE}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Trade.ConfigServiceConfigurationSettings</RootNamespace>
+    <AssemblyName>Trade.ConfigServiceConfigurationSettings</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <StartupObject>
+    </StartupObject>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>stocktrader.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Messaging" />
+    <Reference Include="System.ServiceModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Settings.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\common\StockTraderUtility\Utility.csproj">
+      <Project>{382E6E1C-E430-4F6C-BC41-5D84A3798B02}</Project>
+      <Name>Utility</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="stocktrader.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PostBuildEvent>if not exist "$(SolutionDir)$(OutDir)\" mkdir  "$(SolutionDir)$(OutDir)\"
+copy "$(TargetPath)"  "$(SolutionDir)$(OutDir)\"
+copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)$(OutDir)\"</PostBuildEvent>
+  </PropertyGroup>
+</Project>

Added: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.sln
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.sln?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.sln (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/ConfigServiceConfigurationSettings.sln Thu Jul  9 03:37:55 2009
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigServiceConfigurationSettings", "ConfigServiceConfigurationSettings.csproj", "{5A192168-838E-4DD1-A5E9-9EE191B941FE}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{5A192168-838E-4DD1-A5E9-9EE191B941FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5A192168-838E-4DD1-A5E9-9EE191B941FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5A192168-838E-4DD1-A5E9-9EE191B941FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5A192168-838E-4DD1-A5E9-9EE191B941FE}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

Added: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Properties/AssemblyInfo.cs?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Properties/AssemblyInfo.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Properties/AssemblyInfo.cs Thu Jul  9 03:37:55 2009
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ConfigServiceServiceConfigurationSettings")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("ConfigServiceServiceConfigurationSettings")]
+[assembly: AssemblyCopyright("Copyright ? Microsoft 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a95d4f0d-3b64-4bc2-aab9-a337633acd11")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Settings.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Settings.cs?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Settings.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/Settings.cs Thu Jul  9 03:37:55 2009
@@ -0,0 +1,115 @@
+//
+// 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.
+//
+
+//  .Net StockTrader Sample WCF Application for Benchmarking, Performance Analysis and Design Considerations for Service-Oriented Applications
+
+//======================================================================================================
+// The Settings class for the Configuration Service.  
+//======================================================================================================
+//======================================================================================================
+// Code originally contributed by Microsoft Corporation.
+// This contribution to the Stonehenge project is limited strictly 
+// to the source code that is submitted in this submission.  
+// Any technology, including underlying platform technology, 
+// that is referenced or required by the submitted source code 
+// is not a part of the contribution.  
+// For example and not by way of limitation, 
+// any systems/Windows libraries (WPF, WCF, ASP.NET etc.) 
+// required to run the submitted source code is not a part of the contribution
+//======================================================================================================
+
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Web;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.Data;
+using System.Diagnostics;
+using System.Messaging;
+using System.Text;
+using System.Reflection;
+
+using Trade.Utility;
+
+
+namespace Trade.ConfigServiceConfigurationSettings
+{
+    /// <summary>
+    /// Any app or service implementing the Configuration Service needs a custom Settings class that will contain it's
+    /// app-specific config settings. These are loaded from the SQL repository on startup with current values as set for service.
+    /// Your custom settings class should inherit from the ConfigurationSettingsBase class, which contains common
+    /// settings used by all services implementing the config service, in addition to the app-specific settings defined here.
+    /// </summary>
+    public class Settings
+    {
+
+        public static string EVENT_LOG = "Configuration Service Event Log";
+
+        public static string DBServer;
+        public static string Database;
+        public static string UserID;
+        public static string Password;
+        public static int MinDBConnections;
+        public static int MaxDBConnections;
+        public static string TRADEDB_SQL_CONN_STRING;
+        public static string DAL;
+
+
+        public Settings()
+        {
+
+            Settings.DBServer = ConfigurationManager.AppSettings.Get("DBServer");
+            Settings.Database = ConfigurationManager.AppSettings.Get("Database");
+            Settings.UserID = ConfigurationManager.AppSettings.Get("UserID");
+            Settings.Password = ConfigurationManager.AppSettings.Get("Password");
+            Settings.MinDBConnections = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MinDBConnections"));
+            Settings.MaxDBConnections = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MaxDBConnections"));
+            Settings.DAL = ConfigurationManager.AppSettings.Get("DAL");
+            buildConnString();
+        }
+
+        /// <summary>
+        /// This method builds a connection string based on DAL setting and settings for the database name, location, uid and password.
+        /// Called on host initialization and also when the DAL or DB connection parameters are changed via ConfigWeb.
+        /// </summary>
+        private void buildConnString()
+        {
+            switch (Settings.DAL)
+            {
+                case Trade.Utility.StockTraderUtility.DAL_SQLSERVER:
+                    {
+                        Settings.TRADEDB_SQL_CONN_STRING = "server=" + Settings.DBServer + ";database=" + Settings.Database + ";user id=" + Settings.UserID + ";password=" + Settings.Password + ";min pool size=" + Settings.MinDBConnections + ";max pool size=" + Settings.MaxDBConnections;
+                        break;
+                    }
+
+                case Trade.Utility.StockTraderUtility.DAL_ORACLE:
+                    {
+                        Settings.TRADEDB_SQL_CONN_STRING = "Data Source=" + Settings.Database + ";user id=" + Settings.UserID + ";password=" + Settings.Password + ";min pool size=" + Settings.MinDBConnections + ";max pool size=" + Settings.MaxDBConnections + ";enlist=dynamic;";
+                        break;
+                    }
+
+                case Trade.Utility.StockTraderUtility.DAL_DB2:
+                    {
+                        Settings.TRADEDB_SQL_CONN_STRING = "Network Transport Library=TCPIP;Network Address=" + Settings.DBServer + ";Initial Catalog=" + Settings.Database + ";Package Collection=" + Settings.Database + ";Default Schema=Schema;User ID=" + Settings.UserID + ";Password=" + Settings.Password + ";network port=50000;Units of Work=RUW; Connection Pooling=True;defer prepare=false;CCSID=37;PC Code Page=1252";
+                        break;
+                    }
+            }
+        }
+
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/stocktrader.snk
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/stocktrader.snk?rev=792384&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConfigurationSettings/stocktrader.snk
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/App.config
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/App.config?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/App.config (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/App.config Thu Jul  9 03:37:55 2009
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+ -->
+<!-- You can change these settings (app.config) before compiling the application, or change
+     these settings in Trade.BusinessServiceHost.Config before running the application. 
+     Changing Trade.BusinessServiceHost.Config directly requires no re-compilation of the application, as
+     they are picked up when the application is launched. 
+     
+     Note: As an alternative to hand editing this file you can use the 
+     Visual Studio XML editor admin tool to configure this file for your application. 
+-->
+<configuration>
+  <appSettings>
+    <add key="DBServer" value="localhost" />
+    <add key="Database" value="StockTraderDB" />
+    <add key="UserID" value="trade" />
+    <add key="Password" value="yyy" />
+    <add key="MinDBConnections" value="20" />
+    <add key="MaxDBConnections" value="20" />
+    <add key="DAL" value="Trade.DALSQLServer" />
+    <!--<add key="ENABLE_GLOBAL_SYSTEM_DOT_TRANSACTIONS_CONFIGSTRING" value="true" />
+    <add key="SYSTEMDOTTRANSACTION_TIMEOUT" value="30" />
+    <add key="DISPLAYNUMBERORDERITERATIONS" value="3" />-->
+    <add key="ClientSettingsProvider.ServiceUri" value="" />
+  </appSettings>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+    </assemblyBinding>
+    <!-- Note: <gcServer enabled ="true"/> configures the .NET CLR garbage collection mode.  
+               this mode is used to get the best peak throughput and performance of high-scale
+               .NET Server self-hosted applications. When running in Workstation GC mode (the default), for example
+               .NET StockTrader exhibits up to 20% *less* peak throughput. You SHOULD NOT alter the GC mode
+               in Web.Config for ASP.NET Web apps, however, as this setting is set automatically within
+               ASP.NET worker processes for peak throughput based on the computer specifications (number of CPUs) 
+               at .NET install-time.
+    -->
+    <gcServer enabled="true">
+    </gcServer>
+  </runtime>
+  <!-- system.service model is the new configuration section added with the release of .NET 3.0 and
+       Windows Communication Foundation.  
+   -->
+  <system.serviceModel>
+    <!--This enables the WCF ServiceModel performance counters for this application.-->
+    <!--<diagnostics performanceCounters="All"></diagnostics>-->
+    <!--The <services> section configures the WCF services that the .NET Configuration Service will host.
+    Note that StockTrader uses the configuration files only to specify base service names and their bindings.
+    Base addresses and Service/Client endpoints are created programmatically at runtime.-->
+    <!--********************************************************
+        
+    Config Service Config Service
+    
+    *********************************************************-->
+    <!-- <services>
+      <service name="Trade.ConfigServiceImplementation.ConfigService">
+      </service>
+    </services>-->
+    <!--********************************************************
+        
+    Config Service BINDINGS
+    
+    *********************************************************-->
+    <bindings>
+      <!--BEGIN basicHttpBindings-->
+      <basicHttpBinding>
+        <!--THESE ARE TEMPLATE PRIMARY SERVICE HOST BINDINGS.  TO AUGMENT, ADD WITH PREFIX 'Host_'-->
+        <binding name="ConfigHost_BasicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard" maxBufferSize="1048576" maxBufferPoolSize="10485768" maxReceivedMessageSize="1048576" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
+          <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
+          <security mode="None">
+            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
+            <message clientCredentialType="Certificate" algorithmSuite="Default" />
+          </security>
+        </binding>
+      </basicHttpBinding>
+    </bindings>
+  </system.serviceModel>
+  <system.web>
+    <membership defaultProvider="ClientAuthenticationMembershipProvider">
+      <providers>
+        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
+      </providers>
+    </membership>
+    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
+      <providers>
+        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
+      </providers>
+    </roleManager>
+  </system.web>
+</configuration>

Added: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/ConfigServiceConsoleHost.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/ConfigServiceConsoleHost.csproj?rev=792384&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/ConfigServiceConsoleHost.csproj (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/ConfigServiceConsoleHost.csproj Thu Jul  9 03:37:55 2009
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{569D1683-C49E-48A4-8202-62A7429CCB1B}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Trade.ConfigServiceConsoleHost</RootNamespace>
+    <AssemblyName>Trade.ConfigServiceConsoleHost</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ApplicationIcon>nettradericon.ico</ApplicationIcon>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>stocktrader.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Runtime.Serialization">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.ServiceModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Web.Extensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\common\DALFactory\StockTraderDALFactory.csproj">
+      <Project>{F67C8D85-6DC0-45CD-A748-636E3881E2F5}</Project>
+      <Name>StockTraderDALFactory</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\common\DALSQLServer\StockTraderDALSQLServer.csproj">
+      <Project>{34C5AB90-E195-4BEE-A895-7AB1F81D552D}</Project>
+      <Name>StockTraderDALSQLServer</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\common\StockTraderUtility\Utility.csproj">
+      <Project>{382E6E1C-E430-4F6C-BC41-5D84A3798B02}</Project>
+      <Name>Utility</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\ConfigServiceConfigurationSettings\ConfigServiceConfigurationSettings.csproj">
+      <Project>{5A192168-838E-4DD1-A5E9-9EE191B941FE}</Project>
+      <Name>ConfigServiceConfigurationSettings</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\ConfigServiceContract\ConfigServiceContract.csproj">
+      <Project>{B0D086A8-B168-4DCD-8D2C-6F08CE159B5C}</Project>
+      <Name>ConfigServiceContract</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\ConfigServiceDataContract\ConfigServiceDataContract.csproj">
+      <Project>{82B5FA73-8A82-4DC0-B473-43B78543668B}</Project>
+      <Name>ConfigServiceDataContract</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\ConfigServiceImplementation\ConfigServiceImplementation.csproj">
+      <Project>{7482A188-019C-49DF-A1A1-68D6CD254E44}</Project>
+      <Name>ConfigServiceImplementation</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="stocktrader.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="nettradericon.ico" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PostBuildEvent>if not exist "$(SolutionDir)$(OutDir)\" mkdir  "$(SolutionDir)$(OutDir)\"
+copy "$(TargetPath)"  "$(SolutionDir)$(OutDir)\"
+copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)$(OutDir)\"
+copy "$(TargetDir)$(TargetName).exe.config" "$(SolutionDir)$(OutDir)\"</PostBuildEvent>
+    <PreBuildEvent>
+    </PreBuildEvent>
+  </PropertyGroup>
+</Project>



Mime
View raw message