本文整理汇总了PHP中MarketplaceWebService_Interface::getReport方法的典型用法代码示例。如果您正苦于以下问题:PHP MarketplaceWebService_Interface::getReport方法的具体用法?PHP MarketplaceWebService_Interface::getReport怎么用?PHP MarketplaceWebService_Interface::getReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarketplaceWebService_Interface
的用法示例。
在下文中一共展示了MarketplaceWebService_Interface::getReport方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invokeGetReport
function invokeGetReport(MarketplaceWebService_Interface $service, $request)
{
try {
$response = $service->getReport($request);
return stream_get_contents($request->getReport());
} catch (MarketplaceWebService_Exception $ex) {
$message = 'MWS Report 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;
$this->generate_log($param);
}
}
示例2: invokeGetReport
/**
* Get Report Action Sample
* The GetReport operation returns the contents of a report. Reports can potentially be
* very large (>100MB) which is why we only return one report at a time, and in a
* streaming fashion.
*
* @param MarketplaceWebService_Interface $service instance of MarketplaceWebService_Interface
* @param mixed $request MarketplaceWebService_Model_GetReport or array of parameters
*/
function invokeGetReport(MarketplaceWebService_Interface $service, $request)
{
try {
$response = $service->getReport($request);
echo "Service Response\n";
echo "=============================================================================\n";
echo " GetReportResponse\n";
if ($response->isSetGetReportResult()) {
$getReportResult = $response->getGetReportResult();
echo " GetReport";
if ($getReportResult->isSetContentMd5()) {
echo " ContentMd5";
echo " " . $getReportResult->getContentMd5() . "\n";
}
}
if ($response->isSetResponseMetadata()) {
echo " ResponseMetadata\n";
$responseMetadata = $response->getResponseMetadata();
if ($responseMetadata->isSetRequestId()) {
echo " RequestId\n";
echo " " . $responseMetadata->getRequestId() . "\n";
}
}
echo " Report Contents\n";
echo stream_get_contents($request->getReport()) . "\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";
}
}
示例3: invokeGetReport
/**
* Get Report Action Sample
* The GetReport operation returns the contents of a report. Reports can potentially be
* very large (>100MB) which is why we only return one report at a time, and in a
* streaming fashion.
*
* @param MarketplaceWebService_Interface $service instance of MarketplaceWebService_Interface
* @param mixed $request MarketplaceWebService_Model_GetReport or array of parameters
*/
function invokeGetReport(MarketplaceWebService_Interface $service, $request)
{
global $reportId;
try {
$response = $service->getReport($request);
echo "Service Response\n";
echo "=============================================================================\n";
echo " GetReportResponse\n";
if ($response->isSetGetReportResult()) {
$getReportResult = $response->getGetReportResult();
echo " GetReport";
if ($getReportResult->isSetContentMd5()) {
echo " ContentMd5";
echo " " . $getReportResult->getContentMd5() . "\n";
}
}
if ($response->isSetResponseMetadata()) {
echo " ResponseMetadata\n";
$responseMetadata = $response->getResponseMetadata();
if ($responseMetadata->isSetRequestId()) {
echo " RequestId\n";
echo " " . $responseMetadata->getRequestId() . "\n";
}
}
echo " Report Contents\n";
// echo (stream_get_contents($request->getReport()) . "\n");
file_put_contents('/tmp/_GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_' . $reportId . '.txt', stream_get_contents($request->getReport()));
} 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";
}
}
示例4: Get_Report
/**
* Retrieves and return the actual report.
*
* @param MarketplaceWebService_Interface $service instance of MarketplaceWebService_Interface
* @param mixed $request MarketplaceWebService_Model_GetReport or array of parameters
* @return string
*/
function Get_Report(MarketplaceWebService_Interface $Service, $Request)
{
try {
$Res = $Service->getReport($Request);
if ($Res->isSetGetReportResult()) {
$Res = $Res->getGetReportResult();
if ($Res->isSetContentMd5()) {
$Res->getContentMd5();
}
}
return stream_get_contents($Request->getReport());
} catch (MarketplaceWebService_Exception $ex) {
echo <<<OutEx
<pre>
Function: Get_Report ()
Caught Exception: {$ex->getMessage()}
Response Status Code: {$ex->getStatusCode()}
Error Code: {$ex->getErrorCode()}
Error Type: {$ex->getErrorType()}
Request ID: {$ex->getRequestId()}
XML: {$ex->getXML()}
ResponseHeaderMetadata: {$ex->getResponseHeaderMetadata()}
OutEx;
die;
}
}