* 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 MWSRecommendationsSectionService_Model_ListRecommendations $request = new MWSRecommendationsSectionService_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 MWSRecommendationsSectionService_Model_ListRecommendations or array of parameters */ function invokeListRecommendations(MWSRecommendationsSectionService_Interface $service, $request) { try { $response = $service->ListRecommendations($request);
/** * List Recommendations * Retrieving first batch of recommendations. * * @param mixed $request array of parameters for MWSRecommendationsSectionService_Model_ListRecommendations request or MWSRecommendationsSectionService_Model_ListRecommendations object itself * @see MWSRecommendationsSectionService_Model_ListRecommendationsRequest * @return MWSRecommendationsSectionService_Model_ListRecommendationsResponse * * @throws MWSRecommendationsSectionService_Exception */ public function listRecommendations($request) { if (!$request instanceof MWSRecommendationsSectionService_Model_ListRecommendationsRequest) { require_once dirname(__FILE__) . '/Model/ListRecommendationsRequest.php'; $request = new MWSRecommendationsSectionService_Model_ListRecommendationsRequest($request); } $parameters = $request->toQueryParameterArray(); $parameters['Action'] = 'ListRecommendations'; $httpResponse = $this->_invoke($parameters); require_once dirname(__FILE__) . '/Model/ListRecommendationsResponse.php'; $response = MWSRecommendationsSectionService_Model_ListRecommendationsResponse::fromXML($httpResponse['ResponseBody']); $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']); return $response; }