Responses

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

Response Messages

In response to an action request, FWS returns an XML data structure that contains the results of the request. Other than the use of a message envelope in the case of SOAP, the structure for the results is the same for Query, SOAP, and REST responses.

The Structure of a Response

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

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 child elements. Each Error includes:

  • A Code that identifies the type of error that occurred

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

The following is an example of a successful response:

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <ns1:GetServiceStatusResponse
            xmlns:ns1="http://fba-inbound.amazonaws.com/doc/2007-05-10/">
            <ns1:GetServiceStatusResult>
                <ns1:Status>2008-01-23 16:43:12.975 PST service responding.
                    [Version: 2007-05-10]</ns1:Status>
            </ns1:GetServiceStatusResult>
            <ns1:ResponseMetadata>
                <ns1:RequestId>5fa04c3a-4bb4-485d-926c-e3c8002c192e</ns1:RequestId>
            </ns1:ResponseMetadata>
        </ns1:GetServiceStatusResponse>
    </soapenv:Body>
</soapenv:Envelope>

The following is an example of an error response:

<?xml version="1.0"?>
<GetServiceStatusErrorResponse
    xmlns="http://fba-inbound.amazonaws.com/doc/2007-05-10/">
    <Error>
        <Code>InvalidClientTokenId</Code>
        <Message>The AWS Access Key Id you provided does not exist in our
            records.</Message>
    </Error>
    <RequestID>42fd0235-1c23-4e1e-872c-1fa3e4a4b050</RequestID>
</GetServiceStatusErrorResponse>

Related Topics