Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/24/10 15:31:35 (14 years ago)
Author:
cneumuel
Message:
  • made ServerConsole work with wsHttpBinding
  • applied role-base restrictions to all WCF-Services
  • made wcf-services work with certificates
  • renamed ExecutionEngineFacade to ClientFacade

(#1168)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Console/3.3/ServiceLocator.cs

    r4296 r4302  
    44using System.Text;
    55
     6using System.ServiceModel;
    67using HeuristicLab.Hive.Contracts.Interfaces;
    7 using System.ServiceModel;
    88using HeuristicLab.Hive.Contracts;
     9using System.ServiceModel.Description;
    910
    1011namespace HeuristicLab.Hive.Server.ServerConsole {
     12
    1113  internal class ServiceLocator {
    1214    private static IServerConsoleFacade serverConsoleFacade = null;
     
    1517    internal static string Port { get; set; }
    1618    internal static string Username { get; set; }
    17     // [chn] TODO: Don't store plaintext password in memory!
    18     internal static string Password { get; set; }
     19    internal static string Password { get; set; } // [chn] TODO: Don't store plaintext password in memory!
    1920
    2021    internal static ISlaveManager GetSlaveManager() {
     
    2829    internal static IServerConsoleFacade GetServerConsoleFacade() {
    2930      if (serverConsoleFacade == null && Address != String.Empty && Port != String.Empty) {
    30         //ChannelFactory<IServerConsoleFacade> factory =
    31         //  new ChannelFactory<IServerConsoleFacade>(
    32         //    WcfSettings.GetBinding(),
    33         //    new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/ServerConsoleFacade"));
    34 
    35         ChannelFactory<IServerConsoleFacade> factory =
    36           new ChannelFactory<IServerConsoleFacade>(
    37             WcfSettings.GetBinding(),
    38             new EndpointAddress("http://" + Address + ":" + Port + "/HiveServerConsole"));
     31        ChannelFactory<IServerConsoleFacade> factory = new ChannelFactory<IServerConsoleFacade>("ServerConsoleHttpEndpoint");
     32        WcfSettings.SetEndpointAddress(factory.Endpoint, string.Format("http://{0}:{1}/{2}", Address, Port, WcfSettings.ServerConsoleServiceName));
    3933
    4034        factory.Credentials.UserName.UserName = Username;
    4135        factory.Credentials.UserName.Password = Password;
    42         serverConsoleFacade = factory.CreateChannel();
    43         ((ICommunicationObject)serverConsoleFacade).Faulted += ServiceLocator_Faulted;
     36
     37        IServerConsoleFacade client = factory.CreateChannel();
     38
     39        ((ICommunicationObject)client).Faulted += ServiceLocator_Faulted;
     40        serverConsoleFacade = client;
    4441      }
    4542      return serverConsoleFacade;
     
    5552      serverConsoleFacade = null;
    5653    }
    57 
    5854  }
    5955}
Note: See TracChangeset for help on using the changeset viewer.