Bukimedia / PrestaSharp

CSharp .Net client library for the PrestaShop API via web service
GNU General Public License v3.0
154 stars 151 forks source link

Products.GetALL Return null #275

Closed pc4service closed 5 years ago

pc4service commented 7 years ago

Hello,

I have code

string BaseUrl = Convert.ToString(inifile.Read("Prestashop", "Url")); string Account = Convert.ToString(inifile.Read("Prestashop", "ApiKey")); ; string Password = "";

        ProductFactory PF = new ProductFactory(BaseUrl, Account, Password);
        List<product> products = PF.GetAll();

and return null. What its going wrong ?

Thanks

Selmirrrrr commented 7 years ago

Are you providing URL with the '/api' part ?

capricornius commented 7 years ago

I have the same error. a fact, this happens to me when I put the prestashop in mode debug. otherwise, give me internal error full

MarcoITDev commented 7 years ago

Hi, If you have a lot of products, and you call .GetAll, the xml response is too big so the connection is expired by timeout. I experienced the same problem with stock_available

Selmirrrrr commented 7 years ago

@navimel I had a try with a 28k products database and it worked well for me.

MarcoITDev commented 7 years ago

@R0xtar may be your timeout is set high than mine....I've got 26K products....

mowcixo commented 5 years ago

It may depend on your server characteristics, anyway, I would recommend you to always paginate the results.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.