I don't know if the problem is my windows firewall blocking my return request.
I just got Windows 8 touch and I can't figure out how to disable it as administrator.
I also just installed WAMP. I got apache & php to run. I checked in services and phpinfo.
So that checks.
This is the error I get when I hit the page in www.
asXML(); $parsed_xml = simplexml_load_string($request); print_r($parsed_xml); $xml = new SimpleXmlElement($parsed_xml); if (strpos($request,ERROR) === false){ $result= $parsed_xml->item->title; $title= (string) $result; echo $title; }else{ $request=substr($request,strpos($request,'Errors', (strlen($request)-strpos($request,'Errors')))); echo $request . "
"; }
If someone else can run this html page to see if it is the firewall?
I don't mind sharing my appid since this is just a test case to see if I can get it to work.
I am trying to output the xml object to see if it got any find results.
It seems not. The only part of the request that might be wrong is the product ID.
I can't figure out how to set the line where type=UPC in correct syntax but I don't know how to error check this.
Thanks very much in advance,
<?php
define("ERROR", "Error");
$appId= "JanisRou-b4e2-4c47-b077-ce74c0383c9b"
// the productId is a type field can be used to get the contents of the UPC field
$productId = '753759077600';
$allparameter =
"OPERATION-NAME" ."=". "findItemsByProduct" ."&".
"SECURITY-APPNAME" ."=". $appId ."&".
"GLOBAL-ID" ."=". "EBAY-US" ."&".
"SERVICE-VERSION" ."=". "1.0.0" ."&".
"RESPONSE-DATA-FORMAT" ."=". "XML" ."&".
"REST-PAYLOAD" ."&".
"productId":{@type":"UPC","__value__":"753759077600"}
;
$request = file_get_contents("http://svcs.sandbox.ebay.com/services/search/FindingService/v1?".$allparameter);
echo $request->asXML();
$parsed_xml = simplexml_load_string($request);
print_r($parsed_xml);
$xml = new SimpleXmlElement($parsed_xml);
if (strpos($request,ERROR) === false){
$result= $parsed_xml->item->title;
$title= (string) $result;
echo $title;
}else{
$request=substr($request,strpos($request,'Errors', (strlen($request)-strpos($request,'Errors'))));
echo $request . "<br/>";
}
in case you need to see the format of the xml response object I don't know if it helps but this is the structure from ebay.
<?xml version="1.0" encoding="utf-8"?>
<findItemsByProductResponse xmlns:ms="http://www.ebay.com/marketplace/services"
xmlns="http://www.ebay.com/marketplace/search/v1/services">
<ack>Success</ack>
<version>1.0.0</version>
<timestamp>2009-09-10T00:54:12.443Z</timestamp>
<searchResult count="2">
<item>
<itemId>180404288689</itemId>
<title>The Little Mermaid DVD Disney Platinum Special Edition</title>
<globalId>EBAY-US</globalId>
<primaryCategory>
<categoryId>617</categoryId>
<categoryName>DVD, HD DVD & Blu-ray</categoryName>
</primaryCategory>
<galleryURL>
http://thumbs2.ebaystatic.com/pict/1804042886898080_1.jpg</galleryURL>
<viewItemURL>http://cgi.ebay.com/The-Little-Mermaid-DVD-Disney-Platinum-Special-
Edition_W0QQitemZ180404288689QQcmdZViewItemQQptZUS_DVD_HD_DVD_Blu_ray?hash=
item2a00eefcb1</viewItemURL>
<productId type="ReferenceID">53039031</productId>
<paymentMethod>PayPal</paymentMethod>
<autoPay>false</autoPay>
<postalCode>19135</postalCode>
<location>Philadelphia,PA,USA</location>
<country>US</country>
<shippingInfo>
<shippingServiceCost currencyId="USD">0.0</shippingServiceCost>
<shippingType>Free</shippingType>
<shipToLocations>US</shipToLocations>
</shippingInfo>
<sellingStatus>
<currentPrice currencyId="USD">15.5</currentPrice>
<convertedCurrentPrice currencyId="USD">15.5</convertedCurrentPrice>
<bidCount>4</bidCount>
<sellingState>Active</sellingState>
<timeLeft>P0DT2H59M5S</timeLeft>
</sellingStatus>
<listingInfo>
<bestOfferEnabled>false</bestOfferEnabled>
<buyItNowAvailable>false</buyItNowAvailable>
<startTime>2009-09-05T03:53:17.000Z</startTime>
<endTime>2009-09-10T03:53:17.000Z</endTime>
<listingType>Auction</listingType>
<gift>false</gift>
</listingInfo>
</item>
<item>
<itemId>310166249754</itemId>
<title>SEALED WALT DISNEY THE LITTLE MERMAID PLATINUM EDITION</title>
<globalId>EBAY-US</globalId>
<primaryCategory>
<categoryId>617</categoryId>
<categoryName>DVD, HD DVD & Blu-ray</categoryName>
</primaryCategory>
<galleryURL>
http://thumbs1.ebaystatic.com/pict/3101662497548080_1.jpg</galleryURL>
<viewItemURL>http://cgi.ebay.com/SEALED-WALT-DISNEY-THE-LITTLE-MERMAID-PLATINUM-
EDITION_W0QQitemZ310166249754QQcmdZViewItemQQptZUS_DVD_HD_DVD_Blu_ray?hash=
item483759611a</viewItemURL>
<productId type="ReferenceID">53039031</productId>
<paymentMethod>PayPal</paymentMethod>
<autoPay>false</autoPay>
<location>USA</location>
<country>US</country>
<shippingInfo>
<shippingServiceCost currencyId="USD">0.0</shippingServiceCost>
<shippingType>Free</shippingType>
<shipToLocations>US</shipToLocations>
</shippingInfo>
<sellingStatus>
<currentPrice currencyId="USD">13.5</currentPrice>
<convertedCurrentPrice currencyId="USD">13.5</convertedCurrentPrice>
<bidCount>8</bidCount>
<sellingState>Active</sellingState>
<timeLeft>P0DT23H42M34S</timeLeft>
</sellingStatus>
<listingInfo>
<bestOfferEnabled>false</bestOfferEnabled>
<buyItNowAvailable>false</buyItNowAvailable>
<startTime>2009-09-04T00:36:46.000Z</startTime>
<endTime>2009-09-11T00:36:46.000Z</endTime>
<listingType>Auction</listingType>
<gift>false</gift>
</listingInfo>
</item>
</searchResult>
<paginationOutput>
<totalPages>50</totalPages>
<totalEntries>99</totalEntries>
<pageNumber>1</pageNumber>
<entriesPerPage>2</entriesPerPage>
</paginationOutput>
</findItemsByProductResponse>
[/xml]