/** * List Matching Products * ListMatchingProducts can be used to * find products that match the given criteria. * * @param mixed $request array of parameters for MarketplaceWebServiceProducts_Model_ListMatchingProducts request or MarketplaceWebServiceProducts_Model_ListMatchingProducts object itself * @see MarketplaceWebServiceProducts_Model_ListMatchingProductsRequest * @return MarketplaceWebServiceProducts_Model_ListMatchingProductsResponse * * @throws MarketplaceWebServiceProducts_Exception */ public function listMatchingProducts($request) { if (!$request instanceof MarketplaceWebServiceProducts_Model_ListMatchingProductsRequest) { require_once dirname(__FILE__) . '/Model/ListMatchingProductsRequest.php'; $request = new MarketplaceWebServiceProducts_Model_ListMatchingProductsRequest($request); } $parameters = $request->toQueryParameterArray(); $parameters['Action'] = 'ListMatchingProducts'; $httpResponse = $this->_invoke($parameters); require_once dirname(__FILE__) . '/Model/ListMatchingProductsResponse.php'; $response = MarketplaceWebServiceProducts_Model_ListMatchingProductsResponse::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 MarketplaceWebServiceProducts_Mock(); /************************************************************************ * Setup request parameters and uncomment invoke to try out * sample for List Matching Products Action ***********************************************************************/ // @TODO: set request. Action can be passed as MarketplaceWebServiceProducts_Model_ListMatchingProducts $request = new MarketplaceWebServiceProducts_Model_ListMatchingProductsRequest(); $request->setSellerId(MERCHANT_ID); // object or array of parameters invokeListMatchingProducts($service, $request); /** * Get List Matching Products 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_ListMatchingProducts or array of parameters */ function invokeListMatchingProducts(MarketplaceWebServiceProducts_Interface $service, $request) { try { $response = $service->ListMatchingProducts($request);
* 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 MarketplaceWebServiceProducts_Mock(); /************************************************************************ * Setup request parameters and uncomment invoke to try out * sample for List Matching Products Action ***********************************************************************/ // @TODO: set request. Action can be passed as MarketplaceWebServiceProducts_Model_ListMatchingProducts $request = new MarketplaceWebServiceProducts_Model_ListMatchingProductsRequest(); $request->setSellerId(MERCHANT_ID); /* Naren - starts */ $request->setMarketplaceId(MARKETPLACE_ID); $request->setQuery("baby powder"); /* Naren - starts */ // object or array of parameters invokeListMatchingProducts($service, $request); /** * Get List Matching Products 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_ListMatchingProducts or array of parameters */