Example #1
0
        protected override void OnStart(string[] args)
        {
            _appLog = ApplicationLog.OpenLogSession(ApplicationLogConfiguration.GetDefault());

            var providerConfiguration = ConfigManager.GetDefaultConfiguration();

            if (_vasaHost == null)
            {
                _vasaHost =
                    new VasaServiceHost(typeof(VasaService));
                var customHttpsBinding = new CustomBinding(
                    new TextMessageEncodingBindingElement {
                    MessageVersion = MessageVersion.Soap12
                },
                    new HttpsTransportBindingElement());
                _vasaHost.AddServiceEndpoint(typeof(vasaServicePortType), customHttpsBinding, providerConfiguration.VasaUri);
            }

            if (_versioningHost == null)
            {
                _versioningHost =
                    new WebServiceHost(typeof(VasaVersioningService), providerConfiguration.VasaVersionUri);
            }

            if (_taskManager == null)
            {
                _taskManager = TaskManager.Instance;
            }

            _vasaHost.Open();
            _appLog.WriteMessage(ApplicationLogMessageType.Information, Resources.ProviderRun);

            _versioningHost.Open();
            _appLog.WriteMessage(ApplicationLogMessageType.Information, Resources.VersioningRun);

            _taskManager.Open();
        }