Ejemplo n.º 1
0
 /**
  * Get Customers By Customer Id
  * Returns customer information for
  *         one or more customers, given a seller-directed customer ID.
  *         There is a maximum number of customer IDs supported per request.
  *         See service documentation for that limit.
  *
  * @param mixed $request array of parameters for MWSCustomerService_Model_GetCustomersByCustomerId request or MWSCustomerService_Model_GetCustomersByCustomerId object itself
  * @see MWSCustomerService_Model_GetCustomersByCustomerIdRequest
  * @return MWSCustomerService_Model_GetCustomersByCustomerIdResponse
  *
  * @throws Customer_Exception
  */
 public function getCustomersByCustomerId($request)
 {
     if (!$request instanceof Model\MWSCustomerService_Model_GetCustomersByCustomerIdRequest) {
         //require_once (dirname(__FILE__) . '/Model/GetCustomersByCustomerIdRequest.php');
         $request = new MWSCustomerService_Model_GetCustomersByCustomerIdRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetCustomersByCustomerId';
     $httpResponse = $this->_invoke($parameters);
     //require_once (dirname(__FILE__) . '/Model/GetCustomersByCustomerIdResponse.php');
     $response = Model\MWSCustomerService_Model_GetCustomersByCustomerIdResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
 * Uncomment to try out Mock Service that simulates MWSCustomerService
 * responses without calling MWSCustomerService service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under MWSCustomerService/Mock tree
 *
 ***********************************************************************/
// $service = new MWSCustomerService_Mock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Get Customers By Customer Id Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as MWSCustomerService_Model_GetCustomersByCustomerId
$request = new MWSCustomerService_Model_GetCustomersByCustomerIdRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetCustomersByCustomerId($service, $request);
/**
 * Get Get Customers By Customer Id Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param MWSCustomerService_Interface $service instance of MWSCustomerService_Interface
 * @param mixed $request MWSCustomerService_Model_GetCustomersByCustomerId or array of parameters
 */
function invokeGetCustomersByCustomerId(MWSCustomerService_Interface $service, $request)
{
    try {
        $response = $service->GetCustomersByCustomerId($request);