Amazon Product Search API via SOAP Example

Put in your Search Word and hit submit, by default it will search for blender 3d.
Search Word:

-------------Begin Sample Output --------------- ´╗┐Caught exception: SOAP-ERROR: Parsing WSDL: Couldn't load from '' : failed to load external entity ""

-------------End Sample Output---------------
-------------Being Example Php Code which generated the above output---------------
-------------Note: You must substitute your own AWS_API_KEY, AWS_API_SECRET_KEY, and AWS_ASSOCIATE_TAG------------------

require 'AmazonECS/AmazonECS.class.php';
define('AWS_ASSOCIATE_TAG', 'AWSECommerceService');
try { /* Get an object with your API Key and secret key. */ $amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'com', AWS_ASSOCIATE_TAG); /* AWS_ASSOCIATE_TAG is now required */ $amazonEcs->associateTag(AWS_ASSOCIATE_TAG); /* if we pass a post variable named search then use that, otherwise default to "Blender 3d" */ if (isset($_POST["search"])){ $search = $_POST["search"]; } else { $search = "blender 3d"; } /* Change category to Book */ $response = $amazonEcs->category('Books')->responseGroup('Large')->search($search); //var_dump($response); foreach($response->Items->Item as $item) { echo "<div style='clear:left; margin: 2px;' >"; echo "<a href=\"".$item->DetailPageURL."\"><img style='float: left; clear:left; margin: 2px;' src=\"".$item->SmallImage->URL."\" alt=\"".$item->ItemAttributes->Title."\" /></a>"; echo "<p >"; echo $item->ItemAttributes->Title; echo "</p><p >"; echo "</p></div>"; } } catch (Exception $e) { echo 'Caught exception: ' , $e->getMessage(), "\n"; }
-------------End Php Code--------------------