Amazon Web Services: Overview and Example with Java and PHP

20 July, 2008 at 19:38 4 comments

Until 1 hour ago I had same problems with WordPress, image and other functionality didn’t work. After done all the means in my power and ability, I decided to contact wordpress. WordPress problem derived from Amazon Web Services dependencies! What’s that?

The Amazon Web Services (AWS) are a collection of remote computing services (also called web services) offered over the Internet by

Launched in July 2002, Amazon Web Services provide online services for other web sites or client-side applications. Most of these services are not exposed directly to end users, but instead offer functionality that other developers can use. In June 2007, Amazon claimed that more than 330,000 developers had signed up to use Amazon Web Services.

Amazon Web Services’ offerings are accessed over HTTP, using REST and SOAP protocols. All are billed on usage, with the exact form of usage varying from service to service.

Amazon Web Services offers a variety of web services that allow you to build innovative businesses.

Amazon Associates Web Service
The Amazon Associates Web Service exposes Amazon’s product data and e-commerce functionality. This allows developers, web site owners and merchants to leverage the data and functionality that Amazon uses to power its own e-commerce business making it extremely easy for developers to build rich, highly effective web sites and applications.

Amazon Elastic Compute Cloud (Amazon EC2) – Beta
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers. Just as Amazon Simple Storage Service (Amazon S3) enables storage in the cloud, Amazon EC2 enables “compute” in the cloud. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use.

Amazon Simple Storage Service (Amazon S3)
Amazon S3 is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, fast, inexpensive data storage infrastructure that Amazon uses to run its own global network of web sites.

Amazon Simple Queue Service (Amazon SQS)
Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for storing messages as they travel between computers. By using Amazon SQS, developers can simply move data between distributed components of their applications that perform different tasks, without losing messages or requiring each component to be always available. Amazon SQS makes it easy to build an automated workflow, working in close conjunction with the Amazon Elastic Compute Cloud (Amazon EC2) and the other AWS infrastructure web services.

You can find more here

Amazon Web Services JAVA Example

The example client application is a Swing client that searches the Amazon catalog for books whose subject matches a user-selected topic. The application displays ten books that match the chosen topic, and shows the author name, book title, list price, Amazon discount price, and the cover icon. The user may optionally view one review per displayed title.

You will write five Java classes for this application.

  •–This class includes the code to communicate with the JAX-RPC proxy or stub classes generated for you by Sun ONE Studio.
  •–This class is the main Swing component. In addition to its graphic functions, it instantiates the AmazonProxy class.
  •–This Swing component displays individual book detail information.
  •–This Swing component lets the user select categories of books from Amazon’s catalog.
  •–This Swing component displays review comments on a particular book.

Note that the four Swing component classes have corresponding .form files that Sun ONE Studio generates to depict the GUI you design.

This application has been intentionally kept simple to illustrate how to create Web Service clients. It is not intended to showcase the entire range of functionality available to an application through the Amazon Web Services, nor is it intended to illustrate all the capabilities of a Swing client.

Figure 1 gives a quick view of the application’s GUI interface. In the first screen, the user selects from the various available book categories.

Figure 1: Client Application Category Selection Screen

Figure 2 shows a sample of the kind of data that the client can retrieve from the Amazon Web Service.

Figure 2: Matching Book Display
Click image to enlarge

If the user clicks a title’s See Review button, the example client application displays a review of that book, shown in Figure 3.

Figure 3: Book Review
Click image to enlarge


Amazon Web Services PHP Example

Amazon has made a number of important method calls available in the AWS API – here’s a brief list:

BrowseNodeSearchRequest() – retrieve a list of catalog items attached to a particular node in the Amazon database;

ASINSearchRequest() – retrieve detailed information for a given product code;

KeywordSearchRequest() – perform a keyword search on the Amazon database;

SellerSearchRequest() – perform a search for products listed by third-party sellers;

PowerSearchRequest() – perform an advanced search on the Amazon database;

SimilaritySearchRequest() – perform a search for similar items, given a specific product code.

Additionally, AWS includes methods to search for authors, actors, directors, artists, manufacturers, wish lists and user lists.

This might not seem like much to start with – but, as you’ll see, looks are deceptive. Consider the following simple example, which provides a gentle introduction to the power of AWS:

<?php // include class include("nusoap.php"); // create a instance of the SOAP client object // remember that this script is the client, // accessing the web service provided by $soapclient = new soapclient("", true); // uncomment the next line to see debug messages // $soapclient->debug_flag = 1; // create a proxy so that WSDL methods can be accessed directly $proxy = $soapclient->getProxy(); // set up an array containing input parameters to be // passed to the remote procedure $params = array( 'browse_node' => 18, 'page' => 1, 'mode' => 'books', 'tag' => 'melonfire-20', 'type' => 'lite', 'devtag' => 'YOUR-TOKEN-HERE' ); // invoke the method $result = $proxy->BrowseNodeSearchRequest($params); // print the results of the search print_r($result); ?>


Amazon S3 Down: Timeline and description

Amazon’s S3 storage service appears to be down. CenterNetworks images are broken because of it and I had to move the style sheet back so the site at least renders correctly. Sites like Twitter have massive broken images currently because Amazon S3 is down.

We will keep updating this post until the service has recovered. As of Noon Eastern time, the S3 service is down.

Amazon’s S3 service was also down this past February and Amazon explained the reasons for the outage and downtime a few days later. There has to be a way to failover when S3 is down.

As always report in if you are having issues with Amazon S3.

Update: Amazon S3 clients are now posting outage messages on the forums. It appears EC2 is working ok.

Update 2: Amazon is now reporting on their health dashboard that Amazon S3 has “elevated error rates”.

Update 3 – 12:55pm: Now down over an hour, Amazon says they are “pursuing several paths of corrective action. Sites affected include SmugMug and Twitter. Twitter is up with no images while SmugMug had to take the service down since so much of it relies on Amazon’s services.

Update 4 – 1:55pm: Amazon now reporting, “10:33 AM PDT A quick update that we believe this is an issue with the communication between several Amazon S3 internal components. We do not have an ETA at this time but will continue to keep you updated.”

Update 5 – 3:45pm: We are now down over 3.5 hours – Amazon’s latest update, “12:25 PM PDT We have restored communication between additional hosts and are continuing this work across the rest of the fleet. Thank you for your continued patience.”

Update 6 – 6:00pm: Here’s Amazon’s last update, “2:36 PM PDT We have restored all internal communication across Amazon S3 hosts. We have started the multi-step process to begin accepting requests across Amazon S3 locations.”



Bookmark and Share


Entry filed under: Java, PHP, SOAP, Web Services. Tags: , , , .

Groovy and Grails: Concepts, Examples and Methods Single sign-on (SSO): Concepts, Methods and Frameworks

4 Comments Add your own

  • 1. Gunius  |  21 July, 2008 at 09:04

    Thank you for this post.

  • 2. Maurizio Storani  |  21 July, 2008 at 14:13

    Your welcome!!

  • 3.  |  18 May, 2013 at 10:49

    Hi to all, as I am genuinely eager of reading this weblog’s post to be updated on a regular basis. It consists of good information.

  • 4. why online maps are handy  |  17 July, 2013 at 18:27

    Fantastic beat ! I would like to apprentice even as you amend your web site, how
    can i subscribe for a weblog site? The account
    helped me a applicable deal. I were tiny bit acquainted of this your broadcast provided vivid clear idea


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

IT Passion’s Store



Get the Source
OSGi supporter
JUG Milano

Upcoming Events


Blog Stats

  • 371,507 hits

My PageRank

What's My Google PageRank?

%d bloggers like this: