Esempio n. 1
0
        private async Task <Provider[]> GetProvidersOfStatusUpdatedSinceAsync(DateTime updatedSince, string status, CancellationToken cancellationToken)
        {
            var message = _messageBuilder.BuildMessageToGetUpdatesSince(updatedSince, status);

            var request = new RestRequest(Method.POST);

            request.AddParameter("text/xml", message, ParameterType.RequestBody);
            request.AddHeader("SOAPAction", "retrieveAllProviders");

            var response = await _restClient.ExecuteTaskAsync(request, cancellationToken);

            var result = EnsureSuccessResponseAndExtractResult(response);

            return(MapProvidersFromSoapResult(result));
        }
        public async Task <byte[]> GetChangesSinceAsync(DateTime sinceTime, string status, CancellationToken cancellationToken)
        {
            var message = _messageBuilder.BuildMessageToGetUpdatesSince(sinceTime, status);

            var request = new RestRequest(Method.POST);

            request.AddParameter("text/xml", message, ParameterType.RequestBody);
            request.AddHeader("SOAPAction", "retrieveAllProviders");

            var response = await _restClient.ExecuteTaskAsync(request, cancellationToken);

            var result = EnsureSuccessResponseAndExtractResult(response);

            return(Encoding.UTF8.GetBytes(result.ToString()));
        }