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
"We've been engaging with a lot of customers including Panasonic, we've been involved with Cisco and now we're working with the U.S. government - the Department of Homeland Security," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"We provide IoT solutions. We provide the most compatible solutions for many applications. Our solutions are industry agnostic and also protocol agnostic," explained Richard Han, Head of Sales and Marketing and Engineering at Systena America, in this SYS-CON.tv interview at @ThingsExpo, held June 6-8, 2017, at the Javits Center in New York City, NY.
SYS-CON Events announced today that Calligo, an innovative cloud service provider offering mid-sized companies the highest levels of data privacy and security, has been named "Bronze 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. Calligo offers unparalleled application performance guarantees, commercial flexibility and a personalised support service from its globally located cloud plat...
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...
"The Striim platform is a full end-to-end streaming integration and analytics platform that is middleware that covers a lot of different use cases," explained Steve Wilkes, Founder and CTO at Striim, 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 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 Datera, that offers a radically new data management architecture, has been named "Exhibitor" 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. Datera is transforming the traditional datacenter model through modern cloud simplicity. The technology industry is at another major inflection point. The rise of mobile, the Internet of Things, data storage and Big...
"We are focused on SAP running in the clouds, to make this super easy because we believe in the tremendous value of those powerful worlds - SAP and the cloud," explained Frank Stienhans, CTO of Ocean9, Inc., in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
DX World EXPO, LLC., a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
"MobiDev is a Ukraine-based software development company. We do mobile development, and we're specialists in that. But we do full stack software development for entrepreneurs, for emerging companies, and for enterprise ventures," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
While the focus and objectives of IoT initiatives are many and diverse, they all share a few common attributes, and one of those is the network. Commonly, that network includes the Internet, over which there isn't any real control for performance and availability. Or is there? The current state of the art for Big Data analytics, as applied to network telemetry, offers new opportunities for improving and assuring operational integrity. In his session at @ThingsExpo, Jim Frey, Vice President of S...
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.
In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, discussed the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insights from the vast t...
SYS-CON Events announced today that EnterpriseTech 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. EnterpriseTech is a professional resource for news and intelligence covering the migration of high-end technologies into the enterprise and business-IT industry, with a special focus on high-tech solutions in new product development, workload management, increased effic...
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" 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. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that Cloud Academy named "Bronze Sponsor" of 21st International Cloud Expo which will take place October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara, CA. Cloud Academy is the industry’s most innovative, vendor-neutral cloud technology training platform. Cloud Academy provides continuous learning solutions for individuals and enterprise teams for Amazon Web Services, Microsoft Azure, Google Cloud Platform, and the most popular cloud com...
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze 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. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and ...
SYS-CON Events announced today that CHEETAH Training & Innovation will exhibit 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. CHEETAH Training & Innovation is a cloud consulting and IT training firm specializing in improving clients cloud strategies and infrastructures for medium to large companies.
SYS-CON Events announced today that Datanami 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. Datanami is a communication channel dedicated to providing insight, analysis and up-to-the-minute information about emerging trends and solutions in Big Data. The publication sheds light on all cutting-edge technologies including networking, storage and applications, and thei...
The current age of digital transformation means that IT organizations must adapt their toolset to cover all digital experiences, beyond just the end users’. Today’s businesses can no longer focus solely on the digital interactions they manage with employees or customers; they must now contend with non-traditional factors. Whether it's the power of brand to make or break a company, the need to monitor across all locations 24/7, or the ability to proactively resolve issues, companies must adapt to...