/** * List Recommendations * Retrieving first batch of recommendations. * * @param mixed $request array of parameters for MWSRecommendations_Model_ListRecommendations request or MWSRecommendations_Model_ListRecommendations object itself * @see MWSRecommendations_Model_ListRecommendationsRequest * @return MWSRecommendations_Model_ListRecommendationsResponse * * @throws Recommendations_Exception */ public function listRecommendations($request) { if (!$request instanceof Model\MWSRecommendations_Model_ListRecommendationsRequest) { //require_once (dirname(__FILE__) . '/Model/ListRecommendationsRequest.php'); $request = new MWSRecommendations_Model_ListRecommendationsRequest($request); } $parameters = $request->toQueryParameterArray(); $parameters['Action'] = 'ListRecommendations'; $httpResponse = $this->_invoke($parameters); //require_once (dirname(__FILE__) . '/Model/ListRecommendationsResponse.php'); $response = Model\MWSRecommendations_Model_ListRecommendationsResponse::fromXML($httpResponse['ResponseBody']); $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']); return $response; }
* Uncomment to try out Mock Service that simulates MWSRecommendationsSectionService * responses without calling MWSRecommendationsSectionService service. * * Responses are loaded from local XML files. You can tweak XML files to * experiment with various outputs during development * * XML files available under MWSRecommendationsSectionService/Mock tree * ***********************************************************************/ // $service = new MWSRecommendationsSectionService_Mock(); /************************************************************************ * Setup request parameters and uncomment invoke to try out * sample for List Recommendations Action ***********************************************************************/ // @TODO: set request. Action can be passed as MWSRecommendations_Model_ListRecommendations $request = new MWSRecommendations_Model_ListRecommendationsRequest(); $request->setSellerId(MERCHANT_ID); // object or array of parameters invokeListRecommendations($service, $request); /** * Get List Recommendations Action Sample * Gets competitive pricing and related information for a product identified by * the MarketplaceId and ASIN. * * @param MWSRecommendationsSectionService_Interface $service instance of MWSRecommendationsSectionService_Interface * @param mixed $request MWSRecommendations_Model_ListRecommendations or array of parameters */ function invokeListRecommendations(MWSRecommendationsSectionService_Interface $service, $request) { try { $response = $service->ListRecommendations($request);