Exemple #1
0
        public bool Login()
        {
            IOdooCommonRpc loginRpc = XmlRpcProxyGen.Create <IOdooCommonRpc>();

            //loginRpc.Url = _credentials.CommonUrl;
            loginRpc.Url = _credentials.CommonUrl;

            if (_networkProxy != null)
            {
                loginRpc.Proxy = _networkProxy;
            }

            if (_serverCertificateValidation)
            {
                ServicePointManager.ServerCertificateValidationCallback = CheckValidationResult;
            }

            // Log in and get user id
            _credentials.UserId = loginRpc.login(_credentials.DbName, _credentials.DbUser, _credentials.DbPassword);

            // Create proxy for Object operations
            _objectRpc             = XmlRpcProxyGen.Create <IOdooObjectRpc>();
            _objectRpc.Url         = _credentials.ObjectUrl;
            _objectRpc.NonStandard = XmlRpcNonStandard.AllowStringFaultCode;

            return(true);
        }
Exemple #2
0
        public bool Login()
        {
            IOdooCommonRpc loginRpc = XmlRpcProxyGen.Create <IOdooCommonRpc>();

            loginRpc.Url = _credentials.CommonUrl;

            if (_networkProxy != null)
            {
                loginRpc.Proxy = _networkProxy;
            }

            if (_serverCertificateValidation)
            {
                ServicePointManager.ServerCertificateValidationCallback = CheckValidationResult;
            }

            int userId = loginRpc.Login(_credentials.Database, _credentials.Username, _credentials.Password);

            _credentials.UserId = userId;


            _objectRpc     = XmlRpcProxyGen.Create <IOdooObjectRpc>();
            _objectRpc.Url = _credentials.ObjectUrl;

            return(true);
        }