function invokeGetMyCategoryForSKU(MarketplaceWebServiceProducts_Interface $service, $request) { try { $response = $service->GetProductCategoriesForSKU($request); $dom = new DOMDocument(); $dom->loadXML($response->toXML()); $arrResult = xml_to_array($dom); return $arrResult; } catch (MarketplaceWebServiceProducts_Exception $ex) { // echo("Caught Exception: " . $ex->getMessage() . "\n"); // echo("Response Status Code: " . $ex->getStatusCode() . "\n"); // echo("Error Code: " . $ex->getErrorCode() . "\n"); // echo("Error Type: " . $ex->getErrorType() . "\n"); // echo("Request ID: " . $ex->getRequestId() . "\n"); // echo("XML: " . $ex->getXML() . "\n"); // echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n"); return 0; } }
/** * Get Get Product Categories For SKU Action Sample * Gets competitive pricing and related information for a product identified by * the MarketplaceId and ASIN. * * @param MarketplaceWebServiceProducts_Interface $service instance of MarketplaceWebServiceProducts_Interface * @param mixed $request MarketplaceWebServiceProducts_Model_GetProductCategoriesForSKU or array of parameters */ function invokeGetProductCategoriesForSKU(MarketplaceWebServiceProducts_Interface $service, $request) { try { $response = $service->GetProductCategoriesForSKU($request); echo "Service Response\n"; echo "=============================================================================\n"; $dom = new DOMDocument(); $dom->loadXML($response->toXML()); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; echo $dom->saveXML(); echo "ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n"; } catch (MarketplaceWebServiceProducts_Exception $ex) { echo "Caught Exception: " . $ex->getMessage() . "\n"; echo "Response Status Code: " . $ex->getStatusCode() . "\n"; echo "Error Code: " . $ex->getErrorCode() . "\n"; echo "Error Type: " . $ex->getErrorType() . "\n"; echo "Request ID: " . $ex->getRequestId() . "\n"; echo "XML: " . $ex->getXML() . "\n"; echo "ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n"; } }