Bukimedia / PrestaSharp

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

Prestashop v1.7.6.5 - error - reference null #403

Closed crevecoeurj closed 3 years ago

crevecoeurj commented 4 years ago

Hi,

On Website with version 1.7.6.5, the last version of prestasharp send an error with Create "Product, order...etc) The same body with postman works.

Does anyone meet the problem ?

oromand commented 4 years ago

I do, I figured out a fresh copy of the sources wouldn't behave the same ??

oromand commented 4 years ago

@crevecoeurj : I publish a forked version attempting to fix those stability issues. Could you give it a try ? The nuget is named PrestaSharp.Extended.

crevecoeurj commented 4 years ago

Great news, i test that soon as possible. Thanks

infosteo commented 3 years ago

Same for me, GetAll Method for products always gets null. Current Prestasharp version in 1.2.6 (fork).

EduLeonPavon commented 3 years ago

Hi guys, thanks to @oromand now you can try to fix this issue with the last version of PrestaSharp.

infosteo commented 3 years ago

Thank you, but where can I find the latest version?

oromand commented 3 years ago

Same for me, GetAll Method for products always gets null. Current Prestasharp version in 1.2.6 (fork).

Is it possible to have some sort of reproductible case ? postman example or so ?

infosteo commented 3 years ago

I debugged the project with source code and I found:

Status Code:OK Content type: text/html; charset=utf-8 Error message: Prestashop failed to serve XML response instead got text: <!doctype html>

etc. (full html web page) responseuri: https://myprestashopsite.whatever/index.php?url=products&display=full&date=1&ws_key=mykey Data:null Maybe something has changed on my webserver but I can't understand what. Is it possible in this case to get an exception? Thank you
oromand commented 3 years ago

I was thinking to have some reference of the response to evaluate the return code and the error in case of trouble. Haven't made my mind though. What does the HTML page says ? Is it some prestashop content ? or some API error ?

crevecoeurj commented 3 years ago

Hi oromand,

I test in 1.7.6.7 and 1.7.6.5 and i t works . (Add manufacturer et GetAll ) of products

I suggest, your find a good new name for your fork and everybody switch on :-)

infosteo commented 3 years ago

I was thinking to have some reference of the response to evaluate the return code and the error in case of trouble. Haven't made my mind though. What does the HTML page says ? Is it some prestashop content ? or some API error ?

The response.content is the complete html page I get if I put the responseuri on a web browser. My prestashop version in 1.7.6.4

infosteo commented 3 years ago

This is the response I get via Soap UI (Postman too). pic04

infosteo commented 3 years ago

Via Chrome I get a XML response.

pic05

infosteo commented 3 years ago

I have noticed that https://irrigazioneperfetta.com/api/products/?display=full

turns into AbsoluteUri = "https://irrigazioneperfetta.com/index.php?url=products%2F&display=full" after .GetResponse() why?

infosteo commented 3 years ago

Finally I've solved the problem: Prestashop needs "Friendly urls". See Attach. 117590483_10157640012813284_8926029641709409234_n