Comments (9)
I think I had that error before... but I can't remember how to fix it :-/
Have you tried with a real file (saved on disk) instead of a temp file?
The basic method you're using looks reasonable. My code looks similar:
$clientPack = $mwsClientPool->getFeedAndReportClientPack();
$fileHandle = @fopen($fullFilePath, 'r');
/** @var \MarketplaceWebService_Model_SubmitFeedResponse $mwsResponse */
$mwsResponse = $clientPack->callSubmitFeed($feedType, $fileHandle);
from amazonmwscomplete.
Thank you for your fast response, i'm gonna try your solution as soon as possible and i come back for tell you if it's working.
Thank you very much.
from amazonmwscomplete.
Hi,
I just test your solution and i have the same issue with a real file save on Disk.
you can show my code below:
`$fullPAth = '/var/www/testAmazon/document/report.txt';
var_dump($fullPAth);
$feedHandle = @fopen($fullPAth, 'r');
var_dump($feedHandle);
fwrite($feedHandle, $feed);
$productClientPackUsa->callSubmitFeed('_POST_PRODUCT_DATA_', $feedHandle);
rewind($feedHandle);
@fclose($feedHandle);`
and the var_dump($feedhandle): resource(573, stream)
I don't know what is going wrong here.
Thank you for your help.
from amazonmwscomplete.
I try to follow the code and i think i find something in /var/www/testAmazon/vendor/caponica/amazon-mws-complete/src/AmazonPhpClientLibrary/MarketplaceWebService/Client.php
var_dump($headers);
array_push($headers, "Content-Type: " . $request->getContentType()->toString());
var_dump($headers);
The firsts var_dump() give me a response
/var/www/testAmazon/vendor/caponica/amazon-mws-complete/src/AmazonPhpClientLibrary/MarketplaceWebService/Client.php:1454: array (size=0) empty
But the second return nothing.
Do you think the problem is here ?
from amazonmwscomplete.
Finaly i find the problem, it's from ContentType.php
public function isSetParameters() { return count ($this->fields['Parameters']['FieldValue']) > 0; }
the function call the function count but $this->fields['Parameters']['fieldValue'] is not an array
from amazonmwscomplete.
So i change the function by
public function isSetParameters() { if (is_array($this->fields['Parameters']['FieldValue'])){ return count ($this->fields['Parameters']['FieldValue']) > 0; }else{ return false; } }
and it's work for me.
Do you think it's good ?
from amazonmwscomplete.
I'll try to take a look at this later today and get back to you
from amazonmwscomplete.
OK, so this is caused by your PHP version handling count()
differently to PHP<7.2.0.
Changing the Amazon library is not the best idea, since it will be over-written when the library pack is next updated. (This is obviously frustrating, since some of the code in there is... interesting.)
If you're using PHP 7.2.x I guess you're likely to run into several compatibility issues until Amazon updates the codebase.
Based on the documentation, I'm guessing that you are getting a warning (rather than a fatal error) - is that correct? If so then you may be better using a custom error handler to deal with it rather than changing the Amazon library.
See discussions here and here for more insight, as well as the PHP docs here.
from amazonmwscomplete.
Sorry for my absence and thank you for your answer.
At the moment, i just change my php version for the 7.1 and it's work very well.
I will wait for use the 7.2 :)
Thank you for you help.
from amazonmwscomplete.
Related Issues (18)
- iconv.output_encoding is deprecated since PHP 5.6 HOT 1
- OrdersList API alway returning null values for "x-mws-quota-max", "x-mws-quota-remaining" and "x-mws-quota-resetsOn" in ResponseHeaderMetadata HOT 4
- Add facility to set an MWSAuthToken and pass it through to API calls HOT 5
- Can't request PARAM_REQUESTED_FROM_DATE for getReport HOT 7
- echo calls messing up the output buffer. HOT 3
- Error in SubmitFeed Request. HOT 1
- How to create FbaInboundClient via MwsClientPool? HOT 2
- MarketplaceWebService_Client - use undefined constant CURLOPT_POST HOT 4
- Could you add Turkey to ClientPool please? HOT 4
- getNonAmazonMarketplaceIds SITE_TURKEY value HOT 1
- Redefinition of parameter $quotaMax HOT 4
- $searchResponse->getRawXml() returns null HOT 1
- FbaOutboundClientPack param PARAM_DESTINATION_ADDRESS is incorrect HOT 3
- count(): Parameter must be an array or an object that implements Countable
- Make private methods protected
- Is there support for the CreateFulfillmentOrder? HOT 3
- I want to delete the product but I can not HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazonmwscomplete.