Amazon Web Services: Overview and Example with Java and PHP
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 Amazon.com.
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.
AmazonProxy.java–This class includes the code to communicate with the JAX-RPC proxy or stub classes generated for you by Sun ONE Studio.
AmazonServices.java–This class is the main Swing component. In addition to its graphic functions, it instantiates the
BookDetailsPanel.java–This Swing component displays individual book detail information.
CategoryPanel.java–This Swing component lets the user select categories of books from Amazon’s catalog.
EditorialReviewPanel.java–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 2 shows a sample of the kind of data that the client can retrieve from the Amazon Web Service.
If the user clicks a title’s See Review button, the example client application displays a review of that book, shown in Figure 3.
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 Amazon.com $soapclient = new soapclient("http://soap.amazon.com/schemas2/AmazonWebServices.wsdl", 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.
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.”