/** * Get Product Categories For SKU * Gets categories information for a product identified by * the SellerId and SKU. * * @param mixed $request array of parameters for GetProductCategoriesForSKU request or GetProductCategoriesForSKU object itself * * @see GetProductCategoriesForSKURequest * @return Model\GetProductCategoriesForSKUResponse * * @throws MwsProductsException */ public function getProductCategoriesForSKU($request) { if (!$request instanceof Model\GetProductCategoriesForSKURequest) { $request = new Model\GetProductCategoriesForSKURequest($request); } $parameters = $request->toQueryParameterArray(); $parameters['Action'] = 'GetProductCategoriesForSKU'; $httpResponse = $this->_invoke($parameters); $response = Model\GetProductCategoriesForSKUResponse::fromXML($httpResponse['ResponseBody']); $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']); return $response; }
* Uncomment to try out Mock Service that simulates MarketplaceWebServiceProducts * responses without calling MarketplaceWebServiceProducts service. * * Responses are loaded from local XML files. You can tweak XML files to * experiment with various outputs during development * * XML files available under MarketplaceWebServiceProducts/Mock tree * ***********************************************************************/ // $service = new MwsProductsMock(); /************************************************************************ * Setup request parameters and uncomment invoke to try out * sample for Get Product Categories For SKU Action ***********************************************************************/ // @TODO: set request. Action can be passed as GetProductCategoriesForSKU $request = new GetProductCategoriesForSKURequest(); $request->setSellerId(MERCHANT_ID); // object or array of parameters invokeGetProductCategoriesForSKU($service, $request); /** * Get Get Product Categories For SKU Action Sample * Gets competitive pricing and related information for a product identified by * the MarketplaceId and ASIN. * * @param MwsProductsInterface $service instance of MwsProductsInterface * @param mixed $request GetProductCategoriesForSKU or array of parameters */ function invokeGetProductCategoriesForSKU(MwsProductsInterface $service, $request) { try { $response = $service->GetProductCategoriesForSKU($request);