* 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 Get My Price For ASIN Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as MarketplaceWebServiceProducts_Model_GetMyPriceForASIN
$request = new MarketplaceWebServiceProducts_Model_GetMyPriceForASINRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetMyPriceForASIN($service, $request);
/**
 * Get Get My Price For ASIN 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_GetMyPriceForASIN or array of parameters
 */
function invokeGetMyPriceForASIN(MarketplaceWebServiceProducts_Interface $service, $request)
{
    try {
        $response = $service->GetMyPriceForASIN($request);
Esempio n. 2
0
 /**
  * Get My Price For ASIN
  * <!-- Wrong doc in current code -->
  *
  * @param mixed $request array of parameters for MarketplaceWebServiceProducts_Model_GetMyPriceForASIN request or MarketplaceWebServiceProducts_Model_GetMyPriceForASIN object itself
  * @see MarketplaceWebServiceProducts_Model_GetMyPriceForASINRequest
  * @return MarketplaceWebServiceProducts_Model_GetMyPriceForASINResponse
  *
  * @throws MarketplaceWebServiceProducts_Exception
  */
 public function getMyPriceForASIN($request)
 {
     if (!$request instanceof MarketplaceWebServiceProducts_Model_GetMyPriceForASINRequest) {
         require_once dirname(__FILE__) . '/Model/GetMyPriceForASINRequest.php';
         $request = new MarketplaceWebServiceProducts_Model_GetMyPriceForASINRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetMyPriceForASIN';
     $httpResponse = $this->_invoke($parameters);
     require_once dirname(__FILE__) . '/Model/GetMyPriceForASINResponse.php';
     $response = MarketplaceWebServiceProducts_Model_GetMyPriceForASINResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }