Hello, please sign in or register
You are here: Home

Amazon Webservices using nuSOAP and WSDL

This is my code that connects to the Amazon Affiliate Services. If you haven't encountered SOAP you will be thrilled. Simply point to WSDL client, An XML document, and it creates the objects that you can access with your script. Fantastic!!

You will need the php nuSOAP.php class for this magic trick download the nuSOAP.php class

Here's the code

[CODE=AmazonSOAP.php] $ISBN, "tag" => "wwwbookscou0c-21", "type" => "heavy", "devtag" => "wwwbookscou0c-21", "locale" => "uk" ); // create a instance of the SOAP client object $soapclient = new soapclient("http://soap-eu.amazon.com/schemas3/AmazonWebServices.wsdl", true); // create a proxy so that WSDL methods can be accessed directly $proxy = $soapclient->getProxy(); // Call the WSDL defined function which returns an array on info $result = $proxy->ASINSearchRequest($params); // To see the result uncomment the next line // print_r($result); // I included the following to handle 'nil results' if($result && !isset($result["Details"][0]["Status"])){ $r = $result["Details"][0]; // Amazon ask that their strings come in a set format // e.g. http://www.amazon.co.uk/exec/obidos/asin/0747573395/wwwbookscou0c-21/ // So function "RewriteAmazonUrl" rewrites the URL in this form and appends the string "ref=nosim/" to direct user to to the buying page RewriteAmazonUrl($r["Url"]); return $r; } else return NULL; } function RewriteAmazonUrl(&$url){ $url = substr($url, 0, strpos($url, "?"))."/ref=nosim/"; } ?>[/CODE] Change the "tag" and "devtag" to your Amazon affiliates id If you want to get the American Data use the schema "http://soap.amazon.com/schemas2/AmazonWebServices.wsdl" and remove the locale params

Comments

guoyanying
But the replica watches sentry reebok shoes knew abercrombie and fitch uk his
Created 07/10/15
1015maoqiuyun
coach outlet online, http://www.coachoutletonline-store.us.com/
Created 15/10/15
ninestab123
ninest123 One canada goose pas cher gucci outlet thing
Created 21/07/16
michael kors factory outlet
adidas nmd pandora bracelet
Created 16/05/17
Title*
Comment

Prove you are not a robot

To prove you are not a robot, please type in the six character code you see in the picture below
Security confirmation codeI can't see this!
Contact
Name*
Email never shown*
Home Page

Author

Andrew Dodson
Since:Feb 2007

Comment | flag

Categories

Bookmark and Share