Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

Consuming Amazon.com E-Commerce

An overview

One of the most popular articles I've ever written was on Amazon.com Web services. The article was written for the Macromedia Developer Center and is located at www.macromedia.com/devnet/coldfusion/articles/wsamazon.html.

This article is a bit dated. A few days before it was published, Amazon.com released version 1 of their SOAP Web services. In this issue on exchanging data, I thought it'd be great to write an article on version 4 of Amazon.com's SOAP interface, released in September. They are now called "Amazon.com E-Commerce Services."

After two days of much frustration, I was unable to successfully invoke the SOAP Web services from ColdFusion or BlueDragon; I kept getting semantic errors when compiling the WSDL. However, you can still use Amazon.com Web services without SOAP, using REST instead, which is a SOAP alternative. In this article, I'll introduce you to Web services and show you everything you need to know to implement Amazon.com's E-commerce services on your site.

Web Service Definitions
Before delving into Amazon.com specifics, I want to make sure we're all on the same page when it comes to terminology. If you're already familiar with Web services, you can probably skip this section. If you are new, or want a reminder primer, read on.

Most of the time when you hear someone talk about Web services, they're talking about SOAP. SOAP stands for Simple Object Access Protocol, an XML dialect that is used to define how Web services can communicate with the programming language calling it. Not all Web services are SOAP, though. A Web service is defined as any program run over a network by another program. If you've ever used cfhttp to process a credit card transaction through a gateway provider, you've used a non-SOAP-based Web service. These types of requests are sometimes called REST requests. REST stands for Representational State Transfer. Instead of passing an XML-based SOAP request, REST is done by using a variety of URL parameters to specify which methods to invoke and which values to pass in. More information on REST can be found at www.ics.uci.edu/%7Efielding/pubs/dissertation/rest_arch_style.htm.

The next definition is the WSDL, the Web Services Definition Language. It defines the functionality of a SOAP Web service. WSDL is another XML variant. The WSDL will tell you the operations you can perform against the Web service and what you would expect to get in return for that service. In many cases, you'll be provided with English documentation (such as a Word doc, PDF, or HTML) for the Web services and won't have to read the WSDL manually. If you think of a Web service as a CFC, the WSDL will define the names of methods, the input parameters to those methods, and the type of data that is returned from those methods. If you create a Web service in ColdFusion, the WSDL is generated automatically for you, just by appending "?wsdl" to the URL. In ColdFusion, you'll need to know the location of the WSDL is to create a Web service object.

There are two other definitions that you can use when speaking about Web services. The first is to publish a Web service. When you publish a Web service, you're making it available for people to use. If the Web service is public, such as Google or Amazon's Web services, anyone can use it. If the Web service is private, you may only be providing access to clients, customers, or other departments in your company. The act of publishing is merely telling someone the URL and providing the documentation on how to use the Web service.

On the other side of the coin, Web services are consumed. To consume a Web service means that you are using a Web service. It's as simple as that. Amazon.com published their Web services by making them public. As the one using the Web service, we are consuming them. Publish always seemed like a logical name for making Web services available, but it took me a while to get used to "consuming" them.

Getting Started with Amazon.com Web Services
Why would you want to use Amazon.com Web services? Perhaps you're an associate and want to bump up your potential for income by allowing people to search the full Amazon catalog. Perhaps you're a merchant who is selling a product through the Amazon.com store. The Amazon.com e-commerce services offer many features, including:

  • Product Searches: If you take away its product catalog, there isn't much to the Amazon.com Web site. You have the full array of search options available through the Web service interface that you do via the Amazon.com Web site. After a search, you can always get full details on an individual product.
  • Product Images: Image data is returned as part of the search.
  • Customer Reviews: You have full access to the customer reviews for any given product.
  • Wish List Searches: You can search wish lists by name, e-mail address, city, or state using the Web service interface.
  • Remote Shopping Cart: You can now have your users add items to their Amazon.com shopping cart without leaving your own site.
To get started setting up Amazon.com Web services on your site, first register for a subscription ID. You can do so at the Amazon.com site: Register. If you're not an Amazon.com associate (but want to be), you can join the associate program here: Associate Program.

Deconstructing the Amazon.com URL
You're ready to perform your search. The first step is to construct your URL. The URL starts with the location http://webservices.amazon.com/onca/xml. It is the query string parameters that provide us with the search results:

  • Service: The service parameter accepts the value of AWSECommerceService to access Amazon.com E-commerce services. It is required.
  • SubscriptionId: The subscriptionID was provided to you when you signed up for the developer program. This is also a required parameter.
  • Operation: The operation parameter describes what operation you are trying to perform. There are 18 different actions that you can perform. In this article I'll show you ItemSearch and ItemLookup. You can also look up seller info, perform similarity searches, add information to the user's Amazon.com shopping cart, or look up public customer information (such as reviews or wishlists). This is required.
  • AssociateTag: If you are an Amazon.com associate, put your associate tag here to ensures that you keep getting the kickbacks when people buy something based on your referral. This is optional.
  • ResponseGroup: The responsegroup parameter is used to define the type of information that is sent back to you
  • Operation Parameters: The operation parameters are a set of parameters required for each operation. You might think of this as similar to the way that cffile works. You use a different set of parameters to upload a file than you do to copy a file, move a file, and so on. Other tags, such as cfobject and cfloop, operate in a similar manner.
Note that all of these parameters are case sensitive.

More Stories By Jeffry Houser

Jeffry is a technical entrepreneur with over 10 years of making the web work for you. Lately Jeffry has been cooped up in his cave building the first in a line of easy to use interface components for Flex Developers at www.flextras.com . He has a Computer Science degree from the days before business met the Internet and owns DotComIt, an Adobe Solutions Partner specializing in Rich Internet Applications. Jeffry is an Adobe Community Expert and produces The Flex Show, a podcast that includes expert interviews and screencast tutorials. Jeffry is also co-manager of the Hartford CT Adobe User Group, author of three ColdFusion books and over 30 articles, and has spoken at various events all over the US. In his spare time he is a musician, old school adventure game aficionado, and recording engineer. He also owns a Wii. You can read his blog at www.jeffryhouser.com, check out his podcast at www.theflexshow.com or check out his company at www.dot-com-it.com.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@ThingsExpo Stories
The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, will introduce two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a mu...
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
Mobile device usage has increased exponentially during the past several years, as consumers rely on handhelds for everything from news and weather to banking and purchases. What can we expect in the next few years? The way in which we interact with our devices will fundamentally change, as businesses leverage Artificial Intelligence. We already see this taking shape as businesses leverage AI for cost savings and customer responsiveness. This trend will continue, as AI is used for more sophistica...
"When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
SYS-CON Events announced today that SourceForge has been named “Media Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. SourceForge is the largest, most trusted destination for Open Source Software development, collaboration, discovery and download on the web serving over 32 million viewers, 150 million downloads and over 460,000 active development projects each and every month.
SYS-CON Events announced today that DXWorldExpo has been named “Global Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Digital Transformation is the key issue driving the global enterprise IT business. Digital Transformation is most prominent among Global 2000 enterprises and government institutions.
SYS-CON Events announced today that Nihon Micron will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nihon Micron Co., Ltd. strives for technological innovation to establish high-density, high-precision processing technology for providing printed circuit board and metal mount RFID tags used for communication devices. For more inf...
SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
SYS-CON Events announced today that Mobile Create USA will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Mobile Create USA Inc. is an MVNO-based business model that uses portable communication devices and cellular-based infrastructure in the development, sales, operation and mobile communications systems incorporating GPS capabi...
SYS-CON Events announced today that Daiya Industry will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Daiya Industry specializes in orthotic support systems and assistive devices with pneumatic artificial muscles in order to contribute to an extended healthy life expectancy. For more information, please visit https://www.daiyak...
SYS-CON Events announced today that Fusic will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Fusic Co. provides mocks as virtual IoT devices. You can customize mocks, and get any amount of data at any time in your test. For more information, visit https://fusic.co.jp/english/.
SYS-CON Events announced today that Keisoku Research Consultant Co. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Keisoku Research Consultant, Co. offers research and consulting in a wide range of civil engineering-related fields from information construction to preservation of cultural properties. For more information, vi...
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that Interface Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Interface Corporation is a company developing, manufacturing and marketing high quality and wide variety of industrial computers and interface modules such as PCIs and PCI express. For more information, visit http://www.i...
Elon Musk is among the notable industry figures who worries about the power of AI to destroy rather than help society. Mark Zuckerberg, on the other hand, embraces all that is going on. AI is most powerful when deployed across the vast networks being built for Internets of Things in the manufacturing, transportation and logistics, retail, healthcare, government and other sectors. Is AI transforming IoT for the good or the bad? Do we need to worry about its potential destructive power? Or will we...
SYS-CON Events announced today that Enroute Lab will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enroute Lab is an industrial design, research and development company of unmanned robotic vehicle system. For more information, please visit http://elab.co.jp/.
In his session at @ThingsExpo, Greg Gorman is the Director, IoT Developer Ecosystem, Watson IoT, will provide a short tutorial on Node-RED, a Node.js-based programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using a wide range of nodes in the palette that can be deployed to its runtime in a single-click. There is a large library of contributed nodes that help so...
DevOps at Cloud Expo – being held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real r...