Exemple #1
0
 public function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
 {
     try {
         $response = $service->submitFeed($request);
         if ($response->isSetSubmitFeedResult()) {
             echo "<p>SubmitFeedResult</p>\n";
             $submitFeedResult = $response->getSubmitFeedResult();
             if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                 $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                 if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                     echo "<p>FeedSubmissionId:\n";
                     echo " " . $feedSubmissionInfo->getFeedSubmissionId() . "</p>\n";
                 }
                 if ($feedSubmissionInfo->isSetFeedType()) {
                     echo "<p>FeedType:\n";
                     echo " " . $feedSubmissionInfo->getFeedType() . "</p>\n";
                 }
                 if ($feedSubmissionInfo->isSetSubmittedDate()) {
                     echo "<p>SubmittedDate:\n";
                     echo " " . $feedSubmissionInfo->getSubmittedDate()->format(DATE_FORMAT) . "</p>\n";
                 }
                 if ($feedSubmissionInfo->isSetFeedProcessingStatus()) {
                     echo "<p>FeedProcessingStatus:\n";
                     echo " " . $feedSubmissionInfo->getFeedProcessingStatus() . "</p>\n";
                 }
                 if ($feedSubmissionInfo->isSetStartedProcessingDate()) {
                     echo "<p>StartedProcessingDate\n";
                     echo " " . $feedSubmissionInfo->getStartedProcessingDate()->format(DATE_FORMAT) . "</p>\n";
                 }
                 if ($feedSubmissionInfo->isSetCompletedProcessingDate()) {
                     echo "<p>CompletedProcessingDate\n";
                     echo " " . $feedSubmissionInfo->getCompletedProcessingDate()->format(DATE_FORMAT) . "</p>\n";
                 }
             }
         }
     } catch (MarketplaceWebService_Exception $ex) {
         echo "Caught Exception: " . $ex->getMessage() . "\n";
         echo "Response Status Code: " . $ex->getStatusCode() . "\n";
         echo "Error Code: " . $ex->getErrorCode() . "\n";
         echo "Error Type: " . $ex->getErrorType() . "\n";
         echo "Request ID: " . $ex->getRequestId() . "\n";
         echo "XML: " . $ex->getXML() . "\n";
     }
 }
function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
{
    try {
        $response = $service->submitFeed($request);
        //file_put_contents('d:/public.txt',$response);
        //echo ("Service Response\n");
        //echo ("=============================================================================\n");
        //echo ("        SubmitFeedResponse\n");
        if ($response->isSetSubmitFeedResult()) {
            //echo ("            SubmitFeedResult\n");
            $submitFeedResult = $response->getSubmitFeedResult();
            if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                //echo ("                FeedSubmissionInfo\n");
                $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
            }
        }
        return $feedSubmissionInfo->getFeedSubmissionId();
    } catch (MarketplaceWebService_Exception $ex) {
        $str = "Caught Exception: " . $ex->getMessage() . "\r\n" . "Response Status Code: " . $ex->getStatusCode() . "\r\n" . "Error Code: " . $ex->getErrorCode() . "\r\n" . "Error Type: " . $ex->getErrorType() . "\r\n" . "Request ID: " . $ex->getRequestId() . "\r\n" . "XML: " . $ex->getXML() . "\r\n" . "ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\r\n";
        errorLog($str, 'N');
    }
}
Exemple #3
0
function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
{
    try {
        $response = $service->submitFeed($request);
        if ($response->isSetSubmitFeedResult()) {
            $submitFeedResult = $response->getSubmitFeedResult();
            if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                    echo "                        " . $feedSubmissionInfo->getFeedSubmissionId() . "\n";
                }
            }
        }
        echo "            ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n";
    } catch (MarketplaceWebService_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
        echo "ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n";
    }
}
 private function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
 {
     $feedSubmissionId = null;
     try {
         $response = $service->submitFeed($request);
         echo "Service Response\n";
         echo "=============================================================================\n";
         echo "        SubmitFeedResponse\n";
         if ($response->isSetSubmitFeedResult()) {
             echo "            SubmitFeedResult\n";
             $submitFeedResult = $response->getSubmitFeedResult();
             if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                 echo "                FeedSubmissionInfo\n";
                 $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                 if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                     echo "                    FeedSubmissionId\n";
                     echo "                        " . $feedSubmissionInfo->getFeedSubmissionId() . "\n";
                     $feedSubmissionId = $feedSubmissionInfo->getFeedSubmissionId();
                 }
                 if ($feedSubmissionInfo->isSetFeedType()) {
                     echo "                    FeedType\n";
                     echo "                        " . $feedSubmissionInfo->getFeedType() . "\n";
                 }
                 if ($feedSubmissionInfo->isSetSubmittedDate()) {
                     echo "                    SubmittedDate\n";
                     echo "                        " . $feedSubmissionInfo->getSubmittedDate()->format(DATE_FORMAT) . "\n";
                 }
                 if ($feedSubmissionInfo->isSetFeedProcessingStatus()) {
                     echo "                    FeedProcessingStatus\n";
                     echo "                        " . $feedSubmissionInfo->getFeedProcessingStatus() . "\n";
                 }
                 if ($feedSubmissionInfo->isSetStartedProcessingDate()) {
                     echo "                    StartedProcessingDate\n";
                     echo "                        " . $feedSubmissionInfo->getStartedProcessingDate()->format(DATE_FORMAT) . "\n";
                 }
                 if ($feedSubmissionInfo->isSetCompletedProcessingDate()) {
                     echo "                    CompletedProcessingDate\n";
                     echo "                        " . $feedSubmissionInfo->getCompletedProcessingDate()->format(DATE_FORMAT) . "\n";
                 }
             }
         }
         if ($response->isSetResponseMetadata()) {
             echo "            ResponseMetadata\n";
             $responseMetadata = $response->getResponseMetadata();
             if ($responseMetadata->isSetRequestId()) {
                 echo "                RequestId\n";
                 echo "                    " . $responseMetadata->getRequestId() . "\n";
             }
         }
         echo "            ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n";
     } catch (MarketplaceWebService_Exception $ex) {
         echo "Caught Exception: " . $ex->getMessage() . "\n";
         echo "Response Status Code: " . $ex->getStatusCode() . "\n";
         echo "Error Code: " . $ex->getErrorCode() . "\n";
         echo "Error Type: " . $ex->getErrorType() . "\n";
         echo "Request ID: " . $ex->getRequestId() . "\n";
         echo "XML: " . $ex->getXML() . "\n";
         echo "ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n";
     }
     return $feedSubmissionId;
 }
Exemple #5
0
function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
{
    try {
        $response = $service->submitFeed($request);
        print_r($response);
        echo 'cccc';
        die;
        if ($response->isSetSubmitFeedResult()) {
            $submitFeedResult = $response->getSubmitFeedResult();
            if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                    echo "                        " . $feedSubmissionInfo->getFeedSubmissionId() . "\n";
                    $sb = "update ebay_order set ebay_markettime='{$mctime}',ShippedTime='{$mctime}' where ebay_id='{$ebay_id}'";
                    echo $sb . '<br>';
                    $dbConn->execute($sb);
                }
            }
        }
        echo "            ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n";
    } catch (MarketplaceWebService_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
        echo "ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n";
    }
}
Exemple #6
0
 function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
 {
     try {
         $response = $service->submitFeed($request);
         if ($response->isSetSubmitFeedResult()) {
             $submitFeedResult = $response->getSubmitFeedResult();
             if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                 $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                 if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                     $feedSubmissionId = $feedSubmissionInfo->getFeedSubmissionId();
                     $param['message'] = 'Order Acknowledged : Feed Submission Id - ' . $feedSubmissionId;
                     $obj = new Pwapresta();
                     $obj->generate_log($param);
                 }
             }
         }
     } catch (MarketplaceWebService_Exception $ex) {
         $message = 'MWS Feed API : Caught Exception : ' . $ex->getMessage() . "\n";
         $message .= "Response Status Code: " . $ex->getStatusCode() . "\n";
         $message .= "Error Code: " . $ex->getErrorCode() . "\n";
         $message .= "Error Type: " . $ex->getErrorType() . "\n";
         $param['message'] = $message;
         $obj = new Pwapresta();
         $obj->generate_log($param);
     }
 }
Exemple #7
0
function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request, $ebay_id)
{
    global $dbcon, $mctime;
    try {
        $response = $service->submitFeed($request);
        if ($response->isSetSubmitFeedResult()) {
            $submitFeedResult = $response->getSubmitFeedResult();
            if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                    echo "                        " . $feedSubmissionInfo->getFeedSubmissionId() . "\n";
                    $sb = "update ebay_order set ebay_markettime='{$mctime}',ShippedTime='{$mctime}' where ebay_id='{$ebay_id}'";
                    echo '订单编号: ' . $ebay_id . ' 标记发出成功到amazon' . '<br>';
                    $dbcon->execute($sb);
                }
            }
        }
        //   echo("            ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n");
    } catch (MarketplaceWebService_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
        echo "ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n";
    }
}
 function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
 {
     try {
         $response = $service->submitFeed($request);
         if ($response->isSetSubmitFeedResult()) {
             $submitFeedResult = $response->getSubmitFeedResult();
             if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                 $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                 if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                     $result = new stdClass();
                     $result->FeedSubmissionId = $feedSubmissionInfo->getFeedSubmissionId();
                     $result->FeedProcessingStatus = $feedSubmissionInfo->getFeedProcessingStatus();
                     $result->FeedType = $feedSubmissionInfo->getFeedType();
                     $result->SubmittedDate = $feedSubmissionInfo->getSubmittedDate()->format(DATE_FORMAT);
                     $result->success = true;
                     // log to db - parsed request
                     $this->dblogger->updateLog(array('result' => json_encode($result), 'success' => 'Success'));
                     return $result;
                 }
             }
         }
     } catch (MarketplaceWebService_Exception $ex) {
         $error = new stdClass();
         $error->ErrorMessage = $ex->getMessage();
         $error->ErrorCode = $ex->getErrorCode();
         $error->StatusCode = $ex->getStatusCode();
         $error->success = false;
         return $error;
     }
     $result = new stdClass();
     $result->success = false;
     return $result;
 }
/**
 * Submit Feed Action Sample
 * Uploads a file for processing together with the necessary
 * metadata to process the file, such as which type of feed it is.
 * PurgeAndReplace if true means that your existing e.g. inventory is
 * wiped out and replace with the contents of this feed - use with
 * caution (the default is false).
 *
 * @param MarketplaceWebService_Interface $service instance of MarketplaceWebService_Interface
 * @param mixed $request MarketplaceWebService_Model_SubmitFeed or array of parameters
 */
function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
{
    try {
        $response = $service->submitFeed($request);
        result("Service Response\n");
        result("=============================================================================\n");
        result("        SubmitFeedResponse\n");
        if ($response->isSetSubmitFeedResult()) {
            result("            SubmitFeedResult\n");
            $submitFeedResult = $response->getSubmitFeedResult();
            if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                result("                FeedSubmissionInfo\n");
                $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                    result("                    FeedSubmissionId\n");
                    result("                        " . $feedSubmissionInfo->getFeedSubmissionId() . "\n");
                    echo $feedSubmissionInfo->getFeedSubmissionId();
                }
                if ($feedSubmissionInfo->isSetFeedType()) {
                    result("                    FeedType\n");
                    result("                        " . $feedSubmissionInfo->getFeedType() . "\n");
                }
                if ($feedSubmissionInfo->isSetSubmittedDate()) {
                    result("                    SubmittedDate\n");
                    result("                        " . $feedSubmissionInfo->getSubmittedDate()->format(DATE_FORMAT) . "\n");
                }
                if ($feedSubmissionInfo->isSetFeedProcessingStatus()) {
                    result("                    FeedProcessingStatus\n");
                    result("                        " . $feedSubmissionInfo->getFeedProcessingStatus() . "\n");
                }
                if ($feedSubmissionInfo->isSetStartedProcessingDate()) {
                    result("                    StartedProcessingDate\n");
                    result("                        " . $feedSubmissionInfo->getStartedProcessingDate()->format(DATE_FORMAT) . "\n");
                }
                if ($feedSubmissionInfo->isSetCompletedProcessingDate()) {
                    result("                    CompletedProcessingDate\n");
                    result("                        " . $feedSubmissionInfo->getCompletedProcessingDate()->format(DATE_FORMAT) . "\n");
                }
            }
        }
        if ($response->isSetResponseMetadata()) {
            result("            ResponseMetadata\n");
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                result("                RequestId\n");
                result("                    " . $responseMetadata->getRequestId() . "\n");
            }
        }
        result("            ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n");
    } catch (MarketplaceWebService_Exception $ex) {
        result("Caught Exception: " . $ex->getMessage() . "\n");
        result("Response Status Code: " . $ex->getStatusCode() . "\n");
        result("Error Code: " . $ex->getErrorCode() . "\n");
        result("Error Type: " . $ex->getErrorType() . "\n");
        result("Request ID: " . $ex->getRequestId() . "\n");
        result("XML: " . $ex->getXML() . "\n");
        result("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n");
        echo json_encode(array('Caught Exception' => $ex->getMessage(), 'Response Status Code' => $ex->getStatusCode(), 'Error Code' => $ex->getErrorCode()));
    }
}
 /**
  * Submit Feed Action Sample
  * Uploads a file for processing together with the necessary
  * metadata to process the file, such as which type of feed it is.
  * PurgeAndReplace if true means that your existing e.g. inventory is
  * wiped out and replace with the contents of this feed - use with
  * caution (the default is false).
  *   
  * @param MarketplaceWebService_Interface $service instance of MarketplaceWebService_Interface
  * @param mixed $request MarketplaceWebService_Model_SubmitFeed or array of parameters
  * Added  to submit feeds through MWS (uses Amazon's MWS PHP SDK in magento/lib)
  */
 function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
 {
     try {
         $response = $service->submitFeed($request);
         $feedSubmissionId = null;
         if ($response->isSetSubmitFeedResult()) {
             $submitFeedResult = $response->getSubmitFeedResult();
             if ($submitFeedResult->isSetFeedSubmissionInfo()) {
                 $feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
                 if ($feedSubmissionInfo->isSetFeedSubmissionId()) {
                     $feedSubmissionId = $feedSubmissionInfo->getFeedSubmissionId();
                 }
             }
         }
     } catch (MarketplaceWebService_Exception $ex) {
         Mage::log("Caught Exception: " . $ex->getMessage() . "\n");
         Mage::log("Response Status Code: " . $ex->getStatusCode() . "\n");
         Mage::log("Error Code: " . $ex->getErrorCode() . "\n");
         Mage::log("Error Type: " . $ex->getErrorType() . "\n");
         Mage::log("Request ID: " . $ex->getRequestId() . "\n");
         Mage::log("XML: " . $ex->getXML() . "\n");
         return null;
     }
     return $feedSubmissionId;
 }