You are viewing a plain text version of this content. The canonical link for it is here.
Posted to stonehenge-commits@incubator.apache.org by be...@apache.org on 2009/10/09 04:05:00 UTC

svn commit: r823397 [1/5] - in /incubator/stonehenge/trunk/stocktrader/dotnet: ./ business_service/BusinessServiceConsole/ business_service/BusinessServiceImplementation/ business_service/OrderProcessorASyncClient/ common/BasicClient/ common/ConfigClie...

Author: bendewey
Date: Fri Oct  9 04:04:55 2009
New Revision: 823397

URL: http://svn.apache.org/viewvc?rev=823397&view=rev
Log:
STONEHENGE-73 (stonehengeIdentity-08-Oct-2009.zip) for Pablo, Thanks.

Added:
    incubator/stonehenge/trunk/stocktrader/dotnet/Readme.txt
    incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/CertificateUtil.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Cryptography.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/ActiveStsConsole.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/App.config
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Program.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsConsole/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/ActiveStsImplementation.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/CustomSecurityTokenService.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/ActiveStsImplementation/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/IdentityProviderSolution.sln
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/App_Code/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/App_Code/CertificateUtil.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/App_Code/Common.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/App_Code/CustomSecurityTokenService.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/App_Code/CustomSecurityTokenServiceConfiguration.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/Default.aspx
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/Default.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/Images/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/Images/logo.png   (with props)
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/Login.aspx
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/Login.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveSts/web.config
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalFactory/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalFactory/Customer.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalFactory/PassiveStsDalFactory.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalFactory/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalFactory/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalMySql/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalMySql/Customer.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalMySql/MySQLHelper.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalMySql/PassiveStsDalMySql.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalMySql/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalMySql/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalSqlServer/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalSqlServer/Customer.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalSqlServer/PassiveStsDalSqlServer.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalSqlServer/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalSqlServer/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsDalSqlServer/SQLServerHelper.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsIDal/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsIDal/ICustomer.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsIDal/PassiveStsIDal.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsIDal/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsIDal/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsImplementation/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsImplementation/Class1.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsImplementation/PassiveStsImplementation.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsImplementation/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsImplementation/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsImplementation/StsClient.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsModelClasses/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsModelClasses/AccountDataModel.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsModelClasses/PassiveStsModelClasses.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsModelClasses/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/PassiveStsModelClasses/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/Utility/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/Utility/Cryptography.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/Utility/Properties/
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/Utility/Properties/AssemblyInfo.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/identity_provider/Utility/Utility.csproj
Modified:
    incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd
    incubator/stonehenge/trunk/stocktrader/dotnet/RunServices.bat
    incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/App.config
    incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/BusinessServiceConsole.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/Program.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/BusinessServiceImplementation.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeServiceFacadeWcf.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/business_service/OrderProcessorASyncClient/OrderProcessorAsyncClient.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/BasicClient/BasicClient.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/common/ConfigClient/ConfigClient.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/DALMySQL/Customer.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Config.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/DALSQLServer/Customer.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/IDAL/ICustomer.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/common/StockTraderUtility/Utility.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/App.config
    incubator/stonehenge/trunk/stocktrader/dotnet/config_service/ConfigServiceConsoleHost/Program.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/order_processor/OrderProcessorConsoleServiceHost/App.config
    incubator/stonehenge/trunk/stocktrader/dotnet/order_processor/OrderProcessorConsoleServiceHost/Program.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/setup_utilities/Util/AuthorizeWcfServices.bat
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/BusinessServiceClient/BusinessServiceClient.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/BusinessServiceClient/BusinessServiceClient.csproj
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Account.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Default.aspx
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Default.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Global.asax
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Order.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Portfolio.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/PortfolioBySymbol.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Site.master.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/StockTrade.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/TradeHome.aspx.cs
    incubator/stonehenge/trunk/stocktrader/dotnet/trader_client/Trade/Web.config

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd Fri Oct  9 04:04:55 2009
@@ -79,6 +79,15 @@
 "%MSBuildToolsPath%msbuild" StockTraderWebAppSolution.sln /t:Build /p:Configuration=Debug;Platform="Any CPU"
 "%MSBuildToolsPath%msbuild" StockTraderWebAppSolution.sln /t:Build /p:Configuration=release;Platform="Any CPU"
 
+cd ..\identity_provider
+@if not exist IdentityProviderSolution.sln Goto :Error1
+
+@echo Build trader_client
+"%MSBuildToolsPath%msbuild" IdentityProviderSolution.sln /t:Clean /p:Configuration=Debug
+"%MSBuildToolsPath%msbuild" IdentityProviderSolution.sln /t:Clean /p:Configuration=release
+"%MSBuildToolsPath%msbuild" IdentityProviderSolution.sln /t:Build /p:Configuration=Debug;Platform="Any CPU"
+"%MSBuildToolsPath%msbuild" IdentityProviderSolution.sln /t:Build /p:Configuration=release;Platform="Any CPU"
+
 
 @cd ..
 
@@ -92,6 +101,7 @@
 @echo ..\..\order_processor
 @echo ..\business_service
 @echo ..\trader_client\
+@echo ..\identiy_provider\
 @echo These file directories are expected under the directory where this script is running from. 
 @Set ERRORLEVEL=1
 @goto Exit

Added: incubator/stonehenge/trunk/stocktrader/dotnet/Readme.txt
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/Readme.txt?rev=823397&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/Readme.txt (added)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/Readme.txt Fri Oct  9 04:04:55 2009
@@ -0,0 +1,28 @@
+1. Follow the steps discribed in the Stonehenge .NET StockTrader Installation Guide,
+http://cwiki.apache.org/confluence/display/STONEHENGE/Stonehenge+.NET+StockTrader+Installation+Guide
+
+2. Open ports 9001 on your firewall (This port is used by the Active STS).
+
+   1. Control Panel->Windows Firewall->"Allow a program through the fire wall"
+   2. You will get to a dialog, choose exceptions Tab
+   3. Click Add Port
+   4. Name it "9001" and put 9001 in the port Number field
+   
+3. Setup the website under IIS
+
+   1. In IIS manager
+   2. Right-click Default Website and choose Add a Virtual Directory
+   3. Enter trade_identity as the alias.
+   4. Select identity_provider\PassiveSts as the physical path
+   5. If your running vista, right-click the virtual directory and choose Convert to Application.
+
+4. Run the StockTrader demo
+
+   1. Start the Order Processor, Configuration, Business Services and Active STS.
+         1. Right click the RunServices.bat file and choose Run as Administrator. (Running the AuthorizeWcfServices.bat script in the \Util directory will prevent you from having to always run the services as Administrator)
+         2. Choose either a run mode of either Debug or Release.
+         3. This will start the ConfigurationService, OrderProcessorService, BusinessService and Active STS console applications.
+            	Note
+
+            Console App should remain open and active (do not exit application!)
+   2. In a browser, run the Web app http://localhost/trade/

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/RunServices.bat
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/RunServices.bat?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/RunServices.bat (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/RunServices.bat Fri Oct  9 04:04:55 2009
@@ -41,6 +41,10 @@
 :BsHost
 IF NOT EXIST "%~dp0business_service\bin\%runMode%\Trade.BusinessServiceConsole.exe" GOTO NoBsHost
 START ".NET Business Service" "%~dp0business_service\bin\%runMode%\Trade.BusinessServiceConsole.exe"
+
+:STSHost
+IF NOT EXIST "%~dp0identity_provider\bin\%runMode%\Trade.ActiveStsConsole.exe" GOTO NoSTSHost
+START ".NET Active Security Token Service" "%~dp0identity_provider\bin\%runMode%\Trade.ActiveStsConsole.exe"
 GOTO Complete
 
 :NoCsHost
@@ -57,5 +61,9 @@
 @echo No Business Service Host available in %runMode%
 SET errorOccurred=1
 
+:NoSTSHost
+@echo No Security Token Service Host available in %runMode%
+SET errorOccurred=1
+
 :Complete
 IF %errorOccurred%==1 PAUSE

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/App.config
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/App.config?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/App.config (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/App.config Fri Oct  9 04:04:55 2009
@@ -38,7 +38,6 @@
     <add key="MinDBConnections" value="20" />
     <add key="MaxDBConnections" value="20" />
     <add key="DAL" value="Trade.DALSQLServer" />
-    <!--<add key="DAL" value="Trade.DALMySQL" />-->
     <add key="ENABLE_GLOBAL_SYSTEM_DOT_TRANSACTIONS_CONFIGSTRING" value="true" />
     <add key="SYSTEMDOTTRANSACTION_TIMEOUT" value="0" />
     <add key="MAX_QUERY_ORDERS" value="20" />
@@ -53,13 +52,13 @@
     <add key="DOTNET_OPSSEC" value="OpsClient_DotNet_WsHttpBinding_MSec" />
     <add key="PHP_OPS" value="OpsClient_PHP_BasicHttpBinding" />
     <add key="PHP_OPSSEC" value="OpsClient_PHP_WsHttpBinding_MSec" />
-    <add key="WSAS_OPS" value="OpsClient_WSAS_BasicHttpBinding" />
-    <add key="WSAS_OPSSEC" value="OpsClient_WSAS_WsHttpBinding_MSec" />
-    <add key="METRO_OPS" value="OpsClient_Metro_BasicHttpBinding" />
-    <add key="METRO_OPSSEC" value="OpsClient_Metro_WsHttpBinding_MSec" />
+    <add key="JAVA_OPS" value="OpsClient_WSAS_BasicHttpBinding" />
+    <add key="JAVA_OPSSEC" value="OpsClient_WSAS_WsHttpBinding_MSec" />
     <add key="ClientSettingsProvider.ServiceUri" value="" />
     <add key="BS_LABEL" value="DOTNET_BS"/>
 
+    <add key="FederationMetadataLocation" value="http://localhost/StonehengeSTS/FederationMetadata/2007-06/FederationMetadata.xml"/>
+
   </appSettings>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@@ -84,8 +83,7 @@
    -->
   <system.serviceModel>
     <!--Enables the WCF ServiceModel performance counters for this application.-->
-    <diagnostics performanceCounters="All">
-    </diagnostics>
+    
     <!--The <services> section configures the WCF services that the .NET Stock Order Processor 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.-->
@@ -95,8 +93,16 @@
     
     *********************************************************-->
     <services>
-      <service name="Trade.BusinessServiceImplementation.TradeServiceWcf" 
-               behaviorConfiguration="BsHost_MSec_ServiceBehavior"></service>
+      <service name="Trade.BusinessServiceImplementation.TradeServiceWcf"
+               behaviorConfiguration="BsHost_ServiceBehavior">
+        <endpoint binding="customBinding"
+                  bindingConfiguration="BsHost_FederatedBinding"
+                  contract ="Trade.BusinessServiceContract.ITradeServices"
+                  />
+        <endpoint address="Mex"
+                  binding="mexHttpBinding"
+                  contract="IMetadataExchange" />
+      </service>  
     </services>
     
     
@@ -117,65 +123,17 @@
                 contract="Trade.OrderProcessorContract.IOrderProcessor"
                 binding="basicHttpBinding" bindingConfiguration="OpsClient_BasicHttpBinding" 
                 name="OpsClient_DotNet_BasicHttpBinding" />
-      
+
       <endpoint address="http://localhost:8000/tradeorderprocessor/msec"
                 contract="Trade.OrderProcessorContract.IOrderProcessor"
-                binding="wsHttpBinding" bindingConfiguration="OpsClient_WsHttpBinding_MSec" 
-                behaviorConfiguration="OpsClient_DotNet_CertificateBehavior" 
+                binding="wsHttpBinding" bindingConfiguration="OpsClient_WsHttpBinding_MSec"
+                behaviorConfiguration="OpsClient_DotNet_CertificateBehavior"
                 name="OpsClient_DotNet_WsHttpBinding_MSec">
         <identity>
-          <certificate encodedValue="AwAAAAEAAAAUAAAA+g9Yu2BfpDNp4nno+QiIcv3gmUMgAAAAAQAAAPQBAAAwggHwMIIBWaADAgECAhDUQtaRqC0hpkD6saVDQMH8MA0GCSqGSIb3DQEBBAUAMBIxEDAOBgNVBAMTB09QUy5Db20wHhcNMDgwNTIxMDQ0NTAxWhcNMzkxMjMxMjM1OTU5WjASMRAwDgYDVQQDEwdPUFMuQ29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHCT2agc1venAAV2iWxWs1ELKlr0wAf005uUYlFbpq/3ewLmi5t+NvN8iBRHJxWA5igj/obcBmKMQ0L/+1HwKI27B9zffyPiAYkJhAwoXzR/S/7Cw4KFtYD+NIyZbRd5naa2fbyRTNnAE35q4r6JS6tiZR9mU0IjMuszj0oqotEwIDAQABo0cwRTBDBgNVHQEEPDA6gBAYaG6w3pziP/tZKe+J5ExsoRQwEjEQMA4GA1UEAxMHT1BTLkNvbYIQ1ELWkagtIaZA+rGlQ0DB/DANBgkqhkiG9w0BAQQFAAOBgQBnzFXGKgK8by3yILHlfLsmBTIZWdODFWE/f64wZJxrS7XCqd+g962FeTKQ+QI/lkRhJLlKgEt0IqGfUeogJ1MGRHabR5ujnQKhdPWUDL7kwQt3OVHxIf0pXqeiTAI8BbdFRGTWG5oOLcU7WgUNWbrXjqsAHJmsb8+MN7fD4xRoeA==" />
+          <dns value="OPS.Com"/>
         </identity>
       </endpoint>
-      <!-- PHP Endpoints -->
-      <endpoint address="http://localhost:8080/php_stocktrader/order_processor/order_processor_svc.php" 
-                contract="Trade.OrderProcessorContract.IOrderProcessor"
-                binding="basicHttpBinding" bindingConfiguration="OpsClient_BasicHttpBinding"
-                name="OpsClient_PHP_BasicHttpBinding" />
       
-      <endpoint address="http://localhost:8080/php_stocktrader/order_processor/order_processor_svc_msec.php"
-                contract="Trade.OrderProcessorContract.IOrderProcessor"
-                binding="customBinding" bindingConfiguration="OpsClient_PHP_WSAS_CustomBinding_MSec" 
-                behaviorConfiguration="OpsClient_PHP_WSAS_CertificateBehavior" 
-                name="OpsClient_PHP_WsHttpBinding_MSec">
-        <identity>
-          <certificate encodedValue="MIIB8DCCAVmgAwIBAgIQ1ELWkagtIaZA+rGlQ0DB/DANBgkqhkiG9w0BAQQFADASMRAwDgYDVQQDEwdPUFMuQ29tMB4XDTA4MDUyMTA0NDUwMVoXDTM5MTIzMTIzNTk1OVowEjEQMA4GA1UEAxMHT1BTLkNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxwk9moHNb3pwAFdolsVrNRCypa9MAH9NOblGJRW6av93sC5oubfjbzfIgURycVgOYoI/6G3AZijENC//tR8CiNuwfc338j4gGJCYQMKF80f0v+wsOChbWA/jSMmW0XeZ2mtn28kUzZwBN+auK+iUurYmUfZlNCIzLrM49KKqLRMCAwEAAaNHMEUwQwYDVR0BBDwwOoAQGGhusN6c4j/7WSnvieRMbKEUMBIxEDAOBgNVBAMTB09QUy5Db22CENRC1pGoLSGmQPqxpUNAwfwwDQYJKoZIhvcNAQEEBQADgYEAZ8xVxioCvG8t8iCx5Xy7JgUyGVnTgxVhP3+uMGSca0u1wqnfoPethXkykPkCP5ZEYSS5SoBLdCKhn1HqICdTBkR2m0ebo50CoXT1lAy+5MELdzlR8SH9KV6nokwCPAW3RURk1huaDi3FO1oFDVm6146rAByZrG/PjDe3w+MUaHg=" />
-        </identity>
-      </endpoint>
-
-      <!-- WSAS Endpoints -->
-      <endpoint address="http://localhost:9763/services/OrderProcessor"
-                contract="Trade.OrderProcessorContract.IOrderProcessor"
-                binding="basicHttpBinding" bindingConfiguration="OpsClient_BasicHttpBinding"
-                name="OpsClient_WSAS_BasicHttpBinding" />
-
-      <endpoint address="http://localhost:9763/services/OrderProcessorMsec"
-                contract="Trade.OrderProcessorContract.IOrderProcessor"
-                binding="customBinding" bindingConfiguration="OpsClient_PHP_WSAS_CustomBinding_MSec"
-                behaviorConfiguration="OpsClient_PHP_WSAS_CertificateBehavior"
-                name="OpsClient_WSAS_WsHttpBinding_MSec">
-        <identity>
-          <certificate encodedValue="MIIB8DCCAVmgAwIBAgIQ1ELWkagtIaZA+rGlQ0DB/DANBgkqhkiG9w0BAQQFADASMRAwDgYDVQQDEwdPUFMuQ29tMB4XDTA4MDUyMTA0NDUwMVoXDTM5MTIzMTIzNTk1OVowEjEQMA4GA1UEAxMHT1BTLkNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxwk9moHNb3pwAFdolsVrNRCypa9MAH9NOblGJRW6av93sC5oubfjbzfIgURycVgOYoI/6G3AZijENC//tR8CiNuwfc338j4gGJCYQMKF80f0v+wsOChbWA/jSMmW0XeZ2mtn28kUzZwBN+auK+iUurYmUfZlNCIzLrM49KKqLRMCAwEAAaNHMEUwQwYDVR0BBDwwOoAQGGhusN6c4j/7WSnvieRMbKEUMBIxEDAOBgNVBAMTB09QUy5Db22CENRC1pGoLSGmQPqxpUNAwfwwDQYJKoZIhvcNAQEEBQADgYEAZ8xVxioCvG8t8iCx5Xy7JgUyGVnTgxVhP3+uMGSca0u1wqnfoPethXkykPkCP5ZEYSS5SoBLdCKhn1HqICdTBkR2m0ebo50CoXT1lAy+5MELdzlR8SH9KV6nokwCPAW3RURk1huaDi3FO1oFDVm6146rAByZrG/PjDe3w+MUaHg=" />
-        </identity>
-
-      </endpoint>
-
-      <!-- METRO Endpoints -->
-      <endpoint address="http://localhost:8090/order_processor/OrderProcessor"
-                contract="Trade.OrderProcessorContract.IOrderProcessor"
-                binding="basicHttpBinding" bindingConfiguration="OpsClient_BasicHttpBinding"
-                name="OpsClient_Metro_BasicHttpBinding" />
-
-      <endpoint address="http://localhost:8090/order_processor/OrderProcessorSec"
-                contract="Trade.OrderProcessorContract.IOrderProcessor"
-                binding="customBinding" bindingConfiguration="OpsClient_Sun_CustomBinding_MSec"
-                behaviorConfiguration="OpsClient_Sun_CertificateBehavior"
-                name="OpsClient_Metro_WsHttpBinding_MSec">
-        <identity>
-          <certificate encodedValue="MIIB8DCCAVmgAwIBAgIQ1ELWkagtIaZA+rGlQ0DB/DANBgkqhkiG9w0BAQQFADASMRAwDgYDVQQDEwdPUFMuQ29tMB4XDTA4MDUyMTA0NDUwMVoXDTM5MTIzMTIzNTk1OVowEjEQMA4GA1UEAxMHT1BTLkNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxwk9moHNb3pwAFdolsVrNRCypa9MAH9NOblGJRW6av93sC5oubfjbzfIgURycVgOYoI/6G3AZijENC//tR8CiNuwfc338j4gGJCYQMKF80f0v+wsOChbWA/jSMmW0XeZ2mtn28kUzZwBN+auK+iUurYmUfZlNCIzLrM49KKqLRMCAwEAAaNHMEUwQwYDVR0BBDwwOoAQGGhusN6c4j/7WSnvieRMbKEUMBIxEDAOBgNVBAMTB09QUy5Db22CENRC1pGoLSGmQPqxpUNAwfwwDQYJKoZIhvcNAQEEBQADgYEAZ8xVxioCvG8t8iCx5Xy7JgUyGVnTgxVhP3+uMGSca0u1wqnfoPethXkykPkCP5ZEYSS5SoBLdCKhn1HqICdTBkR2m0ebo50CoXT1lAy+5MELdzlR8SH9KV6nokwCPAW3RURk1huaDi3FO1oFDVm6146rAByZrG/PjDe3w+MUaHg=" />
-        </identity>
-      </endpoint>      
-
     </client>
 
     
@@ -185,18 +143,22 @@
     
     *********************************************************-->
     <bindings>
+
+      <customBinding>
+        <binding name="BsHost_FederatedBinding">
+          <security authenticationMode="IssuedTokenForCertificate"
+                    messageSecurityVersion="WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10">
+            <issuedTokenParameters tokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1">
+              <issuer address="http://localhost:9001/tradeactivests"/>
+              <issuerMetadata address="http://localhost:9001/tradeactivests/mex"/>
+            </issuedTokenParameters>
+          </security>
+          <httpTransport/>
+        </binding>
+      </customBinding>
       
       <!--BEGIN basicHttpBindings-->
       <basicHttpBinding>
-        
-        <binding name="BsHost_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="OpsClient_BasicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard" maxBufferSize="524288" maxBufferPoolSize="524288" maxReceivedMessageSize="524288" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
           <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
           <security mode="None">
@@ -209,98 +171,13 @@
       
       <!--BEGIN wsHttpBindings-->
       <wsHttpBinding>
-      
-        <!--PRIMARY SERVICE HOST BINDINGS.  TO ADD OTHERS, MAKE SURE TO PREFACE NAME WITH 'Host_'
-        <binding name="BsHost_WsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="true" transactionFlow="false">
-          <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
-          <reliableSession enabled="false" ordered="true" inactivityTimeout="00:10:00" />
-          <security mode="None">
-            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
-            <message clientCredentialType="Certificate" negotiateServiceCredential="true" algorithmSuite="Default" />
-          </security>
-        </binding>
-        -->
-        <binding name="BsHost_WsHttpBinding_MSec" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="true" transactionFlow="false">
-          <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
-          <reliableSession enabled="false" ordered="true" inactivityTimeout="00:10:00" />
-          <security mode="Message">
-            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
-            <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" />
-          </security>
-        </binding>
-        
-        <!--PRIMARY SERVICE CLIENT BINDINGS.  TO ADD OTHERS, MAKE SURE TO PREFACE NAME WITH 'Client_'
-        <binding name="OpsClient_WsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="true" transactionFlow="false">
-          <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
-          <reliableSession enabled="false" ordered="true" inactivityTimeout="00:10:00" />
-          <security mode="None">
-            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
-            <message clientCredentialType="Certificate" negotiateServiceCredential="true" algorithmSuite="Default" />
-          </security>
-        </binding>
-        -->
-        <binding name="OpsClient_WsHttpBinding_MSec" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
-          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
-          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
+        <binding name="OpsClient_WsHttpBinding_MSec">
           <security mode="Message">
-            <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
-            <message clientCredentialType="Certificate" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
+            <message clientCredentialType="Certificate" negotiateServiceCredential="false" algorithmSuite="Default" establishSecurityContext="false" />
           </security>
         </binding>
       </wsHttpBinding>
       
-      <!--BEGIN CustomBindings-->
-      <customBinding>
-        
-        <binding name="OpsClient_PHP_WSAS_CustomBinding_MSec">
-          <security defaultAlgorithmSuite="Basic256" authenticationMode="AnonymousForCertificate" requireDerivedKeys="false" securityHeaderLayout="Lax" includeTimestamp="true" keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt" messageSecurityVersion="Default" requireSignatureConfirmation="true">
-            <localClientSettings cacheCookies="true" detectReplays="true" replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="05:05:00" replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00" sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true" timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
-            <localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00" maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00" negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00" sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true" maxPendingSessions="128" maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
-            <secureConversationBootstrap />
-          </security>
-          <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap12" writeEncoding="utf-8">
-            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
-          </textMessageEncoding>
-          <httpTransport />
-        </binding>
-        
-        <binding name="OpsClient_Sun_CustomBinding_MSec">
-          <security defaultAlgorithmSuite="Default" authenticationMode="AnonymousForCertificate"
-								requireDerivedKeys="false" securityHeaderLayout="Lax" includeTimestamp="true"
-								keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt"
-								messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
-								requireSignatureConfirmation="true">
-
-            <localClientSettings cacheCookies="true" detectReplays="true"
-							replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
-							replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
-							sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"
-							timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
-            <localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00"
-							maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
-							negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
-							sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
-							reconnectTransportOnFailure="true" maxPendingSessions="128"
-							maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
-            <secureConversationBootstrap />
-          </security>
-          <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
-						messageVersion="Default" writeEncoding="utf-8">
-            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
-							maxBytesPerRead="4096" maxNameTableCharCount="16384" />
-          </textMessageEncoding>
-
-          <httpTransport manualAddressing="false" maxBufferPoolSize="524288"
-						maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
-						bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
-						keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
-						realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
-						useDefaultWebProxy="true" />
-        </binding>
-        
-      </customBinding>
-      
-      
     </bindings>
 
 
@@ -312,88 +189,35 @@
     <behaviors>
       <serviceBehaviors>
         
-        <!-- Begin the BS Service Behaviors -->
-        <!--
-        <behavior name="BsHost_DefaultBehavior">
-          <serviceThrottling maxConcurrentInstances="400" maxConcurrentCalls="400" maxConcurrentSessions="100" />
-        </behavior>
-        
-        <behavior name="BsHost_DebugServiceBehaviors">
-          <serviceMetadata httpGetEnabled="true" />
-          <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
-          <serviceThrottling maxConcurrentInstances="400" maxConcurrentCalls="400" maxConcurrentSessions="100" />
-        </behavior>
-        -->
-        
         <!-- Default BS Host Behavior -->
-        <behavior name="BsHost_MSec_ServiceBehavior">
+        <behavior name="BsHost_ServiceBehavior">
+          <serviceMetadata httpGetEnabled="true"/>
           <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
           <serviceThrottling maxConcurrentInstances="400" maxConcurrentCalls="400" maxConcurrentSessions="100" />
+          
           <serviceCredentials>
-            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Trade.BusinessServiceImplementation.TradeBSLCustomUserNameValidator, Trade.BusinessServiceImplementation" />
-            <serviceCertificate findValue="Trade.Com" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople" />
+            <serviceCertificate findValue="CN=BSL.Com" x509FindType="FindBySubjectDistinguishedName" storeLocation="LocalMachine" storeName="TrustedPeople" />
           </serviceCredentials>
         </behavior>
       </serviceBehaviors>
 
       <!-- Begin the OPS Client Service Behaviors -->
       <endpointBehaviors>
-        <!--
-        <behavior name="ClientCertificateBehavior">
-          <clientCredentials>
-            <serviceCertificate>
-              <authentication certificateValidationMode="PeerOrChainTrust" />
-            </serviceCertificate>
-          </clientCredentials>
-        </behavior>
-        
-        <behavior name="BSL_ClientCertificateBehavior">
-          <clientCredentials>
-            <serviceCertificate>
-              <authentication certificateValidationMode="PeerOrChainTrust" />
-            </serviceCertificate>
-          </clientCredentials>
-        </behavior>
-        -->
-        
         <behavior name="OpsClient_DotNet_CertificateBehavior">
           <clientCredentials>
             <clientCertificate findValue="BSL.Com" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople" />
-          </clientCredentials>
-        </behavior>
-
-        <!-- This needs to be changed to work with PHP/WSAS Bob/Alice Certs -->
-        <behavior name="OpsClient_PHP_WSAS_CertificateBehavior">
-          <clientCredentials>
-            <serviceCertificate>
-              <authentication certificateValidationMode="PeerOrChainTrust" />
-            </serviceCertificate>
-          </clientCredentials>
-        </behavior>
-        
-        <behavior name="OpsClient_Sun_CertificateBehavior">
-          <clientCredentials>
             <serviceCertificate>
-              <authentication certificateValidationMode="PeerOrChainTrust" />
+              <defaultCertificate findValue="OPS.Com" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople" />
+              <authentication certificateValidationMode="None" revocationMode="NoCheck"/>
             </serviceCertificate>
           </clientCredentials>
+          
         </behavior>
-        
       </endpointBehaviors>
-    
     </behaviors>
+    
   </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>
\ No newline at end of file
+  
+
+</configuration>

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/BusinessServiceConsole.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/BusinessServiceConsole.csproj?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/BusinessServiceConsole.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/BusinessServiceConsole.csproj Fri Oct  9 04:04:55 2009
@@ -60,6 +60,7 @@
     <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">

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/Program.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/Program.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/Program.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceConsole/Program.cs Fri Oct  9 04:04:55 2009
@@ -59,6 +59,8 @@
 using Trade.DALFactory;
 using Trade.ConfigClient;
 using Trade.ConfigServiceDataContract;
+using Microsoft.IdentityModel.Configuration;
+using Microsoft.IdentityModel.Tokens;
 
 
 namespace Trade.BusinessServiceConsole
@@ -82,11 +84,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(IOrderProcessor) });
-
+                
                 // Initialize the Settings and Service
                 var thisSettings = new Trade.BusinessServiceConfigurationSettings.Settings();
                 var thisOPSSettings = new Trade.OrderProcessorServiceConfigurationSettings.Settings();
@@ -97,30 +95,17 @@
                 //Create a ServiceHost for the Orderprocessor service.
                 Type serviceType = typeof(TradeServiceWcf);
                 serviceHost = new ServiceHost(serviceType, TradeServiceUriBase);
-                addEndpointsAndBehaviors(serviceHost, TradeServiceUriBase);
-                serviceHost.Open();
 
-            }
+                // Configure the service host to use the Geneva Framework
+                ServiceConfiguration configuration = new ServiceConfiguration();
+                configuration.IssuerNameRegistry = new SimpleIssuerNameRegistry();
 
+                FederatedServiceCredentials.ConfigureServiceHost(serviceHost, configuration);
 
-            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("BsHost_BasicHttpBinding");
-                WSHttpBinding wsHttpBinding = new WSHttpBinding("BsHost_WsHttpBinding_MSec");
-                host.AddServiceEndpoint(typeof(ITradeServices), httpBinding, "");
-                host.AddServiceEndpoint(typeof(ITradeServices), wsHttpBinding, "msec");
-
-                //iterate and display all endpoints via host.Description.Endpoints
-                //Describe for Console output
-                StockTraderUtility.DescribeService(host);
+                StockTraderUtility.DescribeService(serviceHost);
+
+                serviceHost.Open();
 
-                return host;
             }
 
             public void Dispose()

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/BusinessServiceImplementation.csproj
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/BusinessServiceImplementation.csproj?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/BusinessServiceImplementation.csproj (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/BusinessServiceImplementation.csproj Fri Oct  9 04:04:55 2009
@@ -44,6 +44,7 @@
     <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">

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeService.cs Fri Oct  9 04:04:55 2009
@@ -52,6 +52,9 @@
 using Trade.ConfigClient;
 using Trade.ConfigServiceDataContract;
 using Trade.ConfigServiceContract;
+using Microsoft.IdentityModel.Claims;
+using System.Threading;
+using System.Linq;
 
 
 namespace Trade.BusinessServiceImplementation
@@ -201,7 +204,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); ;
@@ -231,6 +234,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 var configClient = new ConfigServiceClient();
                 var bsRequest = new BSConfigRequest();
                 bsRequest.BSName = Settings.BS_LABEL;
@@ -240,7 +248,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); ;
@@ -267,6 +275,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 var configClient = new ConfigServiceClient();
                 var bsRequest = new BSConfigRequest();
                 bsRequest.BSName = Settings.BS_LABEL;
@@ -276,7 +289,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); ;
@@ -296,6 +309,54 @@
         }
 
         /// <summary>
+        /// This will return the StockTrader profile ID associated with the user information
+        /// provided from the passive STS
+        /// </summary>
+        /// <param name="uniqueId">Unique identifier used by the STS</param>
+        /// <param name="issuingSts">Name of the issuing STS</param>
+        /// <returns>StockTrader profile ID</returns>
+        public String getProfileIdFromStsIdentifier(string uniqueId, string issuingSts)
+        {
+            StockTraderUtility.Logger.WriteDebugMessage("Logging in for " + uniqueId);
+
+            try
+            {
+                // Get Config
+                var configClient = new ConfigServiceClient();
+                var bsRequest = new BSConfigRequest();
+                bsRequest.BSName = Settings.BS_LABEL;
+                var bsConfig = configClient.GetBSConfig(bsRequest);
+
+                if (bsConfig == null)
+                    throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
+
+                //Create instance of a DAL, which could be designed for any type of DB backend.
+                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+
+                //Note Open() is not really necessary, since the DAL will open a new connection automatically 
+                //if it's internal connection is not already open.  It's also free to open up more connections, if desired.
+                //We use Open() to stick with a consistent pattern in this application, since the Close() method IS
+                //important.  Look for this pattern in all BSL methods below; with a transaction scope defined
+                //only for operations that actually require a transaction per line (c) above.
+                var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
+                dalCustomer.Open(connectionString);
+                return dalCustomer.getProfileIdFromStsIdentifier(uniqueId, issuingSts);
+            }
+            catch (Exception ex)
+            {
+                StockTraderUtility.Logger.WriteErrorMessage("TradeService.login Error: " + ex.ToString());
+                throw;
+            }
+            finally
+            {
+                StockTraderUtility.Logger.WriteDebugMessage("Leaving login for " + uniqueId);
+
+                //Always close the DAL, this releases its primary DB connection.
+                dalCustomer.Close();
+            }
+        }
+
+        /// <summary>
         /// Gets recent orders for a user.  Transforms data from DataContract to model UI class for HTML display.
         /// </summary>
         /// <param name="userID">User id to retrieve data for.</param>
@@ -303,6 +364,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 var configClient = new ConfigServiceClient();
                 var bsRequest = new BSConfigRequest();
                 bsRequest.BSName = Settings.BS_LABEL;
@@ -312,7 +378,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); ;
@@ -337,6 +403,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 var configClient = new ConfigServiceClient();
                 var bsRequest = new BSConfigRequest();
                 bsRequest.BSName = Settings.BS_LABEL;
@@ -346,7 +417,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); 
@@ -371,6 +442,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 var configClient = new ConfigServiceClient();
                 var bsRequest = new BSConfigRequest();
                 bsRequest.BSName = Settings.BS_LABEL;
@@ -380,7 +456,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); ;
@@ -406,6 +482,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 var configClient = new ConfigServiceClient();
                 var bsRequest = new BSConfigRequest();
                 bsRequest.BSName = Settings.BS_LABEL;
@@ -415,7 +496,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); ;
@@ -441,6 +522,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 var configClient = new ConfigServiceClient();
                 var bsRequest = new BSConfigRequest();
                 bsRequest.BSName = Settings.BS_LABEL;
@@ -450,7 +536,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); ;
@@ -491,7 +577,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
 
@@ -626,7 +712,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalCustomer = Trade.DALFactory.Customer.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalCustomer = Trade.DALFactory.Customer.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalCustomer.Open(connectionString); 
@@ -662,7 +748,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalMarketSummary = Trade.DALFactory.MarketSummary.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalMarketSummary = Trade.DALFactory.MarketSummary.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalMarketSummary.Open(connectionString); ;
@@ -698,7 +784,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalMarketSummary = Trade.DALFactory.MarketSummary.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalMarketSummary = Trade.DALFactory.MarketSummary.Create("Trade.DALSQLServer");
 
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
                 dalMarketSummary.Open(connectionString); ;
@@ -725,6 +811,11 @@
         /// <param name="orderProcessingMode">Not used, set to zero.</param>
         public OrderDataModel sell(string userID, int holdingID, int orderProcessingMode)
         {
+            if (userID == null)
+            {
+                userID = GetUserIdClaim();
+            }
+
             //note, this method always sells entire holding, quantity is not passed in.  This is default behavior of WebSphere Trade 6.1
             return placeOrder(StockTraderUtility.ORDER_TYPE_SELL, userID, holdingID, null, (double)0);
         }
@@ -741,6 +832,11 @@
         /// <param name="quantity">Number of shares to sell.</param>
         public OrderDataModel sellEnhanced(string userID, int holdingID, double quantity)
         {
+            if (userID == null)
+            {
+                userID = GetUserIdClaim();
+            }
+
             return placeOrder(StockTraderUtility.ORDER_TYPE_SELL_ENHANCED, userID, holdingID, null, quantity);
         }
 
@@ -755,6 +851,11 @@
         ///<param name="orderProcessingMode">Not used.</param>
         public OrderDataModel buy(string userID, string symbol, double quantity, int orderProcessingMode)
         {
+            if (userID == null)
+            {
+                userID = GetUserIdClaim();
+            }
+
             return placeOrder(StockTraderUtility.ORDER_TYPE_BUY, userID, 0, symbol, quantity);
         }
         
@@ -775,6 +876,11 @@
         {
             try
             {
+                if (userID == null)
+                {
+                    userID = GetUserIdClaim();
+                }
+
                 OrderDataModel order = null;
                 HoldingDataModel holding = new HoldingDataModel();
 
@@ -787,7 +893,7 @@
                     throw new Exception(string.Format(StockTraderUtility.EXCEPTION_MESSAGE_BAD_CONFIG, bsRequest.BSName));
 
                 //Create instance of a DAL, which could be designed for any type of DB backend.
-                dalOrder = Trade.DALFactory.Order.Create(SQLHelper.GetAssemblyNameFromDBName(bsConfig.DBName));
+                dalOrder = Trade.DALFactory.Order.Create("Trade.DALSQLServer");
                 var connectionString = SQLHelper.GenerateSqlServerConnectionString(bsConfig.DBHostName, bsConfig.DBPort);
 
 
@@ -1065,5 +1171,25 @@
                     }
             return holdingid;
         }
+
+        private string GetUserIdClaim()
+        {
+            IClaimsPrincipal claimsPrincipal = Thread.CurrentPrincipal as IClaimsPrincipal;
+            if (claimsPrincipal != null)
+            {
+                IClaimsIdentity identity = (IClaimsIdentity)claimsPrincipal.Identity;
+
+                Claim claim = identity.Claims
+                    .Where(c => c.ClaimType == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier")
+                    .FirstOrDefault();
+
+                if (claim != null)
+                {
+                    return claim.Value;
+                }
+            }
+
+            throw new Exception("The profile id claim was not provided by the Active STS");
+        }
     }
 }
\ No newline at end of file

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeServiceFacadeWcf.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeServiceFacadeWcf.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeServiceFacadeWcf.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/business_service/BusinessServiceImplementation/TradeServiceFacadeWcf.cs Fri Oct  9 04:04:55 2009
@@ -56,6 +56,15 @@
             return;
         }
 
+        public String getProfileIdFromStsIdentifier(string uniqueIdentifier, string issuingSts)
+        {
+            loginCount++;
+            if (Settings.DISPLAY_WEBSERVICE_LOGINS && (loginCount % Settings.LOGIN_ITERATIONSTO_DISPLAY == 0))
+                StockTraderUtility.Logger.WriteDebugMessage("Login request # " + loginCount.ToString() + " received. Login is for user id: " + uniqueIdentifier + "\n");
+            TradeService service = new TradeService();
+            return service.getProfileIdFromStsIdentifier(uniqueIdentifier, issuingSts);
+        }
+
         public AccountDataModel login(string userid, string password)
         {
             loginCount++;

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/business_service/OrderProcessorASyncClient/OrderProcessorAsyncClient.cs
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/business_service/OrderProcessorASyncClient/OrderProcessorAsyncClient.cs?rev=823397&r1=823396&r2=823397&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/business_service/OrderProcessorASyncClient/OrderProcessorAsyncClient.cs (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/business_service/OrderProcessorASyncClient/OrderProcessorAsyncClient.cs Fri Oct  9 04:04:55 2009
@@ -62,7 +62,7 @@
     /// </summary>
     public class TradeOrderServiceAsyncClient : IOrderProcessor
     {
-        public Client.Client opsclient;
+        public Client.Client<IOrderProcessor> opsclient;
 
         /// <summary>
         /// This will initialize the correct client/endpoint based on the OrderMode setting the user has set
@@ -73,7 +73,7 @@
         {
             try
             {
-                opsclient = new Client.Client(typeof(IOrderProcessor), ConfigurationManager.AppSettings.Get(clientConfig), url);
+                opsclient = new Client.Client<IOrderProcessor>(ConfigurationManager.AppSettings.Get(clientConfig), url);
             }
             catch
             {
@@ -88,11 +88,11 @@
         {
             get
             {
-                return (IOrderProcessor)opsclient.Channel;
+                return opsclient.Channel;
             }
             set
             {
-                opsclient.Channel = (IChannel)value;
+                opsclient.Channel = value;
             }
         }
 
@@ -157,7 +157,7 @@
         /// </summary>
         public static void Initialize()
         {
-            Client.Client.ClearCache();
+            Client.Client<IOrderProcessor>.ClearCache();
         }
     }
 }
\ No newline at end of file