* 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 List Matching Products Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as ListMatchingProducts
$request = new 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 MwsProductsInterface $service instance of MwsProductsInterface
 * @param mixed                                   $request ListMatchingProducts or array of parameters
 */
function invokeListMatchingProducts(MwsProductsInterface $service, $request)
{
    try {
        $response = $service->ListMatchingProducts($request);
Пример #2
0
 /**
  * List Matching Products
  * ListMatchingProducts can be used to
  * find products that match the given criteria.
  *
  * @param mixed $request array of parameters for ListMatchingProducts request or ListMatchingProducts object itself
  *
  * @see ListMatchingProductsRequest
  * @return Model\ListMatchingProductsResponse
  *
  * @throws MwsProductsException
  */
 public function listMatchingProducts($request)
 {
     if (!$request instanceof Model\ListMatchingProductsRequest) {
         $request = new Model\ListMatchingProductsRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'ListMatchingProducts';
     $httpResponse = $this->_invoke($parameters);
     $response = Model\ListMatchingProductsResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }