29.07.2020 Views

sqs-dg-2009-02-01

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Amazon Simple Queue Service Developer Guide

Responses

Responses

Topics

• Structure of a Successful Response (p. 27)

• Structure of an Error Response (p. 27)

• Related Topics (p. 28)

In response to an action request, SQS returns an XML data structure that contains the results of the

request. This data conforms to the SQS schema. For more information, see WSDL Location and API

Version in the Amazon SQS API Reference.

Structure of a Successful Response

If the request succeeded, the main response element is named after the action, but with "Response"

appended. For example, CreateQueueResponse is the response element returned for a successful

CreateQueue request. This element contains the following child elements:

• ResponseMetadata, which contains the RequestId child element

• An optional element containing action-specific results; for example, the CreateQueueResponse

element includes an element called CreateQueueResult

The XML schema describes the XML response message for each SQS action.

The following is an example of a successful response.

<CreateQueueResponse

xmlns=http://sqs.us-east-1.amazonaws.com/doc/2009-02-01/

xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

xsi:type=CreateQueueResponse>

<CreateQueueResult>

<QueueUrl>

http://sqs.us-east-1.amazonaws.com/770098461991/queue2

</QueueUrl>

</CreateQueueResult>

<ResponseMetadata>

<RequestId>cb919c0a-9bce-4afe-9b48-9bdf2412bb67</RequestId>

</ResponseMetadata>

</CreateQueueResponse>

Structure of an Error Response

If a request is unsuccessful, the main response element is called ErrorResponse regardless of the

action that was called.This element contains an Error element and a RequestId element. Each Error

includes:

• A Type element that identifies whether the error was a receiver or sender error

• A Code element that identifies the type of error that occurred

• A Message element that describes the error condition in a human-readable form

• A Detail element that might give additional details about the error or might be empty

The following is an example of an error response.

API Version 2009-02-01

27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!