Topic Index
Web Services Web Services exchange data between a server and a client, using a standard XML format to "package" requests and data so that both systems can understand each other.
Web services provide interoperability between various software applications running on different platforms written in different programming languages.
XML-RPC, Remote Procedure Call, uses Hypertext Transfer Protocol (HTTP) and eXtensible Markup Language (XML) to create a standard way of calling remote web services and receiving a response. See XML-RPC Home Page.
SOAP, Software Object Access Protocol, is a lightweight protocol intended for exchanging structured information over HTTP. See SOAP tutorial. Like RPC, SOAP uses XML and its related technologies to define an extensible messaging framework. The framework is independent of any particular programming model and other implementation specific semantics.
REST stands for REpresentational State Transfer. Rather than a new protocol, it consists of a popular set of patterns and idioms for consistent and intuitive web services built on top of existing Web protocols. See Building Web Services the REST Way.
Amazon makes available both SOAP and REST interfaces to their web services, and 85% of their usage is of the REST interface. See http://aws.amazon.com/
Video Scoble goes to Amazon and Learns All About Web Services
Step 1: The article PHP Web Services Without SOAP provides a lengthy description for the following example which uses REST in PHP. In this example, we'll use amazon.com free webservice for searching there books.
First use HTML-Kit to create getResults.php. Paste the following code into this file.
The following developer key can be used today: 03QQ4YYA79SXHH4XG502
amazon will return an XML document in $results which we then print on the page.
We can format the information with XSLT. For example, the following code would format the XML
view code We must change the getResults.php file to reference the XSLT file.
'f' => 'URL of file'
In our case, this should look like
'f' => 'http://www.cwu.edu/~gellenbe/352/amazon.xsl'
To create a search form that calls and posts the results from Amazon,
<form action="getResults.php" method="post" > <p> <label for="input">Enter a search value:</label> <input type="text" name="input" id="input" /> <input type="submit" value="Search"> </p> </form>
Now edit getResults.php so that it does a key word search from the from.
$keywords = "keywords:" . $_POST['input'];
Amazon makes available a handy tool at http://awszone.com/ for accessing their services using REST
Page last modified on April 05, 2008, at 06:11 AM