コード例 #1
0
        public MagentoServiceLowLevelSoap_v_from_1_7_to_1_9_CE(string apiUser, string apiKey, string baseMagentoUrl, string store)
        {
            this.ApiUser        = apiUser;
            this.ApiKey         = apiKey;
            this.Store          = store;
            this.BaseMagentoUrl = baseMagentoUrl;

            _customBinding           = CustomBinding(baseMagentoUrl);
            this._magentoSoapService = this.CreateMagentoServiceClient(baseMagentoUrl);
            this.Magento1xxxHelper   = new Magento1xxxHelper(this);
            this.PullSessionId       = async() =>
            {
                var privateClient = this.CreateMagentoServiceClient(this.BaseMagentoUrl);
                var loginResponse = await privateClient.loginAsync(this.ApiUser, this.ApiKey).ConfigureAwait(false);

                return(Tuple.Create(loginResponse.result, DateTime.UtcNow));
            };

            this.getSessionIdSemaphore = new SemaphoreSlim(1, 1);
        }
コード例 #2
0
        public MagentoServiceLowLevelSoap_v_from_1_7_to_1_9_CE(string apiUser, string apiKey, string baseMagentoUrl, string store, int sessionIdLifeTime, int getProductsMaxThreads, bool logRawMessages, MagentoConfig config)
        {
            this.ApiUser        = apiUser;
            this.ApiKey         = apiKey;
            this.Store          = store;
            this.BaseMagentoUrl = baseMagentoUrl;
            this.LogRawMessages = logRawMessages;

            this._clientFactory      = new MagentoServiceSoapClientFactory(baseMagentoUrl, logRawMessages, config);
            this._magentoSoapService = this._clientFactory.GetClient();
            this.Magento1xxxHelper   = new Magento1xxxHelper(this);
            this.PullSessionId       = async() =>
            {
                var privateClient = this._clientFactory.GetClient();
                var loginResponse = await privateClient.loginAsync(this.ApiUser, this.ApiKey).ConfigureAwait(false);

                return(Tuple.Create(loginResponse.result, DateTime.UtcNow));
            };

            this.getSessionIdSemaphore  = new SemaphoreSlim(1, 1);
            this._getProductsMaxThreads = getProductsMaxThreads;
            this.SessionIdLifeTime      = sessionIdLifeTime;
        }