当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: Amazon.com, the "earths bigges
 

 

    摘要: last month i introduced a precompile "batch" file that allowed you to manually compile cfmx templates, saving the penalty paid by the first user to browse a cfmx template after it was created or edi......
    摘要:http status codes can help you implement threading and more. here are a couple of ideas. although the power of coldfusion allows us as developers to do many things very quickly compared to many othe......


Exploring Amazon Web Services with ColdFusion MX @ JDJ
i want to start off quickly with an example of something that you can run right away without having to write any code. save the code in listing 1 to your cfmx server environment, placing it in a directory where you can execute other cfmx templates. this might be a subdirectory of your webroot, such as c:\cfusionmx\wwwroot. save it as amazon-search-simple.cfm.

dont worry if you dont understand entirely whats going on. just save it and run it, then take a look at the code.

sidebar 【推荐阅读:XDoclet 说明

amazon.com, the "earths biggest selection," has exposed their entire catalog of products, product reviews and ratings, user-created book lists, and more via web services. whether youre new to web services or not, and even if you dont care so much about accessing amazons data, it presents an interesting case study of doing web services in cfmx. you might even be able to turn the opportunity into profit!

in this months journeyman column, ill walk you through using amazon web services (aws), and along the way will point out some of the key points you need to know about cf (and dreamweaver) to be able to use them. if youve not explored this feature of cfmx yet, the good news is that its really quite easy. and if you have begun using web services in cfmx, you might learn a thing or two along the way.

coldfusion mx supports both the consumption and creation of web services. in this article, well focus only on consuming them. there have been several articles both in this magazine and at the macromedia devnet site that cover more details about creating web services (using cfcs). you may want to look for and refer to those for more background after reading this if youre entirely new to the process of working with web services in general, or in cf.

but any cf developer should be able to follow along here quite easily. cf makes this just extraordinarily trivial to set up compared to many other environments.

a quick example

before you try to browse this url to execute the request, note that amazon expects developers to obtain their own "developer tag." this is free and can be done easily at www.amazon.com/webservices. youll get one on the spot. apply that value in the one line of code:

akeywordrequest.devtag="yourtag";

this simple example will retrieve a selection of books from amazons database, based on a "keyword" provided in the query string. in other words, to search for a book, enter ?keyword =somevalue on the url when calling this template. ive designed it so that if you dont supply any, it will search for cf books by default. (certainly, a more complete example would provide a form for the user to enter values instead.) figure 1 shows a screenshot of how the results might appear. -->

this is a very simplistic example that leaves a few questions unanswered: why were only 10 records returned? how do you reque
...   下一页

 ·fusebox or mach-ii? @ jdj    »显示摘要«
    摘要:for more than seven years, fusebox (www.fusebox.org), now in its fourth version, has been the dominant framework for building coldfusion applications. during that time, fusebox has evolved from a set ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE