* Uncomment to try out Mock Service that simulates MWSMerchantFulfillmentService
 * responses without calling MWSMerchantFulfillmentService service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under MWSMerchantFulfillmentService/Mock tree
 *
 ***********************************************************************/
// $service = new MWSMerchantFulfillmentService_Mock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Get Shipment Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as MWSMerchantFulfillmentService_Model_GetShipment
$request = new MWSMerchantFulfillmentService_Model_GetShipmentRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetShipment($service, $request);
/**
 * Get Get Shipment Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param MWSMerchantFulfillmentService_Interface $service instance of MWSMerchantFulfillmentService_Interface
 * @param mixed $request MWSMerchantFulfillmentService_Model_GetShipment or array of parameters
 */
function invokeGetShipment(MWSMerchantFulfillmentService_Interface $service, $request)
{
    try {
        $response = $service->GetShipment($request);
예제 #2
0
 /**
  * Get Shipment
  * Gets an existing shipment, including the label status, label content, shipping information.
  *
  * @param mixed $request array of parameters for MWSMerchantFulfillmentService_Model_GetShipment request or MWSMerchantFulfillmentService_Model_GetShipment object itself
  * @see MWSMerchantFulfillmentService_Model_GetShipmentRequest
  * @return MWSMerchantFulfillmentService_Model_GetShipmentResponse
  *
  * @throws MWSMerchantFulfillmentService_Exception
  */
 public function getShipment($request)
 {
     if (!$request instanceof MWSMerchantFulfillmentService_Model_GetShipmentRequest) {
         require_once dirname(__FILE__) . '/Model/GetShipmentRequest.php';
         $request = new MWSMerchantFulfillmentService_Model_GetShipmentRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetShipment';
     $httpResponse = $this->_invoke($parameters);
     require_once dirname(__FILE__) . '/Model/GetShipmentResponse.php';
     $response = MWSMerchantFulfillmentService_Model_GetShipmentResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }