Пример #1
0
 /**
  * Get Bill Of Lading
  * Retrieves the PDF-formatted BOL data for a partnered LTL shipment.
  *     This PDF data will be ZIP'd and then it will be encoded as a Base64 string, and a
  *     MD5 hash is included with the response to validate the BOL data which will be encoded as Base64.
  *
  * @param mixed $request array of parameters for FBAInboundServiceMWS_Model_GetBillOfLading request or FBAInboundServiceMWS_Model_GetBillOfLading object itself
  * @see FBAInboundServiceMWS_Model_GetBillOfLadingRequest
  * @return FBAInboundServiceMWS_Model_GetBillOfLadingResponse
  *
  * @throws FBAInboundServiceMWS_Exception
  */
 public function getBillOfLading($request)
 {
     if (!$request instanceof FBAInboundServiceMWS_Model_GetBillOfLadingRequest) {
         $request = new FBAInboundServiceMWS_Model_GetBillOfLadingRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetBillOfLading';
     $httpResponse = $this->_invoke($parameters);
     $response = FBAInboundServiceMWS_Model_GetBillOfLadingResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
 /**
  * Get Bill Of Lading
  * Retrieves the PDF-formatted BOL data for a partnered LTL shipment.
  *     This PDF data will be ZIP'd and then it will be encoded as a Base64 string, and a
  *     MD5 hash is included with the response to validate the BOL data which will be encoded as Base64.
  *
  * @param mixed $request array of parameters for FBAInboundServiceMWS_Model_GetBillOfLading request or FBAInboundServiceMWS_Model_GetBillOfLading object itself
  * @see FBAInboundServiceMWS_Model_GetBillOfLadingRequest
  * @return FBAInboundServiceMWS_Model_GetBillOfLadingResponse
  *
  * @throws FbaInbound_Exception
  */
 public function getBillOfLading($request)
 {
     if (!$request instanceof Model\FBAInboundServiceMWS_Model_GetBillOfLadingRequest) {
         //require_once (dirname(__FILE__) . '/Model/GetBillOfLadingRequest.php');
         $request = new FBAInboundServiceMWS_Model_GetBillOfLadingRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetBillOfLading';
     $httpResponse = $this->_invoke($parameters);
     //require_once (dirname(__FILE__) . '/Model/GetBillOfLadingResponse.php');
     $response = Model\FBAInboundServiceMWS_Model_GetBillOfLadingResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
 * Uncomment to try out Mock Service that simulates FBAInboundServiceMWS
 * responses without calling FBAInboundServiceMWS service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under FBAInboundServiceMWS/Mock tree
 *
 ***********************************************************************/
// $service = new FBAInboundServiceMWS_Mock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Get Bill Of Lading Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as FBAInboundServiceMWS_Model_GetBillOfLading
$request = new FBAInboundServiceMWS_Model_GetBillOfLadingRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetBillOfLading($service, $request);
/**
 * Get Get Bill Of Lading Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param FBAInboundServiceMWS_Interface $service instance of FBAInboundServiceMWS_Interface
 * @param mixed $request FBAInboundServiceMWS_Model_GetBillOfLading or array of parameters
 */
function invokeGetBillOfLading(FBAInboundServiceMWS_Interface $service, $request)
{
    try {
        $response = $service->GetBillOfLading($request);