question

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ asked ·

I dont get any response using GetSingleItem call (PHP)

Hi. I'v used the Finding API without any problem, but today I tried to use the Shopping API by first time to get a simgle item via URL (or item number). I have this code: $resp = simplexml_load_file(" http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML≈pid=MyAppID&siteid=0&version=515&ItemID=300829232550";); But i dont get the response. The field $resp->ack or any other fields doesn't exist. But when I send this request via browter (chrome) directly i get the response immediately, just my php program fails. Here is the 'whole' program: $resp = simplexml_load_file(" http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML≈pid=MyAppID&siteid=0&version=515&ItemID=300829232550";); // Check to see if the request was successful, else print an error if ($resp->ack == "Success") { // some code } // If the response does not indicate 'Success,' print an error else { //the next line is activated but prints nothing echo $resp->ack; } ?> I hope you can help me. Thanks.
PHP
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered ·
Using an older PHP version? simplexml_load_file had problems with chunked responses. var_dump($resp) might help, or a HTTP sniffer. Best bet is to use cURL. Your call works fine here.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ answered ·
Thanks you so much, The problems were just the xml fields, I had to use uppercase letters at start of the fields ($resp->Ack), the finding api works with lowercase so I though this API too. You and the var_dump saved me. Thanks again !
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.