After downloading an unzipping Amazon's MWS client library api I have tried to run one of the scripts to see if everything is working.
when trying to run the file GetReportCountSample.php I get the error
Fatal error: Class 'MarketplaceWebService_Client' not found in C:\xampp\htdocs\sites\amazon marketplace\Samples\GetReportCountSample.php on line 68
I've looked through the config file and I have input my credentials such as:
define('AWS_ACCESS_KEY_ID', '<key id>');                 //has been input
define('AWS_SECRET_ACCESS_KEY', '<secret key id>');       //has been input
define('APPLICATION_NAME', '<Your Application Name>');   //no idea what this is
define('APPLICATION_VERSION', '<Your Application Version or Build Number>'); //no idea
define ('MERCHANT_ID', '<merch id>');                    //has been input
I can not find a php file called MarketplaceWebService_Client, I need help, thanks.
There is no php file called MarketplaceWebService_Client. Its Client.php in your downloaded library. MarketplaceWebService_Client Class is in client.php file only. I think include path of Client.php is not correctly specified in GetReportCountSample.php. Client.php may be in the following path(Outside of Samples folder): C:\xampp\htdocs\sites\amazon marketplace\Client.php
Inside .config.inc.php you will have the following:
   /************************************************************************
    * OPTIONAL ON SOME INSTALLATIONS
    *
    * Set include path to root of library, relative to Samples directory.
    * Only needed when running library from local directory.
    * If library is installed in PHP include path, this is not needed
    ***********************************************************************/
    set_include_path(get_include_path() . PATH_SEPARATOR . '../../.');
This defines include paths, which are used in this program to load all the assorted files for the classes. Each one is seperated by PATH_SEPARATOR. This function adds another include path, which is 2 directories above the current working directory, and that is not the right directory. You have to point to the src directory.
To fix this, change '../../.' to point to the directory where the src folder is. My scripts and the src directory are in the same parent directory, so my code looks like this:
set_include_path(get_include_path() . PATH_SEPARATOR . getcwd().'/src/');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With