Exemplo n.º 1
0
        public async Task <OfflineResponse> ExecuteOffline(List <IFunction> content)
        {
            if (string.IsNullOrWhiteSpace(this.RequestConfig.PolicyId))
            {
                throw new ArgumentException("Required Policy ID not supplied in config for offline request");
            }

            if (
                this.ClientConfig.Logger != null &&
                (
                    !string.IsNullOrEmpty(this.ClientConfig.SessionId) ||
                    this.ClientConfig.Credentials.GetType() == typeof(SessionCredentials)
                )
                )
            {
                // Log warning if using session ID for offline execution
                this.ClientConfig.Logger.Warn("Offline execution sent to Intacct using Session-based credentials. Use Login-based credentials instead to avoid session timeouts.");
            }

            RequestBlock request = new RequestBlock(this.ClientConfig, this.RequestConfig, content);

            OfflineResponse response = new OfflineResponse(await Execute(request.WriteXml()).ConfigureAwait(false));

            return(response);
        }
Exemplo n.º 2
0
        public async Task <OnlineResponse> ExecuteOnline(List <IFunction> content)
        {
            if (!string.IsNullOrEmpty(this.RequestConfig.PolicyId))
            {
                this.RequestConfig.PolicyId = "";
            }

            RequestBlock request = new RequestBlock(this.ClientConfig, this.RequestConfig, content);

            OnlineResponse response = new OnlineResponse(await Execute(request.WriteXml()).ConfigureAwait(false));

            return(response);
        }