Amazon web services 尝试在amazon mws中注册目标时出错

Amazon web services 尝试在amazon mws中注册目标时出错,amazon-web-services,amazon-mws,Amazon Web Services,Amazon Mws,我试图获得我的产品的报价变更通知。 所以我按照文档编写代码。但它抛出了访问被拒绝的错误 我认为代码中没有任何错误。 我是否必须使用与MWS帐户相同的AWS帐户,因为目前我使用不同的MWS帐户和AWS帐户作为注册目的地 $serviceUrl = "https://mws.amazonservices.com"; $config = array( 'ServiceURL' => $serviceUrl . '/Subscriptions/2013-07-01', 'ProxyHos

我试图获得我的产品的报价变更通知。
所以我按照文档编写代码。但它抛出了访问被拒绝的错误
我认为代码中没有任何错误。
我是否必须使用与MWS帐户相同的AWS帐户,因为目前我使用不同的MWS帐户和AWS帐户作为注册目的地

 $serviceUrl = "https://mws.amazonservices.com";
 $config = array(
'ServiceURL'    => $serviceUrl . '/Subscriptions/2013-07-01',
'ProxyHost'     => null,
'ProxyPort'     => -1,
'MaxErrorRetry' => 3,
);

$chanel_data_array = get_all_chanel_keys($user_id);
foreach ($chanel_data_array as $key => $value) {
$data = [
    'marketplace_id' => 'ATVPDKIKX0DER',
    'access_key'     => $value['access_key'],
    'secret_key'     => $value['secret_key'],
    'merchant_id'    => $value['seller_id'],
    'chanel_id'      => $value['chanel_id'],
];

register_notification($data, $config);
break;
}

function createDestination($sqsUrl) {

$attribute = new MWSSubscriptionsService_Model_AttributeKeyValue;
$attribute->setKey('sqsQueueUrl');
$attribute->setValue($sqsUrl);
$attributeList = new MWSSubscriptionsService_Model_AttributeKeyValueList();
$attributeList->setmember($attribute);
$destination = new MWSSubscriptionsService_Model_Destination();
$destination->setAttributeList($attributeList);
$destination->setDeliveryChannel('SQS');
return $destination;
}

function register_notification($data, $config) {

$service = new MWSSubscriptionsService_Client(
    $data['access_key'],
    $data['secret_key'],
    APPLICATION_NAME,
    APPLICATION_VERSION,
    $config);

$request = new MWSSubscriptionsService_Model_RegisterDestinationInput();
$request->setSellerId($data['merchant_id']);
// $request->setMWSAuthToken(MWSAUTHTOKEN);
$request->setMarketplaceId($data['marketplace_id']);

$createDestination = createDestination('https://sqs.us-west-2.amazonaws.com/34aajm0916646045/product');

$request->setDestination($createDestination);
echo "<pre>";
print_r($createDestination);
echo "<br>";
invokeRegisterDestination($service, $request);
}
$serviceUrl=”https://mws.amazonservices.com";
$config=array(
“ServiceURL'=>$ServiceURL./Subscriptions/2013-07-01',
“ProxyHost”=>null,
“ProxyPort”=>-1,
“MaxErrorRetry”=>3,
);
$chanel_data_array=get_all_chanel_key($user_id);
foreach($chanel_data_数组作为$key=>$value){
$data=[
“市场id”=>“ATVPDKIKX0DER”,
“访问密钥”=>$value[“访问密钥”],
'secret\u key'=>$value['secret\u key'],
'商户id'=>$value['卖家id'],
'chanel_id'=>$value['chanel_id'],
];
注册通知($data$config);
打破
}
函数createDestination($sqsUrl){
$attribute=新的MWSSubscriptionsService_Model_AttributeKeyValue;
$attribute->setKey('sqqueueurl');
$attribute->setValue($sqsUrl);
$attributeList=新的MWSSubscriptionsService_Model_AttributeKeyValueList();
$attributeList->setmember($attribute);
$destination=新的MWSSubscriptionsService_Model_destination();
$destination->setAttributeList($attributeList);
$destination->setDeliveryChannel('SQS');
返回$destination;
}
函数寄存器通知($data,$config){
$service=新的MWSSubscriptionsService\u客户端(
$data['access_key'],
$data['secret_key'],
应用程序名称,
应用程序版本,
$config);
$request=新的MWSSubscriptionsService_Model_RegisterDestinationInput();
$request->setSellerId($data['merchant_id']);
//$request->setMWSAuthToken(MWSAUTHTOKEN);
$request->setMarketplaceId($data['marketplace_id']);
$createDestination=createDestination('https://sqs.us-west-2.amazonaws.com/34aajm0916646045/product');
$request->setDestination($createDestination);
回声“;
打印($createDestination);
回声“
”; invokeRegisterDestination($service,$request); }