Response Groups

This section describes the structure of a response to an Amazon SQS request.

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.

Other than the use of a message envelope in the case of SOAP, the schema for the results is the same for Query, SOAP, and REST responses. The SOAP WSDL imports an XSD file to define the response messages, and Query and REST users can access the XSD file directly. For more information, see WSDL and Schema Locations.

The response message is returned in an XML element named after the action. For example, the CreateQueue action returns a response element named CreateQueueResponse.

If a request is successful, a ResponseStatus element is returned (as a child of the main response element) containing a StatusCode element with a value of Success. It also contains a RequestID element.

If a request is unsuccessful, the main response element is named Response, irrespective of the action requested. This element contains an Errors element, with one or more Error elements. Each Error includes:

This is an example of a successful response:

<CreateQueueResponse 
  xmlns=http://queue.amazonaws.com/doc/2006-04-01/ 
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance 
  xsi:type=CreateQueueResponse>
    <QueueUrl>
        http://queue.amazonaws.com/A23E9WXPHGOG29/queue2
    </QueueUrl>
    <ResponseStatus>
      <StatusCode>Success</StatusCode>
      <RequestId>cb919c0a-9bce-4afe-9b48-9bdf2412bb67</RequestId>
    </ResponseStatus>
</CreateQueueResponse>

This is an example of an error response:

<Response>
    <Errors>
        <Error>
            <Code>
                InvalidParameterValue
            </Code>
            <Message>
              Value (quename_nonalpha) for parameter QueueName is invalid. 
              Must be an alphanumeric String of 1 to 80 in length
            </Message>
        </Error>
    </Errors>
    <RequestID>
        42d59b56-7407-4c4a-be0f-4c88daeea257
    </RequestID>
</Response>