Getting the Attributes of an Item

In the previous section, the value Blue was deleted from the Color attribute of Item_03.

The following sample code snippets demonstrate displaying all attributes of Item_03.

Java

To run the sample

  1. Open a clean copy of GetAttributesSample.java.

  2. Remove any comment marks from the invokeGetAttributes(service, request); line and add the following lines after // @TODO: set request parameters here:

    GetAttributes request = new GetAttributes();
    
    String domainName = "MyStore";
    String itemName = "Item_03";
    
    request.setDomainName(domainName);
    request.setItemName(itemName);
    
  3. Compile and run the sample. Amazon SimpleDB gets all attributes of Item_03.

C#

To run the sample

  1. Open AmazonSimpleDBSamples.cs.

  2. Comment out the code you added in the previous section.

  3. Replace the Get Attributes Action section with the following:

    GetAttributes getAttributesAction = new GetAttributes().WithDomainName("MyStore").WithItemName("Item_03");
    
    GetAttributesSample.InvokeGetAttributes(service, getAttributesAction);
    
  4. Run the sample.

    Amazon SimpleDB gets all attributes of Item_03.

Perl

To run the sample

  1. Open a clean copy of GetAttributesSample.pl.

  2. Remove any comment marks from the invokeGetAttributes($service, $request); line and add the following lines after the // @TODO: set request line:

    my $request = Amazon::SimpleDB::Model::GetAttributes->new({
    ItemName => "Item_03",
    DomainName=> "MyStore"
    });
    
  3. Run the sample.

    Amazon SimpleDB gets all attributes of Item_03.

PHP

To run the sample

  1. Open a clean copy of GetAttributesSample.php.

  2. Remove any comment marks from the invokeGetAttributes($service, $request); line and add the following lines after the // @TODO: set request line:

     $request = new Amazon_SimpleDB_Model_GetAttributes();
     $request->setDomainName('MyStore');
     $request->setItemName('Item_03');
    
  3. Run the sample.

    Amazon SimpleDB gets all attributes of Item_03.

VB.NET

To run the sample

  1. Open AmazonSimpleDBSamples.vb.

  2. Comment out the code you added in the previous section.

  3. Replace the Get Attributes Action section with the following:

     Dim getAttributesAction As New GetAttributes()
     getAttributesAction.WithDomainName("MyStore").WithItemName("Item_03")
    
     GetAttributesSample.InvokeGetAttributes(service, getAttributesAction)
    
  4. Run the sample.

    Amazon SimpleDB gets all attributes of Item_03.

Scratchpad

To run the sample

  1. Open the scratchpad application with a web browser.

  2. Select GetAttributes from the Explore API list box.

  3. Enter MyStore in the Domain Name field.

  4. Enter Item_03 in the Item Name field.

  5. Select from the following:

    • To invoke the request, click Invoke Request.

      Amazon SimpleDB gets all attributes of Item_03.

    • To view the signed URL, click Display Signed URL. Then, copy and paste the signed URL into a browser.

      Amazon SimpleDB gets all attributes of Item_03.

    • To view the string to sign, click Display String to Sign.