public void Parse() { var xmlText = @"<CreateQueueResponse xmlns=""http://queue.amazonaws.com/doc/2012-11-05/""> <CreateQueueResult> <QueueUrl>http://queue.amazonaws.com/1234/hello</QueueUrl> </CreateQueueResult> </CreateQueueResponse>" ; var result = CreateQueueResponse.Parse(xmlText).CreateQueueResult; Assert.Equal("http://queue.amazonaws.com/1234/hello", result.QueueUrl); }
public async Task <CreateQueueResult> CreateQueueAsync(string queueName, int defaultVisibilityTimeout = 30) { if (queueName is null) { throw new ArgumentNullException(nameof(queueName)); } var parameters = new SqsRequest { { "Action", "CreateQueue" }, { "QueueName", queueName }, { "DefaultVisibilityTimeout", defaultVisibilityTimeout } /* in seconds */ }; var httpRequest = new HttpRequestMessage(HttpMethod.Post, Endpoint) { Content = GetPostContent(parameters) }; var responseText = await SendAsync(httpRequest).ConfigureAwait(false); return(CreateQueueResponse.Parse(responseText).CreateQueueResult); }