incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bende...@apache.org
Subject svn commit: r823397 [2/5] - in /incubator/stonehenge/trunk/stocktrader/dotnet: ./ business_service/BusinessServiceConsole/ business_service/BusinessServiceImplementation/ business_service/OrderProcessorASyncClient/ common/BasicClient/ common/ConfigClie...
Date Fri, 09 Oct 2009 04:05:00 GMT
Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.cs Fri Oct  9 04:04:55 2009
@@ -36,328 +36,249 @@
 using System.Configuration;
 using System.Diagnostics;
 using System.Reflection;
+using Microsoft.IdentityModel.Protocols.WSTrust;
 using Trade.Utility;
+using System.Collections.ObjectModel;
+using System.Threading;
+using Microsoft.IdentityModel.Claims;
+using System.IdentityModel.Tokens;
 
 
 namespace Trade.Client
 {
-    public sealed class ClientList
+    public sealed class Connection<T>
     {
-        public Connection _connection;
-        private Type _type;
+
+        private T _channel;
         private string _clientConfig;
-        private string _url;
-        private string _userName;
-        private string _password;
+        private ChannelFactory<T> _factory;
+        private object _channelLock = new object();
+        string _userName;
+        string _password;
+        string _url;
+        bool _useClaims;
 
-        /// <summary>
-        /// Constructor logic.
-        /// </summary>
-        /// <param name="serviceFriendlyName">Friendly name of the virtual endpoint this ClientList instance will initialize.</param>
-        public ClientList(Type clientContractType, string clientConfig)
+        public Connection(T channel, string clientConfig, ChannelFactory<T> factory, string url, string userName, string password, bool useClaims)
         {
+            _channel = channel;
             _clientConfig = clientConfig;
-            _type = clientContractType;
-            _connection = new Connection(_type, null, _clientConfig, null);
+            _factory = factory;
+            _url = url;
+            _userName = userName;
+            _password = password;
+            _useClaims = useClaims;
+
         }
 
         /// <summary>
-        /// 
+        /// Returns a channel factory as an object type. The channel factory will be created as type "theType"
         /// </summary>
-        /// <param name="clientContractType"></param>
-        /// <param name="clientConfig"></param>
-        public ClientList(Type clientContractType, string clientConfig, string userName, string password)
+        /// <param name="clientConfiguration">The name of the binding configuration to be used when creating the factory.</param>
+        /// <param name="remoteNodeEndPointAddress">The endpoint address to be used when creating the channel factory.</param>
+        /// <returns>object representing a channel factory</returns>
+        private static ChannelFactory<T> createChannelFactory(string clientConfiguration, string userName, string password, bool useClaims)
         {
-            _clientConfig = clientConfig;
-            _type = clientContractType;
-            _userName = userName;
-            _password = password;
-            _connection = new Connection(_type, null, _clientConfig, null,userName,password);
+            return createChannelFactory(clientConfiguration, null, userName, password, useClaims);
         }
 
-        public ClientList(Type clientContractType, string clientConfig, string url)
+        /// <summary>
+        /// Returns a channel factory as an object type. The channel factory will be created as type "theType"
+        /// </summary>
+        /// <param name="theType">The type representing the service contract type.</param>
+        /// <param name="clientConfiguration">The name of the binding configuration to be used when creating the factory.</param>
+        /// <param name="url">The endpoint address to be used when creating the channel factory.</param>
+        /// <returns>object representing a channel factory</returns>
+        private static ChannelFactory<T> createChannelFactory(string clientConfiguration, string url, string userName, string password, bool useClaims)
         {
-            _clientConfig = clientConfig;
-            _type = clientContractType;
-            _url = url;
+            ChannelFactory<T> channelFactory = (ChannelFactory<T>)Activator.CreateInstance(typeof(ChannelFactory<T>), new object[] { clientConfiguration });
+            channelFactory.Credentials.UserName.UserName = userName;
+            channelFactory.Credentials.UserName.Password = password;
 
-            _connection = new Connection(_type, null, _clientConfig, null, url);
-        }
+            if (!string.IsNullOrEmpty(url))
+            {
+                var oldAddress = channelFactory.Endpoint.Address;
+                channelFactory.Endpoint.Address = new EndpointAddress(new Uri(url), oldAddress.Identity);
+            }
 
-        public ClientList(Type clientContractType, string clientConfig, string url, string userName, string password)
-        {
-            _clientConfig = clientConfig;
-            _type = clientContractType;
-            _url = url;
-            _userName = userName;
-            _password = password;
-            _connection = new Connection(_type, null, _clientConfig, null, url, userName, password);
+            if (useClaims)
+            {
+                channelFactory.ConfigureChannelFactory();
+
+                
+
+
+            }
+
+            return channelFactory;
         }
 
-        public class Connection
+        public string ClientConfig
         {
-            private IChannel _channel;
-            private string _clientConfig;
-            private ChannelFactory _factory;
-            private object _channelLock = new object();
-            public Type _type;
-            string _userName;
-            string _password;
-            string _url;
-
-            /// <summary>
-            /// Creates a new Connection instance, which stores all the information for a cached Channel instance
-            /// </summary>
-            /// <param name="channel"></param>
-            /// <param name="endpointAddress"></param>
-            /// <param name="clientConfig"></param>
-            /// <param name="friendlyName"></param>
-            /// <param name="factory"></param>
-            public Connection(Type type, IChannel channel, string clientConfig, ChannelFactory factory)
-            {
-                _type = type;
-                _channel = channel;
-                _clientConfig = clientConfig;
-                _factory = factory;
-            }
-
-            public Connection(Type type, IChannel channel, string clientConfig, ChannelFactory factory,string url)
-            {
-                _type = type;
-                _channel = channel;
-                _clientConfig = clientConfig;
-                _factory = factory;
-                _url = url;
-            }
-
-            public Connection(Type type, IChannel channel, string clientConfig, ChannelFactory factory, string userName, string password)
-            {
-                _type = type;
-                _channel = channel;
-                _clientConfig = clientConfig;
-                _factory = factory;
-                _userName = userName;
-                _password = password;
-            }
-
-            public Connection(Type type, IChannel channel, string clientConfig, ChannelFactory factory, string url, string userName, string password)
-            {
-                _type = type;
-                _channel = channel;
-                _clientConfig = clientConfig;
-                _factory = factory;
-                _url = url;
-                _userName = userName;
-                _password = password;
-
-            }
-
-            /// <summary>
-            /// Uses reflection to create a typed generic object.
-            /// </summary>
-            /// <param name="settingsInstance"></param>
-            /// <param name="generic"></param>
-            /// <param name="innerType"></param>
-            /// <param name="args"></param>
-            /// <returns></returns>
-            public static object CreateGeneric(Type generic, Type innerType, params object[] args)
+            get
             {
-                try
-                {
-                    System.Type specificType = generic.MakeGenericType(new System.Type[] { innerType });
-                    return Activator.CreateInstance(specificType, args);
-                }
-                catch
-                {
-                    throw;
-                }
+                return _clientConfig;
             }
-
-            /// <summary>
-            /// Returns a channel factory as an object type. The channel factory will be created as type "theType"
-            /// </summary>
-            /// <param name="theType">The type representing the service contract type.</param>
-            /// <param name="clientConfiguration">The name of the binding configuration to be used when creating the factory.</param>
-            /// <param name="remoteNodeEndPointAddress">The endpoint address to be used when creating the channel factory.</param>
-            /// <returns>object representing a channel factory</returns>
-            public static object createChannelFactory(Type theType, string clientConfiguration, string userName, string password)
-            {
-                object channelFactory = CreateGeneric(typeof(ChannelFactory<>), theType, new object[] { clientConfiguration});
-                ((ChannelFactory)channelFactory).Credentials.UserName.UserName = userName;
-                ((ChannelFactory)channelFactory).Credentials.UserName.Password = password;
-                return channelFactory;
-            }
-
-            /// <summary>
-            /// Returns a channel factory as an object type. The channel factory will be created as type "theType"
-            /// </summary>
-            /// <param name="theType">The type representing the service contract type.</param>
-            /// <param name="clientConfiguration">The name of the binding configuration to be used when creating the factory.</param>
-            /// <param name="url">The endpoint address to be used when creating the channel factory.</param>
-            /// <returns>object representing a channel factory</returns>
-            public static object createChannelFactory(Type theType, string clientConfiguration, string url, string userName, string password)
-            {
-                object channelFactory = CreateGeneric(typeof(ChannelFactory<>), theType, new object[] { clientConfiguration });
-                ((ChannelFactory)channelFactory).Credentials.UserName.UserName = userName;
-                ((ChannelFactory)channelFactory).Credentials.UserName.Password = password;
-                if (!string.IsNullOrEmpty(url))
-                {
-                    var oldAddress = ((ChannelFactory)channelFactory).Endpoint.Address;
-                    ((ChannelFactory)channelFactory).Endpoint.Address = new EndpointAddress(new Uri(url), oldAddress.Identity);
-                }
-                return channelFactory;
+            set
+            {
+                this._clientConfig = value;
             }
+        }
+
 
+        /// <summary>
+        /// Returns a channel as an IChannel type. The channel will be created using a channel factory.
+        /// </summary>
+        /// <param name="channelFactory">The channel factory that will be used to create the channel instance.</param>
+        /// <returns>IChannel representing a WCF service channel</returns>
+        public static T createChannel(ChannelFactory<T> channelFactory)
+        {
+            if (channelFactory == null)
+                return default(T);
 
-            public string ClientConfig
+            T returnChannel = default(T);
+            try
             {
-                get
-                {
-                    return _clientConfig;
-                }
-                set
-                {
-                    this._clientConfig = value;
-                }
+                returnChannel = channelFactory.CreateChannel();
+            }
+            catch
+            {
+                throw;
             }
+            return returnChannel;
+        }
+
+        /// <summary>
+        /// Returns a channel as an IChannel type. The channel will be created using a channel factory.
+        /// </summary>
+        /// <param name="channelFactory">The channel factory that will be used to create the channel instance.</param>
+        /// <returns>IChannel representing a WCF service channel</returns>
+        public static T createChannelActingAs(ChannelFactory<T> channelFactory)
+        {
+            if (channelFactory == null)
+                return default(T);
 
+            T returnChannel = default(T);
+            try
+            {
+                ReadOnlyCollection<SecurityToken> bootstrapTokens = null;
+                SecurityToken callerToken = null;
 
-            /// <summary>
-            /// Returns a channel as an IChannel type. The channel will be created using a channel factory.
-            /// </summary>
-            /// <param name="channelFactory">The channel factory that will be used to create the channel instance.</param>
-            /// <returns>IChannel representing a WCF service channel</returns>
-            public static IChannel createChannel(object channelFactory)
-            {
-                if (channelFactory == null)
-                    return null;
-                IChannel returnChannel = null;
-                try
+                IClaimsPrincipal claimsPrincipal = Thread.CurrentPrincipal as IClaimsPrincipal;
+                if (claimsPrincipal != null)
                 {
-                    returnChannel = (IChannel)channelFactory.GetType().InvokeMember("CreateChannel", BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.Public, null, channelFactory, null);
+                    bootstrapTokens = claimsPrincipal.GetBootstrapTokens();
                 }
-                catch
+                // We expect only one token to be specified during Bootstrap.
+                if ((bootstrapTokens != null) && (bootstrapTokens.Count == 1))
                 {
-                    throw;
+                    callerToken = bootstrapTokens[0];
                 }
-                return returnChannel;
-            }
 
-            public IChannel Channel
+                returnChannel = channelFactory.CreateChannelActingAs(callerToken);
+            }
+            catch
             {
+                throw;
+            }
+            return returnChannel;
+        }
 
-                get
-                {
+        public T Channel
+        {
 
-                    IChannel localChannel = _channel;
-                    if (localChannel == null)
-                    {
-                        lock (_channelLock)
-                        {
-                            if (_factory == null)
-                            {
-                                if (_url == null)
-                                    _factory = (ChannelFactory)createChannelFactory(_type, ClientConfig, _userName, _password);
-                                else
-                                    _factory = (ChannelFactory)createChannelFactory(_type, ClientConfig, _url, _userName, _password);
-                            }
-                            if (_channel == null)
-                            {
-                                _channel = createChannel(_factory);
-                            }
-                            return _channel;
-                        }
-                    }
-                    return localChannel;
-                }
+            get
+            {
 
-                set
+                T localChannel = _channel;
+                if (localChannel == null)
                 {
                     lock (_channelLock)
                     {
-                        if (_channel!=null && ((IChannel)_channel).State != CommunicationState.Opened)
+                        if (_factory == null)
                         {
-                            ((IChannel)_channel).Abort();
-                            _channel = null;
+                            if (_url == null)
+                                _factory = (ChannelFactory<T>)createChannelFactory(ClientConfig, _userName, _password, _useClaims);
+                            else
+                                _factory = (ChannelFactory<T>)createChannelFactory(ClientConfig, _url, _userName, _password, _useClaims);
                         }
 
-                        if (_factory!=null && _factory.State != CommunicationState.Opened)
+                        if (_useClaims)
+                        {
+                            return createChannelActingAs(_factory);
+                        }
+                        else if (_channel == null)
                         {
-                            _factory.Abort();
-                            _factory = null;
+                            _channel = createChannel(_factory);
                         }
+                        return _channel;
                     }
                 }
+                return localChannel;
             }
 
-            public ChannelFactory Factory
+            set
             {
-                get
+                lock (_channelLock)
                 {
-                    return _factory;
-                }
-                set
-                {
-                    this._factory = value;
+                    if (_channel != null && ((IChannel)_channel).State != CommunicationState.Opened)
+                    {
+                        ((IChannel)_channel).Abort();
+                        _channel = default(T);
+                    }
+
+                    if (_factory != null && _factory.State != CommunicationState.Opened)
+                    {
+                        _factory.Abort();
+                        _factory = null;
+                    }
                 }
             }
         }
+
+        public ChannelFactory<T> Factory
+        {
+            get
+            {
+                return _factory;
+            }
+            set
+            {
+                this._factory = value;
+            }
+        }
     }
 
+
     /// <summary>
     /// This is the WCF master Client class.  It will be instantiated once per remote operation (web service call) request,
     /// but uses a static Dictionary (connectionList) of type ClientList to ensure channels are chached and not instanced on a pre-request basis.
     /// The connecitonList will contain one entry per type of service connected to from an app/service client.  The connection ClientList entry
     /// will in turn contain the list of all service nodes for this specific service type. 
     /// </summary>
-    public class Client
+    public class Client<T>
     {
-        private static Dictionary<string, ClientList> connectionDictionary;
-        public ClientList connection;
-        private string _clientConfig;
-        private Type _type;
-        private string _url;
+        private static Dictionary<string, Connection<T>> connectionDictionary = new Dictionary<string, Connection<T>>();
+        
+        private Connection<T> _connection;
 
         /// <summary>
         /// 
         /// </summary>
         /// <param name="clientContractType"></param>
         /// <param name="clientConfig"></param>
-        public Client(Type clientContractType, string clientConfig)
+        public Client(string clientConfig)
+            : this(clientConfig, null, null, null, false)
         {
-            _type = clientContractType;
-            _clientConfig = clientConfig;
-            if (connectionDictionary == null)
-                connectionDictionary = new Dictionary<string, ClientList>();
-            try
-            {
-                connection = connectionDictionary[_type.FullName];
-            }
-            catch
-            {
-                //No entry!
-                connection = new ClientList(clientContractType,clientConfig);
-                connectionDictionary.Add(_type.FullName, connection);
-            }
         }
 
-        public Client(Type clientContractType, string clientConfig, string url)
+        public Client(string clientConfig, string url)
+            : this(clientConfig, url, null, null, false)
+        {
+        }
+
+        public Client(string clientConfig, string url, bool useClaims)
+            : this(clientConfig, url, null, null, useClaims)
         {
-            _type = clientContractType;
-            _clientConfig = clientConfig;
-            _url = url;
-            if (connectionDictionary == null)
-                connectionDictionary = new Dictionary<string, ClientList>();
-            try
-            {
-                connection = connectionDictionary[_type.FullName];
-            }
-            catch
-            {
-                //No entry!
-                connection = new ClientList(clientContractType, clientConfig, url);
-                connectionDictionary.Add(_type.FullName, connection);
-            }
         }
 
         /// <summary>
@@ -365,40 +286,22 @@
         /// </summary>
         /// <param name="clientContractType"></param>
         /// <param name="clientConfig"></param>
-        public Client(Type clientContractType, string clientConfig, string userName, string password)
+        public Client(string clientConfig, string userName, string password)
+            : this(clientConfig, null, userName, password, false)
         {
-            _type = clientContractType;
-            _clientConfig = clientConfig;
-            if (connectionDictionary == null)
-                connectionDictionary = new Dictionary<string, ClientList>();
-            try
-            {
-                connection = connectionDictionary[_type.FullName];
-            }
-            catch
-            {
-                //No entry!
-                connection = new ClientList(clientContractType, clientConfig, userName, password);
-                connectionDictionary.Add(_type.FullName, connection);
-            }
         }
 
-        public Client(Type clientContractType, string clientConfig, string url, string userName, string password)
+        public Client(string clientConfig, string url, string userName, string password)
+            : this(clientConfig, url, userName, password, false)
         {
-            _type = clientContractType;
-            _clientConfig = clientConfig;
-            _url = url;
-            if (connectionDictionary == null)
-                connectionDictionary = new Dictionary<string, ClientList>();
-            try
-            {
-                connection = connectionDictionary[_type.FullName];
-            }
-            catch
+        }
+
+        protected Client(string clientConfig, string url, string userName, string password, bool useClaims)
+        {
+            if (!connectionDictionary.TryGetValue(typeof(T).FullName, out _connection))
             {
-                //No entry!
-                connection = new ClientList(clientContractType, clientConfig, url, userName, password);
-                connectionDictionary.Add(_type.FullName, connection);
+                _connection = new Connection<T>(default(T), clientConfig, null, url, userName, password, useClaims);
+                connectionDictionary.Add(typeof(T).FullName, _connection);
             }
         }
 
@@ -407,21 +310,21 @@
         /// getting a channel via this property, load balancing and failover will occur.
         /// </summary>
         /// <returns></returns>
-        public IChannel Channel
+        public T Channel
         {
             get
             {
-                return connection._connection.Channel;
+                return _connection.Channel;
             }
             set
             {
-                connection._connection.Channel = value;
+                _connection.Channel = value;
             }
         }
 
         public static void ClearCache()
         {
-            connectionDictionary = null;
+            connectionDictionary = new Dictionary<string, Connection<T>>(); 
         }
     }
 }

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.csproj?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.csproj Fri Oct  9 04:04:55 2009
@@ -41,11 +41,15 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Microsoft.IdentityModel, Version=0.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
     <Reference Include="System" />
     <Reference Include="System.configuration" />
     <Reference Include="System.Core">
       <RequiredTargetFramework>3.5</RequiredTargetFramework>
     </Reference>
+    <Reference Include="System.IdentityModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
     <Reference Include="System.ServiceModel">
       <RequiredTargetFramework>3.0</RequiredTargetFramework>
     </Reference>

Modified: 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=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.cs Fri Oct  9 04:04:55 2009
@@ -61,7 +61,7 @@
     /// </summary>
     public class ConfigServiceClient : IConfigService
     {
-        public Client.Client csclient;
+        public Client.Client<IConfigService> csclient;
 
         /// <summary>
         /// This will initialize a new Config Service Client
@@ -71,7 +71,7 @@
         {
             //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"));
+            csclient = new Client.Client<IConfigService>(ConfigurationManager.AppSettings.Get("CS_DOTNET_ENDPOINT_CONFIG_HTTP"));
         }
 
         /// <summary>
@@ -81,11 +81,11 @@
         {
             get
             {
-                return (IConfigService)csclient.Channel;
+                return csclient.Channel;
             }
             set
             {
-                csclient.Channel = (IChannel)value;
+                csclient.Channel = value;
             }
         }
 
@@ -94,7 +94,7 @@
         /// </summary>
         public static void Initialize()
         {
-            Client.Client.ClearCache();
+            Client.Client<IConfigService>.ClearCache();
         }
 
 

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/DALMySQL/Customer.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/DALMySQL/Customer.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALMySQL/Customer.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALMySQL/Customer.cs Fri Oct  9 04:04:55 2009
@@ -481,6 +481,11 @@
             }
         }
 
+        public String getProfileIdFromStsIdentifier(string uniqueIdentifier, string issuingSts)
+        {
+            return null;
+        }
+
         private static MySqlParameter[] GetUpdateAccountBalanceParameters()
         {
             // Get the paramters from the cache

Modified: 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=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs Fri Oct  9 04:04:55 2009
@@ -178,7 +178,7 @@
             var response = new ClientConfigResponse();
             response.BS = rdr.GetString(rdr.GetOrdinal("URL"));
             response.BSName = rdr.GetString(rdr.GetOrdinal("BS"));
-            response.Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
+            response.Sec = rdr.GetBoolean(rdr.GetOrdinal("SEC"));
 
             rdr.Close();
 
@@ -205,7 +205,7 @@
             var response = new BSConfigResponse();
             response.OPS = rdr.GetString(rdr.GetOrdinal("URL"));
             response.OPSName = rdr.GetString(rdr.GetOrdinal("OPS"));
-            response.Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
+            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"));
@@ -306,7 +306,7 @@
                 bsLocations[i] = new ServiceLocation();
                 bsLocations[i].ServiceName = (string)rdr["SERVICENAME"];
                 bsLocations[i].ServiceURL = (string)rdr["URL"];
-                bsLocations[i].Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
+                bsLocations[i].Sec = (bool)rdr["SEC"];
                 i++;
             }
 
@@ -326,7 +326,7 @@
                 opsLocations[i] = new ServiceLocation();
                 opsLocations[i].ServiceName = (string)rdr["SERVICENAME"];
                 opsLocations[i].ServiceURL = (string)rdr["URL"];
-                opsLocations[i].Sec = rdr["SEC"] == DBNull.Value ? false : (bool)rdr["SEC"];
+                opsLocations[i].Sec = (bool)rdr["SEC"];
                 i++;
             }
 

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Customer.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Customer.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Customer.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Customer.cs Fri Oct  9 04:04:55 2009
@@ -54,25 +54,25 @@
 
 namespace Trade.DALSQLServer
 {
-    public class Customer :ICustomer
+    public class Customer : ICustomer
     {
         public Customer()
         {
         }
 
         //Constructor for internal DAL-DAL calls to use an existing DB connection.
-        public Customer (SqlConnection conn, SqlTransaction trans)
+        public Customer(SqlConnection conn, SqlTransaction trans)
         {
             _internalConnection = conn;
             _internalADOTransaction = trans;
         }
 
         private SqlConnection _internalConnection;
-        private SqlTransaction _internalADOTransaction=null;
-        
+        private SqlTransaction _internalADOTransaction = null;
+
         //Used only when doing ADO.NET transactions.
         //This will be completely ignored when null, and not attached to a cmd object
-        //In SQLServerHelper unless it has been initialized explicitly in the BSL with a
+        //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
@@ -81,7 +81,7 @@
         {
             if (_internalConnection.State != ConnectionState.Open)
                 _internalConnection.Open();
-           _internalADOTransaction = _internalConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
+            _internalADOTransaction = _internalConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
         }
 
         //Used only when doing ADO.NET transactions.
@@ -108,7 +108,7 @@
 
         public void Close()
         {
-            if (_internalConnection!= null && _internalConnection.State!=ConnectionState.Closed)
+            if (_internalConnection != null && _internalConnection.State != ConnectionState.Closed)
                 _internalConnection.Close();
         }
 
@@ -135,7 +135,8 @@
         private const string SQL_INSERT_ACCOUNTPROFILE = "INSERT INTO dbo.accountprofile VALUES (@Address, @Password, @UserId, @Email, @CreditCard, @FullName)";
         private const string SQL_INSERT_ACCOUNT = "INSERT INTO dbo.account (CREATIONDATE, OPENBALANCE, LOGOUTCOUNT, BALANCE, LASTLOGIN, LOGINCOUNT, PROFILE_USERID) VALUES (GetDate(), @OpenBalance, @LogoutCount, @Balance, @LastLogin, @LoginCount, @UserId); SELECT ID=@@IDENTITY";
         private const string SQL_DEBIT_ACCOUNT = "UPDATE dbo.ACCOUNT WITH (ROWLOCK) SET BALANCE=(BALANCE-@Debit) WHERE ACCOUNTID=@AccountId";
-
+        private const string SQL_SELECT_CUSTOMERPROFILE_BYSTSID = "Set NOCOUNT ON; SELECT ACCOUNTPROFILE.UserID FROM dbo.ACCOUNT, dbo.ACCOUNTPROFILE, dbo.STSACCOUNTLOOKUP WITH (NOLOCK) WHERE ACCOUNT.PROFILE_USERID = ACCOUNTPROFILE.USERID and ACCOUNT.ACCOUNTID = STSACCOUNTLOOKUP.UserID and STSACCOUNTLOOKUP.StsUniqueIdentifier = @StsUniqueIdentifier and STSACCOUNTLOOKUP.IssuingSts = @IssuingSts";
+ 
         //Parameters
         private const string PARM_USERID = "@UserId";
         private const string PARM_HOLDINGID = "@holdingId";
@@ -153,10 +154,12 @@
         private const string PARM_LOGINCOUNT = "@LoginCount";
         private const string PARM_TOPORDERS = "@TopOrders";
         private const string PARM_DEBIT = "@Debit";
-        
+        private const string PARM_STSUNIQUEID = "@StsUniqueIdentifier";
+        private const string PARM_ISSUINGSTS = "@IssuingSts";
+
         public List<OrderDataModel> getOrders(string userID, bool top, int maxTop, int maxDefault)
         {
-            
+
             //Here you can configure between two settings: top default to display
             //is MAX_DISPLAY_ORDERS; the upper limit is MAX_DISPLAY_TOP_ORDERS.
             //Set these in Web.Config/Trade.BusinessServiceHost.exe.config; and those will be the toggle 
@@ -174,7 +177,7 @@
                 }
                 SqlParameter accountidparm = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
                 accountidparm.Value = userID;
-                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, commandText,accountidparm);
+                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, commandText, accountidparm);
                 List<OrderDataModel> orders = new List<OrderDataModel>();
                 while (rdr.Read())
                 {
@@ -189,10 +192,10 @@
                         else
                             completionDate = DateTime.MinValue;
                     }
-                    catch (Exception e) 
+                    catch (Exception e)
                     {
                         string message = e.Message;
-                        completionDate = DateTime.MinValue; 
+                        completionDate = DateTime.MinValue;
                     }
                     OrderDataModel order = new OrderDataModel(orderid, rdr.GetString(1), rdr.GetString(2), openDate, (DateTime)completionDate, rdr.GetDouble(5), rdr.GetDecimal(6), rdr.GetDecimal(7), rdr.GetString(8));
                     orders.Add(order);
@@ -200,7 +203,32 @@
                 rdr.Close();
                 return orders;
             }
-            catch 
+            catch
+            {
+                throw;
+            }
+        }
+
+        public String getProfileIdFromStsIdentifier(string uniqueId, string issuingSts)
+        {
+            try
+            {
+                SqlParameter parm1 = new SqlParameter(PARM_STSUNIQUEID, SqlDbType.VarChar, 250);
+                parm1.Value = uniqueId;
+                SqlParameter parm2 = new SqlParameter(PARM_ISSUINGSTS, SqlDbType.VarChar, 250);
+                parm2.Value = issuingSts;
+
+                SqlParameter[] parms = new SqlParameter[] { parm1, parm2 };
+                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleRow(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SELECT_CUSTOMERPROFILE_BYSTSID, parms);
+                if (rdr.Read())
+                {
+                    string profileId = rdr.GetString(0);
+                    rdr.Close();
+                    return profileId;
+                }
+                return null;
+            }
+            catch
             {
                 throw;
             }
@@ -212,7 +240,7 @@
             {
                 SqlParameter parm1 = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
                 parm1.Value = userid;
-                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleRowSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text,SQL_SELECT_CUSTOMERPROFILE_BYUSERID, parm1);
+                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleRowSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SELECT_CUSTOMERPROFILE_BYUSERID, parm1);
                 if (rdr.Read())
                 {
                     string userPassword = rdr.GetString(1);
@@ -231,7 +259,7 @@
                 }
                 return null;
             }
-            catch 
+            catch
             {
                 throw;
             }
@@ -243,7 +271,7 @@
             {
                 SqlParameter parm1 = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
                 parm1.Value = userid;
-                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleRowSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SELECT_CUSTOMERPROFILE_BYUSERID,parm1);
+                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleRowSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SELECT_CUSTOMERPROFILE_BYUSERID, parm1);
                 if (rdr.Read())
                 {
                     AccountProfileDataModel customerprofile = new AccountProfileDataModel(rdr.GetString(0), rdr.GetString(1), rdr.GetString(2), rdr.GetString(3), rdr.GetString(4), rdr.GetString(5));
@@ -261,17 +289,17 @@
 
         public void logOutUser(string userID)
         {
-             try
-             {
-                    SqlParameter parm1 = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
-                    parm1.Value = userID;
-                    SQLServerHelper.ExecuteNonQuery(_internalConnection,_internalADOTransaction, CommandType.Text,SQL_UPDATE_LOGOUT, parm1);
-                    return;
-             }
-             catch
-             {
-                 throw;
-             }
+            try
+            {
+                SqlParameter parm1 = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
+                parm1.Value = userID;
+                SQLServerHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_UPDATE_LOGOUT, parm1);
+                return;
+            }
+            catch
+            {
+                throw;
+            }
         }
 
         public AccountDataModel getCustomerByUserID(string userID)
@@ -290,7 +318,7 @@
                 rdr.Close();
                 return null;
             }
-            catch 
+            catch
             {
                 throw;
             }
@@ -302,7 +330,7 @@
             {
                 SqlParameter useridparm = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
                 useridparm.Value = userId;
-                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleParm(_internalConnection,_internalADOTransaction,CommandType.Text,SQL_SELECT_CLOSED_ORDERS,useridparm);
+                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SELECT_CLOSED_ORDERS, useridparm);
                 List<OrderDataModel> closedorders = new List<OrderDataModel>();
                 DateTime completionDate = DateTime.MinValue;
                 while (rdr.Read())
@@ -323,7 +351,7 @@
                     rdr.Close();
                     useridparm = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
                     useridparm.Value = userId;
-                    SQLServerHelper.ExecuteNonQuerySingleParm(_internalConnection,_internalADOTransaction, CommandType.Text,SQL_UPDATE_CLOSED_ORDERS,useridparm);
+                    SQLServerHelper.ExecuteNonQuerySingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_UPDATE_CLOSED_ORDERS, useridparm);
                 }
                 else
                     rdr.Close();
@@ -341,24 +369,24 @@
             {
                 SqlParameter useridparm = new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20);
                 useridparm.Value = userID;
-                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleParm(_internalConnection,_internalADOTransaction, CommandType.Text, SQL_SELECT_HOLDINGS, useridparm);
+                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleParm(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SELECT_HOLDINGS, useridparm);
                 List<HoldingDataModel> holdings = new List<HoldingDataModel>();
                 while (rdr.Read())
                 {
-                    HoldingDataModel holding = new HoldingDataModel(rdr.GetInt32(0), rdr.GetDouble(1), rdr.GetDecimal(2), rdr.GetDateTime(3), rdr.GetString(4),rdr.GetInt32(5));
+                    HoldingDataModel holding = new HoldingDataModel(rdr.GetInt32(0), rdr.GetDouble(1), rdr.GetDecimal(2), rdr.GetDateTime(3), rdr.GetString(4), rdr.GetInt32(5));
                     holdings.Add(holding);
                 }
                 rdr.Close();
                 return holdings;
             }
-            catch 
+            catch
             {
                 throw;
             }
         }
-       
-       public HoldingDataModel getHoldingForUpdate(int orderID)
-       {
+
+        public HoldingDataModel getHoldingForUpdate(int orderID)
+        {
             try
             {
                 SqlParameter orderIDparm = new SqlParameter(PARM_ORDERID, SqlDbType.Int);
@@ -386,7 +414,7 @@
                                                 new SqlParameter(PARM_USERID, SqlDbType.VarChar, 20)};
                 holdingidparms[0].Value = holdingid;
                 holdingidparms[1].Value = userid;
-                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleRow(_internalConnection,_internalADOTransaction, CommandType.Text, SQL_SELECT_HOLDING_NOLOCK, holdingidparms);
+                SqlDataReader rdr = SQLServerHelper.ExecuteReaderSingleRow(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_SELECT_HOLDING_NOLOCK, holdingidparms);
                 while (rdr.Read())
                 {
                     HoldingDataModel holding = new HoldingDataModel(holdingid, rdr.GetInt32(0), rdr.GetDouble(1), rdr.GetDecimal(2), rdr.GetDateTime(3), rdr.GetString(4));
@@ -395,7 +423,7 @@
                 }
                 return null;
             }
-            catch 
+            catch
             {
                 throw;
             }
@@ -411,9 +439,9 @@
                 accountParms[1].Value = accountID;
                 SQLServerHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_DEBIT_ACCOUNT, accountParms);
             }
-            catch 
+            catch
             {
-                throw; 
+                throw;
             }
             return;
         }
@@ -433,7 +461,7 @@
                 customer.accountID = Convert.ToInt32(SQLServerHelper.ExecuteScalar(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_INSERT_ACCOUNT, AccountParms));
                 return;
             }
-            catch 
+            catch
             {
                 throw;
             }
@@ -451,9 +479,9 @@
                 ProfileParms[3].Value = customerprofile.email;
                 ProfileParms[4].Value = customerprofile.creditCard;
                 ProfileParms[5].Value = customerprofile.fullName;
-                SQLServerHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction,CommandType.Text, SQL_INSERT_ACCOUNTPROFILE, ProfileParms);
+                SQLServerHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_INSERT_ACCOUNTPROFILE, ProfileParms);
             }
-            catch 
+            catch
             {
                 throw;
             }
@@ -474,7 +502,7 @@
                 SQLServerHelper.ExecuteNonQuery(_internalConnection, _internalADOTransaction, CommandType.Text, SQL_UPDATE_ACCOUNTPROFILE, ProfileParms);
                 return customerprofile;
             }
-            catch 
+            catch
             {
                 throw;
             }
@@ -498,7 +526,7 @@
         private static SqlParameter[] GetCreateAccountProfileParameters()
         {
             // Get the parameters from the cache
-            SqlParameter[] parms = SQLServerHelper.GetCacheParameters(SQL_INSERT_ACCOUNTPROFILE);          
+            SqlParameter[] parms = SQLServerHelper.GetCacheParameters(SQL_INSERT_ACCOUNTPROFILE);
             // If the cache is empty, rebuild the parameters
             if (parms == null)
             {
@@ -530,7 +558,7 @@
                       new SqlParameter(PARM_CREDITCARD, SqlDbType.VarChar, StockTraderUtility.CREDITCARD_MAX_LENGTH),
                       new SqlParameter(PARM_FULLNAME, SqlDbType.VarChar, StockTraderUtility.FULLNAME_MAX_LENGTH),
                       new SqlParameter(PARM_USERID, SqlDbType.VarChar, StockTraderUtility.USERID_MAX_LENGTH)};
-                
+
                 // Add the parametes to the cached
                 SQLServerHelper.CacheParameters(SQL_UPDATE_ACCOUNTPROFILE, parms);
             }
@@ -540,7 +568,7 @@
         private static SqlParameter[] GetCreateAccountParameters()
         {
             // Get the parameters from the cache
-            SqlParameter[] parms = SQLServerHelper.GetCacheParameters(SQL_INSERT_ACCOUNT);          
+            SqlParameter[] parms = SQLServerHelper.GetCacheParameters(SQL_INSERT_ACCOUNT);
             // If the cache is empty, rebuild the parameters
             if (parms == null)
             {
@@ -551,7 +579,7 @@
                       new SqlParameter(PARM_LASTLOGIN, SqlDbType.DateTime),
                       new SqlParameter(PARM_LOGINCOUNT, SqlDbType.Int),
                       new SqlParameter(PARM_USERID, SqlDbType.VarChar, StockTraderUtility.USERID_MAX_LENGTH)};
-                
+
                 // Add the parameters to the cached
                 SQLServerHelper.CacheParameters(SQL_INSERT_ACCOUNT, parms);
             }

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/ICustomer.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/ICustomer.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/ICustomer.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/ICustomer.cs Fri Oct  9 04:04:55 2009
@@ -56,6 +56,7 @@
         List<HoldingDataModel> getHoldings(string userID);
         HoldingDataModel getHoldingForUpdate(int orderID);
         HoldingDataModel getHolding(string userID, int holdingID);
+        String getProfileIdFromStsIdentifier(string uniqueIdentifier, string issuingSts);
         void insertAccount(AccountDataModel customer);
         void insertAccountProfile(AccountProfileDataModel customerprofile);
         List<OrderDataModel> getOrders(string userID, bool top, int maxTop, int maxDefault);

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/CertificateUtil.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/CertificateUtil.cs?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/CertificateUtil.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/CertificateUtil.cs Fri Oct  9 04:04:55 2009
@@ -0,0 +1,86 @@
+//
+// 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.
+//
+
+
+using System;
+using System.Security.Cryptography.X509Certificates;
+
+namespace Trade.Utility
+{
+    /// <summary>
+    /// A utility class which helps to retrieve an x509 certificates
+    /// </summary>
+    public class CertificateUtil
+    {
+        /// <summary>
+        /// Gets a certificate from a given store.
+        /// </summary>
+        /// <param name="name">Certificate Store where to look for the certificate.</param>
+        /// <param name="location">StoreLocation of the certificate.</param>
+        /// <param name="subjectName">Distinguished name of the certificate subject name.</param>
+        /// <returns>Instance of X509Certificate2.</returns>
+        public static X509Certificate2 GetCertificate(StoreName name, StoreLocation location, string subjectName)
+        {
+            X509Store store = new X509Store(name, location);
+            X509Certificate2Collection certificates = null;
+            store.Open(OpenFlags.ReadOnly);
+
+            try
+            {
+                X509Certificate2 result = null;
+
+                //
+                // Every time we call store.Certificates property, a new collection will be returned.
+                //
+                certificates = store.Certificates;
+
+                for (int i = 0; i < certificates.Count; i++)
+                {
+                    X509Certificate2 cert = certificates[i];
+
+                    if (cert.SubjectName.Name.ToLower() == subjectName.ToLower())
+                    {
+                        if (result != null)
+                            throw new ApplicationException(string.Format("There is more than one certificate found for subject Name {0}", subjectName));
+
+                        result = new X509Certificate2(cert);
+                    }
+                }
+
+                if (result == null)
+                {
+                    throw new ApplicationException(string.Format("No certificate was found for subject Name {0}", subjectName));
+                }
+                return result;
+            }
+            finally
+            {
+                if (certificates != null)
+                {
+                    for (int i = 0; i < certificates.Count; i++)
+                    {
+                        X509Certificate2 cert = certificates[i];
+                        cert.Reset();
+                    }
+                }
+
+                store.Close();
+            }
+        }
+    }
+
+}
\ No newline at end of file

Added: incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Cryptography.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Cryptography.cs?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Cryptography.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Cryptography.cs Fri Oct  9 04:04:55 2009
@@ -0,0 +1,46 @@
+//
+// 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.
+//
+
+using System;
+using System.Security.Cryptography;
+
+namespace Trade.Utility
+{
+    public class Cryptography
+    {
+        // Create a salt value using a cryptographic random number generator
+        public static byte[] CreateSalt()
+        {
+            byte[] salt = new byte[32];
+            RNGCryptoServiceProvider.Create().GetBytes(salt);
+            return salt;
+        }
+
+        // Calculate the SHA256 hash of the plain text value and the salt value.
+        public static byte[] GetSaltedHash(byte[] plainText, byte[] salt)
+        {
+            // Combine the plain text and salt values before calculating the hash
+            byte[] saltedText = new byte[plainText.Length + salt.Length];
+            System.Buffer.BlockCopy(plainText, 0, saltedText, 0, plainText.Length);
+            System.Buffer.BlockCopy(salt, 0, saltedText, plainText.Length, salt.Length);
+
+            // Create the SHA256Managed class and calculate the hash value 
+            SHA256Managed sha256 = new SHA256Managed();
+            return sha256.ComputeHash(saltedText);
+        }
+    }
+}

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.csproj?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.csproj Fri Oct  9 04:04:55 2009
@@ -62,7 +62,9 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CertificateUtil.cs" />
     <Compile Include="ConfigCertificatePolicy.cs" />
+    <Compile Include="Cryptography.cs" />
     <Compile Include="Loggers\ConsoleLogger.cs" />
     <Compile Include="CustomCertificateValidator.cs" />
     <Compile Include="CustomUserNameValidator.cs" />

Modified: 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=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/App.config (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/App.config Fri Oct  9 04:04:55 2009
@@ -72,10 +72,19 @@
     Config Service Config Service
     
     *********************************************************-->
-    <!-- <services>
-      <service name="Trade.ConfigServiceImplementation.ConfigService">
+    <services>
+      <service name="Trade.ConfigServiceImplementation.ConfigService"
+               behaviorConfiguration="ConfigHost_ServiceBehavior">
+
+        <endpoint binding="basicHttpBinding"
+                 bindingConfiguration="ConfigHost_BasicHttpBinding"
+                 contract ="Trade.ConfigServiceContract.IConfigService"
+                  />
+        <endpoint address="Mex"
+                  binding="mexHttpBinding"
+                  contract="IMetadataExchange" />
       </service>
-    </services>-->
+    </services>
     <!--********************************************************
         
     Config Service BINDINGS
@@ -85,15 +94,19 @@
       <!--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>
+        <binding name="ConfigHost_BasicHttpBinding"/>
       </basicHttpBinding>
     </bindings>
+
+    <behaviors>
+      <serviceBehaviors>
+
+        <!-- Default BS Host Behavior -->
+        <behavior name="ConfigHost_ServiceBehavior">
+          <serviceMetadata httpGetEnabled="true"/>
+        </behavior>
+      </serviceBehaviors>
+    </behaviors>
   </system.serviceModel>
   <system.web>
     <membership defaultProvider="ClientAuthenticationMembershipProvider">

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/Program.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/Program.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/Program.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/Program.cs Fri Oct  9 04:04:55 2009
@@ -71,11 +71,7 @@
                 string shortHostName = System.Net.Dns.GetHostName();
                 IPHostEntry myEntry = System.Net.Dns.GetHostEntry(shortHostName);
                 string myName = myEntry.HostName;
-                //The key call to create our list of runtime hosts to be initialized.
-                //List<ServiceHostInfo> startupList = new List<ServiceHostInfo>(new ServiceHostInfo[] { new ServiceHostInfo(Settings.SELFHOST_VHOST_NAME, false, null, new object[] { new Trade.BusinessServiceImplementation.ErrorBehaviorAttribute() }, new TradeServiceWcf()) });
-                ////Stock call to startup the Master Host.
-                //base.startService(new Settings(), new ConfigurationService(), new NodeCommunication(), null, new ConfigurationActions(true), startupList, null, new object[] { typeof(Iconfigservice) });
-
+                
                 Settings thisSettings = new Settings();
 
                 Uri TradeServiceUriBase = new Uri("http://" + myName + ":7000/tradeconfigservice");
@@ -83,27 +79,30 @@
                 //Create a ServiceHost for the configservice service.
                 Type serviceType = typeof(ConfigService);
                 host = new ServiceHost(serviceType, TradeServiceUriBase);
-                addEndpointsAndBehaviors(host, TradeServiceUriBase);
+
+                //Describe for Console output
+                StockTraderUtility.DescribeService(host);
+
                 host.Open();
 
             }
 
-            private ServiceHost addEndpointsAndBehaviors(ServiceHost host, Uri uri)
-            {
-                ServiceMetadataBehavior mexbehavior = new ServiceMetadataBehavior();
-                mexbehavior.HttpGetEnabled = true;
-                mexbehavior.HttpGetUrl = uri;
-                host.Description.Behaviors.Add(mexbehavior);
-                Binding mexHttpBinding = MetadataExchangeBindings.CreateMexHttpBinding();
-                ServiceEndpoint sepMex = host.AddServiceEndpoint(typeof(IMetadataExchange), mexHttpBinding, uri.AbsoluteUri + "/mex");
-                BasicHttpBinding httpBinding = new BasicHttpBinding();
-                host.AddServiceEndpoint(typeof(IConfigService), httpBinding, "");
+            //private ServiceHost addEndpointsAndBehaviors(ServiceHost host, Uri uri)
+            //{
+            //    ServiceMetadataBehavior mexbehavior = new ServiceMetadataBehavior();
+            //    mexbehavior.HttpGetEnabled = true;
+            //    mexbehavior.HttpGetUrl = uri;
+            //    host.Description.Behaviors.Add(mexbehavior);
+            //    Binding mexHttpBinding = MetadataExchangeBindings.CreateMexHttpBinding();
+            //    ServiceEndpoint sepMex = host.AddServiceEndpoint(typeof(IMetadataExchange), mexHttpBinding, uri.AbsoluteUri + "/mex");
+            //    BasicHttpBinding httpBinding = new BasicHttpBinding();
+            //    host.AddServiceEndpoint(typeof(IConfigService), httpBinding, "");
 
-                //Describe for Console output
-                StockTraderUtility.DescribeService(host);
+            //    //Describe for Console output
+            //    StockTraderUtility.DescribeService(host);
 
-                return host;
-            }
+            //    return host;
+            //}
 
             public void Dispose()
             {

Added: incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/ActiveStsConsole.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/ActiveStsConsole.csproj?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/ActiveStsConsole.csproj (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/ActiveStsConsole.csproj Fri Oct  9 04:04: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>{890E597A-A3BF-429A-BF89-0AEA663A855D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Trade.ActiveStsConsole</RootNamespace>
+    <AssemblyName>Trade.ActiveStsConsole</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </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="Microsoft.IdentityModel, Version=0.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.IdentityModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.IdentityModel.Selectors">
+      <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="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\common\StockTraderUtility\Utility.csproj">
+      <Project>{382E6E1C-E430-4F6C-BC41-5D84A3798B02}</Project>
+      <Name>Utility</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\ActiveStsImplementation\ActiveStsImplementation.csproj">
+      <Project>{5BEFCEAE-303F-421E-ABEC-DC592BE71BFB}</Project>
+      <Name>ActiveStsImplementation</Name>
+    </ProjectReference>
+  </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)\"
+
+copy "$(SolutionDir)\..\common\DALSQLServer\$(OutDir)\Trade.DALSQLServer.dll"  "$(SolutionDir)$(OutDir)\Trade.DALSQLServer.dll
"
+
+copy "$(SolutionDir)\..\common\DALSQLServer\$(OutDir)\Trade.DALSQLServer.dll"  "$(TargetDir)\Trade.DALSQLServer.dll
"</PostBuildEvent>
+  </PropertyGroup>
+</Project>
\ No newline at end of file

Added: incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/App.config
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/App.config?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/App.config (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/App.config Fri Oct  9 04:04:55 2009
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+  <configSections>
+    <!-- Registers the microsoft.IdentityModel configuration section -->
+    <section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=0.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+  </configSections>
+
+  <appSettings>
+    <add key="LOGGER_MODE" value="CONSOLE"/>
+    <add key="EVENT_LOG" value="Trade Business Services" />
+    <add key="LOGGING_ENABLED" value="ON"/>
+
+    <add key="IssuerName" value="ActiveSTS" />
+    <add key="SigningCertificateName" value="CN=BSL.Com" />
+    <add key="EncryptingCertificateName" value="CN=BSL.Com" />
+    <add key="PassiveIssuerName" value="PassiveSTS"/>
+  </appSettings>
+
+  <microsoft.identityModel>
+    <service>
+      <!--An ActAs handlers will be required to support delegation -->
+      <securityTokenHandlers name="ActAs">
+        <clear/>
+        <add type="Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler, Microsoft.IdentityModel, Version=0.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+      </securityTokenHandlers>
+      <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.SimpleIssuerNameRegistry, Microsoft.IdentityModel, Version=0.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+    </service>
+  </microsoft.identityModel>
+  
+  <system.serviceModel>
+    <bindings>
+      <ws2007HttpBinding>
+        <binding name="ActiveSTS">
+          <security mode="Message">
+            <message clientCredentialType="Certificate" negotiateServiceCredential="false" establishSecurityContext="false"/>
+          </security>
+        </binding>
+      </ws2007HttpBinding>
+    </bindings>
+    <behaviors>
+      <serviceBehaviors>
+        <behavior name="ActiveSTS">
+          <serviceCredentials>
+            <clientCertificate>
+              <authentication revocationMode="NoCheck" certificateValidationMode="None"/>
+            </clientCertificate>
+            <serviceCertificate findValue="CN=BSL.Com" storeLocation="LocalMachine" storeName="TrustedPeople" x509FindType="FindBySubjectDistinguishedName" />
+          </serviceCredentials>
+        </behavior>
+      </serviceBehaviors>
+    </behaviors>
+    
+    <services>
+      <service name="Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract" behaviorConfiguration="ActiveSTS">
+        <endpoint bindingConfiguration="ActiveSTS" 
+                  binding="ws2007HttpBinding"
+                  contract="Microsoft.IdentityModel.Protocols.WSTrust.IWSTrust13SyncContract">
+        </endpoint>
+      </service>
+    </services>
+  </system.serviceModel>
+
+  
+
+</configuration>

Added: incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Program.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Program.cs?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Program.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Program.cs Fri Oct  9 04:04:55 2009
@@ -0,0 +1,118 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.IdentityModel.Configuration;
+using System.Configuration;
+using Trade.ActiveStsImplementation;
+using Microsoft.IdentityModel.Tokens;
+using Microsoft.IdentityModel.Protocols.WSTrust;
+using System.Net;
+using System.ServiceModel;
+using Trade.Utility;
+using System.IdentityModel.Selectors;
+
+namespace Trade.ActiveStsConsole
+{
+    class ActiveSTS_ConsoleHost
+    {
+        /// <summary>
+        /// The program entry class. Note how this simply inherits from the provided base class.
+        /// </summary>
+        public class ActiveSTSConsoleHost : IDisposable
+        {
+            private ServiceHost serviceHost;
+
+            /// <summary>
+            /// This is the key call where you will define parameters for the Master host startup, and call
+            /// the base 'startService' method.
+            /// </summary>
+            public void start()
+            {
+                string issuerName = ConfigurationManager.AppSettings["IssuerName"];
+                //string passiveIssuerName = ConfigurationManager.AppSettings["PassiveIssuerName"];
+
+                SecurityTokenServiceConfiguration config = new SecurityTokenServiceConfiguration(issuerName);
+
+                config.SecurityTokenService = typeof(CustomSecurityTokenService);
+                SecurityTokenHandlerCollection actAsHandlerCollection = config.SecurityTokenHandlerCollectionManager[SecurityTokenHandlerCollectionManager.Usage.ActAs];
+
+                //actAsHandlerCollection.Configuration.IssuerNameRegistry = new CustomIssuerNameRegistry(passiveIssuerName);
+                actAsHandlerCollection.Configuration.AudienceRestriction.AudienceMode = AudienceUriMode.Never;
+
+                string shortHostName = System.Net.Dns.GetHostName();
+                IPHostEntry myEntry = System.Net.Dns.GetHostEntry(shortHostName);
+                string myName = myEntry.HostName;
+
+                serviceHost = new WSTrustServiceHost(config, new Uri("http://" + myName + ":9001/tradeactivests"));
+
+                //Describe for Console output
+                StockTraderUtility.DescribeService(serviceHost);
+
+                serviceHost.Open();
+
+            }
+
+            public void Dispose()
+            {
+                if (serviceHost != null)
+                {
+                    serviceHost.Close();
+                }
+            }
+        }
+
+        [STAThread]
+        static void Main(string[] args)
+        {
+            Console.Clear();
+            Console.SetWindowSize(Console.LargestWindowWidth - 30, Console.LargestWindowHeight - 30);
+            Console.Title = ".NET StockTrader Active STS Host";
+
+            bool restart = true;
+            while (restart)
+            {
+                using (var serviceHost = new ActiveSTSConsoleHost())
+                {
+                    try
+                    {
+                        serviceHost.start();
+
+                        Console.WriteLine(" {0} is started\n", Console.Title);
+                    }
+                    catch (Exception ex)
+                    {
+                        StockTraderUtility.Logger.WriteException(ex);
+                    }
+
+                    Console.WriteLine("Press Enter to quit or Ctrl+R to restart");
+
+                    restart = WaitForRestart();
+                }
+            }
+        }
+
+        private static bool WaitForRestart()
+        {
+            while (true)
+            {
+                // clear users input
+                Console.CursorLeft = 0;
+                Console.Write(' ');
+                Console.CursorLeft = 0;
+
+                // read users input
+                var key = Console.ReadKey();
+                if ((key.Modifiers & ConsoleModifiers.Control) != 0
+                    && key.Key == ConsoleKey.R)
+                {
+                    return true;
+                }
+                if (key.Key == ConsoleKey.Enter || key.Key == ConsoleKey.Escape)
+                {
+                    return false;
+                }
+            }
+        }
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Properties/AssemblyInfo.cs?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Properties/AssemblyInfo.cs (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Properties/AssemblyInfo.cs Fri Oct  9 04:04: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("ActiveStsConsole")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ActiveStsConsole")]
+[assembly: AssemblyCopyright("Copyright ©  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("068905a0-ee50-4065-be33-b60073336ca4")]
+
+// 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/identity_provider/ActiveStsImplementation/ActiveStsImplementation.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/ActiveStsImplementation.csproj?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/ActiveStsImplementation.csproj (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/ActiveStsImplementation.csproj Fri Oct  9 04:04:55 2009
@@ -0,0 +1,79 @@
+<?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>{5BEFCEAE-303F-421E-ABEC-DC592BE71BFB}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Trade.ActiveStsImplementation</RootNamespace>
+    <AssemblyName>Trade.ActiveStsImplementation</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </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="Microsoft.IdentityModel, Version=0.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.IdentityModel">
+      <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="CustomSecurityTokenService.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>
+  <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



Mime
View raw message