Line 20 of the error message falls on the $parsed_xml line.
Can you give me some debug hints?
This is a simple rest request to Amazon product sellers api.
It seems to get through the Amazon authentication.
The apisigning page adds the signed certificate.
thanks,
---------error message----------
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, '<' not found in /Library/WebServer/Documents/lexsource.php on line 20
Warning: simplexml_load_string() [function.simplexml-load-string]: %3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Strict%2F%2FEN%22%0A+ in /Library/WebServer/Documents/lexsource.php on line 20
Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /Library/WebServer/Documents/lexsource.php on line 20
Notice: Trying to get property of non-object in /Library/WebServer/Documents/lexsource.php on line 22
Notice: Trying to get property of non-object in /Library/WebServer/Documents/lexsource.php on line 22
$access_key = "thisisadummyaccesskey";
$prod_category=amazon($access_key, $item_id="B000VCKK02");
print_r($prod_category);
function amazon($AccessKey,$ItemId){
$allparameter =
// "AssociateTag" ."=". $associate_id ."&".
"Service" ."=". "AWSECommerceService" ."&".
"AWSAccessKeyId" ."=". $AccessKey ."&".
"Operation" ."=". "ItemLookup" ."&".
"IdType" ."-". "ASIN" ."&".
"ItemId" ."=". $ItemId ."&".
"ResponseGroup" ."=". "Medium" ."&".
"Version" ."=". "2009-01-06";
$data = urlencode(file_get_contents("http://free.apisigning.comg/onca/xml?".$allparameter));
$parsed_xml = simplexml_load_string($data);
$numOfItems = $parsed_xml->Items->TotalResults;
if($numOfItems>0){
return $parsed_xml;
}else{
return "";
}
}