* 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 Matching Product Action ***********************************************************************/ // @TODO: set request. Action can be passed as GetMatchingProduct $request = new GetMatchingProductRequest(); $request->setSellerId(MERCHANT_ID); // object or array of parameters invokeGetMatchingProduct($service, $request); /** * Get Get Matching Product 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 GetMatchingProduct or array of parameters */ function invokeGetMatchingProduct(MwsProductsInterface $service, $request) { try { $response = $service->GetMatchingProduct($request);
/** * Get Matching Product * GetMatchingProduct will return the details (attributes) for the * given ASIN. * * @param mixed $request array of parameters for GetMatchingProduct request or GetMatchingProduct object itself * * @see GetMatchingProductRequest * @return Model\GetMatchingProductResponse * * @throws MwsProductsException */ public function getMatchingProduct($request) { if (!$request instanceof Model\GetMatchingProductRequest) { $request = new Model\GetMatchingProductRequest($request); } $parameters = $request->toQueryParameterArray(); $parameters['Action'] = 'GetMatchingProduct'; $httpResponse = $this->_invoke($parameters); $response = Model\GetMatchingProductResponse::fromXML($httpResponse['ResponseBody']); $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']); return $response; }