Ejemplo n.º 1
0
        /// <summary>
        /// Execute a request synchronously
        /// </summary>
        /// <param name="config"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public async Task <SynchronousResponse> ExecuteSynchronous(SdkConfig config, Content content)
        {
            if (!String.IsNullOrWhiteSpace(config.PolicyId))
            {
                config.PolicyId = null;
            }
            RequestBlock request = new RequestBlock(config, content);

            SynchronousResponse response = new SynchronousResponse(await Execute(request.WriteXml()));

            return(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Execute a request asynchronously
        /// </summary>
        /// <param name="config"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public async Task <AsynchronousResponse> ExecuteAsynchronous(SdkConfig config, Content content)
        {
            if (String.IsNullOrWhiteSpace(config.PolicyId))
            {
                throw new ArgumentException("Required PolicyId not supplied in params for asynchronous request");
            }

            RequestBlock request = new RequestBlock(config, content);

            AsynchronousResponse response = new AsynchronousResponse(await Execute(request.WriteXml()));

            return(response);
        }