* Uncomment to try out Mock Service that simulates FBAOutboundServiceMWS
 * responses without calling FBAOutboundServiceMWS service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under FBAOutboundServiceMWS/Mock tree
 *
 ***********************************************************************/
// $service = new FBAOutboundServiceMWS_Mock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Get Fulfillment Preview Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as FBAOutboundServiceMWS_Model_GetFulfillmentPreview
$request = new FBAOutboundServiceMWS_Model_GetFulfillmentPreviewRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetFulfillmentPreview($service, $request);
/**
 * Get Get Fulfillment Preview Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param FBAOutboundServiceMWS_Interface $service instance of FBAOutboundServiceMWS_Interface
 * @param mixed $request FBAOutboundServiceMWS_Model_GetFulfillmentPreview or array of parameters
 */
function invokeGetFulfillmentPreview(FBAOutboundServiceMWS_Interface $service, $request)
{
    try {
        $response = $service->GetFulfillmentPreview($request);
示例#2
0
 /**
  * Get Fulfillment Preview
  * Get estimated shipping dates and fees for all
  *   available shipping speed given a set of seller SKUs and quantities
  *
  *   If "ShippingSpeedCategories" are inputed, only previews for those options will be returned.
  *
  *   If "ShippingSpeedCategories" are not inputed, then previews for all available options
  *   are returned.
  *
  *   The service will return the fulfillment estimates for a set of Seller
  *   SKUs and quantities.
  *
  * @param mixed $request array of parameters for FBAOutboundServiceMWS_Model_GetFulfillmentPreview request or FBAOutboundServiceMWS_Model_GetFulfillmentPreview object itself
  * @see FBAOutboundServiceMWS_Model_GetFulfillmentPreviewRequest
  * @return FBAOutboundServiceMWS_Model_GetFulfillmentPreviewResponse
  *
  * @throws FBAOutboundServiceMWS_Exception
  */
 public function getFulfillmentPreview($request)
 {
     if (!$request instanceof FBAOutboundServiceMWS_Model_GetFulfillmentPreviewRequest) {
         $request = new FBAOutboundServiceMWS_Model_GetFulfillmentPreviewRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetFulfillmentPreview';
     $httpResponse = $this->_invoke($parameters);
     $response = FBAOutboundServiceMWS_Model_GetFulfillmentPreviewResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }