Exemplo n.º 1
0
        public ITridionCoreServiceClient CoreService()
        {
            ITridionCoreServiceClient client = null;

            try
            {
                client = new C();
                client.Open(_endPoint, _credentials);
            }
            catch (EndpointNotFoundException e)
            {
                throw;
            }
            catch (Exception e)
            {
                throw;
            }

            return(client);
        }
Exemplo n.º 2
0
        public void Open()
        {
            string endPoint = _settings.Server;

            try
            {
                if (_settings.Type == ConnectionType.NetTcp)
                {
                    _client = new TridionSessionAwareCoreServiceClient();
                }
                else
                {
                    endPoint = (_settings.Type == ConnectionType.BasicHttps) ? $"https://{_settings.Server}" : $"http://{_settings.Server}";

                    _client = new TridionCoreServiceClient();
                }

                System.Net.NetworkCredential credential = null;

                if (!string.IsNullOrEmpty(_settings.Username))
                {
                    credential =
                        new System.Net.NetworkCredential(_settings.Username, _settings.Password);
                }

                _client.Open(endPoint, credential);
            }
            catch (EndpointNotFoundException e)
            {
                Log.Error("CreateCoreService", e);
                throw;
            }
            catch (Exception e)
            {
                Log.Error("CreateCoreService", e);
                throw;
            }
        }
Exemplo n.º 3
0
 public void Abort()
 {
     _client?.Abort();
     _client = null;
 }
Exemplo n.º 4
0
 public void Close()
 {
     _client?.Close();
     _client = null;
 }