|MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA|
Consuming Amazon with Flash Remotingby Jason Michael Perry
Editor's Note - In this article you'll learn how to create a responsive UI that can search and display results using Web Services and Flash Remoting. Jason will show you how to build the interface and manipulate the XML Web Service. This tutorial requires Flash MX, Flash Remoting, and a free Amazon.com associate account.
The Power of XML Web Services
As a webmaster, I frequently find myself forcing third party web tools to integrate into my Web site. In the end, I may disguise the obvious subdomain name or that slight change in the consistency of my design, but I shouldn't have to. I should request and get seamless integration from any vendor into my Web site. Well, several companies are finally coming around with XML Web Services.
XML Web Services allow you to hook into a company's infrastructure and share data through the Web. This differs from other methods because it embraces W3C's standards for transportation and descriptions known as SOAP and WSDL. Now companies can embrace this as a way to aggregate real time information. Imagine purchasing financial software off the shelf and seamlessly getting credit card balances and bank statements from different companies. Imagine having full control of that affiliate solution's look and feel.
The power of XML Web Services doesn't stop there. It also allows companies to decrease paper and time by instantly transmitting data. For example, Monster.com, HotJobs.com, and CareerBuilder.com could all receive new job posting for your company via an exposed XML Web Service. This allows your Human Resources department to use one tool for writing and sending job posting that works with several job boards as well as brick and motor placement firms.
Macromedia understands this vision and plans to be part of it with
Flash Remoting. Flash Remoting leaps years ahead of previous ways Flash
grabbed data (remember
Think about this for a second. You can connect to an Amazon.com XML Web Service and create your own Flash store complete with Amazon recommendations, search, product description...the whole nine yards. Or you could create a responsive UI that can search and display results using Google.com's XML Web Service.
And that's exactly what we're going to do in this article. Amazon.com recently released a XML Web Service to allow affiliates to better integrate Amazon.com into their Web sites. This provides amazing potential for Amazon.com, as well as affiliates looking to pass Amazon.com's books off as their own. In this tutorial I'll break down Amazon.com's XML Web Service, show you how to establish a connection with Flash Remoting, and help you build a Flash spotlight that dynamically list Amazon.com's books. To follow along with this tutorial, you should download my Flash file and download Amazon's developer kit. You'll also need to register with Amazon for a unique token. Without this token you cannot connect to the XML Web Service.
Analyzing Amazon's XML Web Service
Now that we understand some of the benefits of XML Web Services, let's take a look at Amazon.com's WSDL. A WSDL (Web Service Description Language) is a XML vocabulary, and we'll use to provide all the information we'll ever need to know about a XML Web Service. With this we can view the Web Service's functions, its location, and special types. Go to http://soap.amazon.com/schemas/AmazonWebServices.wsdl to view the WSDL description.
At first this WSDL may look a little intimidating, but it's
surprisingly simple and easy to understand. First, look at the
I will not breakdown the other object defined types but the request wrapper objects are defined in the sample Flash download.
Another important element in the WSDL is the
By combining our