1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| $wsdl = "http://webservices.amazon.com/AWSECommerceService/2010-10-01/US/AWSECommerceService.wsdl";
$params = array(
'AWSAccessKeyId' => 'AKIAJHWJRIV57OXSRXFQ',
'AssociateTag' => 'ws',
'Request' => array(
array('SearchIndex' => $searchindex,'Keywords' => $keywords)
)
);
$client = new SoapClient($wsdl,array('exceptions' => FALSE,'soap_version' => SOAP_1_1,'trace' => TRUE));
//var_dump($client->__getFunctions());
$resultat = $client->ItemSearch($params);
if(is_soap_fault($resultat))
{
echo "<br>SOAP fault -> faultcode : " . $resultat->faultcode . " faultstring : " . $resultat->faultstring . " faultactor : " . $resultat->faultactor . "<br>" ;
return FALSE;
}
else
{
echo "<br>Requete SOAP correcte.<br>";
}
echo "<br>";
echo "<h2>Requete</h2><pre>" . htmlspecialchars($client->_getLastRequest(),ENT_QUOTES) . "</pre>";
echo "<h2>Reponse</h2><pre>" . htmlspecialchars($client->_getLastResponse(),ENT_QUOTES) . "</pre>";
echo "<br>"; |
Partager