[AmazonMWS] PHP Notice: Undefined variable: serviceUrl in… エラーが出る時の対処

エラーメッセージ

PHP Notice:  Undefined variable: serviceUrl in ...\amazon-mws-v20111001-php-2012-07-01._V144471503_
\src\MarketplaceWebServiceProducts\Samples\GetLowestOfferListingsForASINSample.php on line 43




このエラーは、実行したサンプルプログラムの$serviceUrl変数を定義していないために発生します。


対処法は、サンプルプログラムの先頭付近に以下の定義があるので…

/************************************************************************
 * Instantiate Implementation of MarketplaceWebServiceProducts
 * 
 * AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY constants 
 * are defined in the .config.inc.php located in the same 
 * directory as this sample
 ***********************************************************************/
// United States:
//$serviceUrl = "https://mws.amazonservices.com/Products/2011-10-01";
// Europe
//$serviceUrl = "https://mws-eu.amazonservices.com/Products/2011-10-01";
// Japan
//$serviceUrl = "https://mws.amazonservices.jp/Products/2011-10-01";
// China
//$serviceUrl = "https://mws.amazonservices.com.cn/Products/2011-10-01";
// Canada
//$serviceUrl = "https://mws.amazonservices.ca/Products/2011-10-01";



日本で使用する場合は、以下のコメントを外します。

変更前

//$serviceUrl = "https://mws.amazonservices.jp/Products/2011-10-01";



修正後

$serviceUrl = "https://mws.amazonservices.jp/Products/2011-10-01";


関連記事

コメントを残す

メールアドレスが公開されることはありません。