Example #1
0
        /// <summary>
        /// Connect to a SAS Workspace
        /// </summary>
        public void Connect()
        {
            if (_workspace != null)
            {
                try
                {
                    Close();
                }
                catch { }
                finally
                {
                    _workspace = null;
                }
            }


            // Connect to SAS server
            SASObjectManager.IObjectFactory2 obObjectFactory = new SASObjectManager.ObjectFactoryMulti2();
            SASObjectManager.ServerDef       obServer        = new SASObjectManager.ServerDef();
            obServer.MachineDNSName  = Host;
            obServer.Protocol        = SASObjectManager.Protocols.ProtocolBridge;
            obServer.Port            = Convert.ToInt32(Port);
            obServer.ClassIdentifier = "440196d4-90f0-11d0-9f41-00a024bb830c";

            obServer.BridgeSecurityPackage     = "Negotiate";
            obServer.BridgeSecurityPackageList = "Kerberos";

            _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(Name, true, obServer, null, null);

            objectKeeper.AddObject(1, Name, _workspace);
        }
Example #2
0
        /// <summary>
        /// Connect to a SAS Workspace
        /// </summary>
        public void Connect()
        {
            if (_workspace != null)
            {
                try
                {
                    Close();
                }
                catch { }
                finally
                {
                    _workspace = null;
                }
            }

            //if (!UseLocal)
            //{
            //    // Connect using the IOM Bridge (TCP) for remote server
            //    SASObjectManager.IObjectFactory2 obObjectFactory =
            //        new SASObjectManager.ObjectFactoryMulti2();
            //    SASObjectManager.ServerDef obServer =
            //        new SASObjectManager.ServerDef();
            //    obServer.MachineDNSName = Host;
            //    obServer.Protocol = SASObjectManager.Protocols.ProtocolBridge;
            //    obServer.Port = Convert.ToInt32(Port);
            //    obServer.ClassIdentifier = "440196d4-90f0-11d0-9f41-00a024bb830c";

            //    // handle the case where there is no UserID or PW, and try IWA
            //    // Doc on integrated Windows auth in SAS: http://bit.ly/14jAF7X
            //    if (string.IsNullOrEmpty(UserId))
            //    {
            //        obServer.BridgeSecurityPackage = "Negotiate";
            //    }

            //    _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(
            //        Name, true,
            //        obServer,
            //        // if trying IWA, pass null in
            //        // otherwise try supplied credentials
            //        string.IsNullOrEmpty(UserId) ? null : UserId,
            //        string.IsNullOrEmpty(Password) ? null : Password);

            //    objectKeeper.AddObject(1, Name, _workspace);

            //}
            //else
            //{
            // Connect using COM protocol, locally installed SAS only
            SASObjectManager.IObjectFactory2 obObjectFactory = new SASObjectManager.ObjectFactoryMulti2();
            SASObjectManager.ServerDef       obServer        = new SASObjectManager.ServerDef();
            obServer.MachineDNSName = "localhost";
            obServer.Protocol       = SASObjectManager.Protocols.ProtocolCom;
            obServer.Port           = 0;
            _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(Name, true, obServer, null, null);

            objectKeeper.AddObject(1, Name, _workspace);
            //}
        }
Example #3
0
        /// <summary>
        /// Connect to a SAS Workspace
        /// </summary>
        public void Connect()
        {
            if (_workspace != null)
            {
                try
                {
                    Disconn();
                }
                catch { }
                finally
                {
                    _workspace = null;
                }
            }

            if (!islocal)
            {
                // Connect using the IOM Bridge (TCP) for remote server
                SASObjectManager.IObjectFactory2 obObjectFactory =
                    new SASObjectManager.ObjectFactoryMulti2();
                SASObjectManager.ServerDef obServer =
                    new SASObjectManager.ServerDef();
                obServer.MachineDNSName  = Host;
                obServer.Protocol        = SASObjectManager.Protocols.ProtocolBridge;
                obServer.Port            = Convert.ToInt32(Port);
                obServer.ClassIdentifier = "440196d4-90f0-11d0-9f41-00a024bb830c";

                if (string.IsNullOrEmpty(UserId))
                {
                    obServer.BridgeSecurityPackage = "Negotiate";
                }

                _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(
                    Name, true,
                    obServer,
                    // if trying IWA, pass null in
                    // otherwise try supplied credentials
                    string.IsNullOrEmpty(UserId) ? null : UserId,
                    string.IsNullOrEmpty(Password) ? null : Password);

                objectKeeper.AddObject(1, Name, _workspace);
            }
            else
            {
                // Connect using COM protocol, locally installed SAS only
                SASObjectManager.IObjectFactory2 obObjectFactory = new SASObjectManager.ObjectFactoryMulti2();
                SASObjectManager.ServerDef       obServer        = new SASObjectManager.ServerDef();
                obServer.MachineDNSName = "localhost";
                obServer.Protocol       = SASObjectManager.Protocols.ProtocolCom;
                obServer.Port           = 0;
                _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(Name, true, obServer, null, null);

                objectKeeper.AddObject(1, Name, _workspace);
            }
        }
Example #4
0
        /// <summary>
        /// Connect to a SAS Workspace
        /// </summary>
        public void Connect()
        {
            if (_workspace != null)
            {
                try
                {
                    Close();
                }
                catch { }
                finally
                {
                    _workspace = null;
                }
            }

            // Connect using the IOM Bridge (TCP) for remote server
            SASObjectManager.IObjectFactory2 obObjectFactory =
                new SASObjectManager.ObjectFactoryMulti2();
            SASObjectManager.ServerDef obServer =
                new SASObjectManager.ServerDef();
            obServer.MachineDNSName  = Host;
            obServer.Protocol        = SASObjectManager.Protocols.ProtocolBridge;
            obServer.Port            = Convert.ToInt32(Port);
            obServer.ClassIdentifier = "440196d4-90f0-11d0-9f41-00a024bb830c";

            // handle the case where there is no UserID or PW, and try IWA
            // Doc on integrated Windows auth in SAS: http://support.sas.com/documentation/cdl/en/bisecag/63082/HTML/default/viewer.htm#n0go7pclcqr6q2n1bxfuk46hmtdy.htm
            if (string.IsNullOrEmpty(UserId))
            {
                obServer.BridgeSecurityPackage = "Negotiate";
            }

            _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(
                Name, true,
                obServer,
                // if trying IWA, pass null in
                // otherwise try supplied credentials
                string.IsNullOrEmpty(UserId) ? null : UserId,
                string.IsNullOrEmpty(Password) ? null : Password);

            objectKeeper.AddObject(1, Name, _workspace);

            // // Connect using COM protocol, locally installed SAS only
            // SASObjectManager.IObjectFactory2 obObjectFactory = new SASObjectManager.ObjectFactoryMulti2();
            // SASObjectManager.ServerDef obServer = new SASObjectManager.ServerDef();
            // obServer.MachineDNSName = "localhost";
            // obServer.Protocol = SASObjectManager.Protocols.ProtocolCom;
            // obServer.Port = 0;
            // _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(Name, true, obServer, null, null);

            // objectKeeper.AddObject(1, Name, _workspace);
        }
Example #5
0
        /// <summary>
        /// Connect to a SAS Workspace
        /// </summary>
        public void Connect()
        {
            if (_workspace != null)
                try
                {
                    Close();
                }
                catch { }
                finally
                {
                    _workspace = null;
                }

            if (!UseLocal)
            {
                // Connect using the IOM Bridge (TCP) for remote server
                SASObjectManager.IObjectFactory2 obObjectFactory =
                    new SASObjectManager.ObjectFactoryMulti2();
                SASObjectManager.ServerDef obServer =
                    new SASObjectManager.ServerDef();
                obServer.MachineDNSName = Host;
                obServer.Protocol = SASObjectManager.Protocols.ProtocolBridge;
                obServer.Port = Convert.ToInt32(Port);
                obServer.ClassIdentifier = "440196d4-90f0-11d0-9f41-00a024bb830c";

                // handle the case where there is no UserID or PW, and try IWA
                // Doc on integrated Windows auth in SAS: http://bit.ly/14jAF7X
                if (string.IsNullOrEmpty(UserId))
                {
                    obServer.BridgeSecurityPackage = "Negotiate";
                }

                _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(
                    Name, true,
                    obServer,
                    // if trying IWA, pass null in
                    // otherwise try supplied credentials
                    string.IsNullOrEmpty(UserId) ? null : UserId,
                    string.IsNullOrEmpty(Password) ? null : Password);

                objectKeeper.AddObject(1, Name, _workspace);

            }
            else
            {
                // Connect using COM protocol, locally installed SAS only
                SASObjectManager.IObjectFactory2 obObjectFactory = new SASObjectManager.ObjectFactoryMulti2();
                SASObjectManager.ServerDef obServer = new SASObjectManager.ServerDef();
                obServer.MachineDNSName = "localhost";
                obServer.Protocol = SASObjectManager.Protocols.ProtocolCom;
                obServer.Port = 0;
                _workspace = (SAS.Workspace)obObjectFactory.CreateObjectByServer(Name, true, obServer, null, null);

                objectKeeper.AddObject(1, Name, _workspace);
            }
        }