Search the Community
Showing results for tags '400'.
-
Hi, i've necessity to manage multiple warehouse movements, but with actual webservice i can't do all action that i need, so i've started a new webservice, based on this resource: http://webkul.com/blog/how-to-add-new-tables-in-rest-api-of-prestashop/ I've created the service, but i've this error: This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request. when i've checked the schema, i saw that the schema response is empty. Have you some suggestions on this problem? Thanks for your time. Best regards.
- 3 replies
-
- custom
- webservice
-
(and 3 more)
Tagged with:
-
Hi guys i'm trying to add a new product via web services using the PSWebServiceLibrary, i tried to read other posts in this forum but i have problems. That's my code: function AddProduct($root_path, $authentication_key, $id, $name, $desc, $cat, $qta, $price){ try{ $webService = CreateWebServer($root_path,$authentication_key); $xml = $webService->get(array('resource' => 'products?schema=synopsis')); }catch(PrestashopWebserviceException $ex){ echo $ex->getMessage(); return -1; } $resources = $xml->children()->children(); unset($resources->position_in_category); unset($resources->manufacturer_name); $resources->price = floatval($price); $resources->quantity = intval($qta); $resources->link_rewrite->language[0][0] = str_replace(' ','-',$name); $resources->name->language[0][0] = $name; $resources->description->language[0][0] = $desc; $node= dom_import_simplexml($resources->description->language[0][0]); $no = $node->ownerDocument; $node->appendChild($no->createCDATASection($desc)); $resources->associations = ''; //echo $xml->asXML(); try{ $opt = array('resource' => 'products'); $opt['postXml'] = $xml->asXML(); $xml = $webService->add($opt); } catch(PrestaShopWebserviceException $ex) { echo $ex->getMessage(); } return 0; } When I run this funcion it gives me error: I think there's a sort of problem with the "required=true" parameters, but i don't know what to do. Thanks.
-
Buenas, Pues estaba mirando para modificar las imágenes, cuando me salió este error Bad Request Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit. Cookie: 0ce3beb550fcd80fa4e27.........(muchisimos codigos mas aqui) y ahora no me deja acceder de ningún modo a mi BackOffice. Sin embargo si que puedo ver la web, y navegar por ella. Gracias.
-
Hola a todos, el problema es el siguiente: He utilizado los archivos de ejemplo de los web services (0-CustomerList, 1-Retrieve, 2-Update ,3-Create y 4-Delete) y he echo los minimos cambios para poder ver, actualizar y crear nuevos Grupos. El echo es que al crear un nuevo grupo me salta el siguiente error: 'This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request.' HTTP REQUEST HEADER: GET /prestashop/api/groups?schema=blank HTTP/1.1 Authorization: Basic WUw5QkQ0RWUTlUOVpHSFkxOxxERVlTWVdRWUw5QkQpHTM6 Host: www.myshop.es Accept: */* HTPP RESPONSE HEADER: HTTP/1.1 200 OK Date: Fri, 16 Dec 2011 07:36:30 GMT Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.17 X-Powered-By: PrestaShop Webservice Access-Time: 1324020990 PSWS-Version: 1.4.6.2 Execution-Time: 0.008 Content-Sha1: 85c26c1e28db4458a1e28db441e28db448d53143b Content-Length: 252 Content-Type: text/xml;charset=utf-8 RETURN HTTP BODY: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <group> <id></id> <reduction></reduction> <price_display_method></price_display_method> <name><language id="3"></language></name> </group> </prestashop> HTTP REQUEST HEADER: POST /prestashop/api/groups HTTP/1.1 Authorization: Basic VllTlUOVpHSFOVpHSFkxOTlETlUOVpHSFWUTlUOVpHSFTM6 Host: www.myshop.es Accept: */* Content-Length: 243 Content-Type: application/x-www-form-urlencoded HTTP RESPONSE HEADER: HTTP/1.1 400 Bad Request Date: Fri, 16 Dec 2011 07:36:30 GMT Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.17 X-Powered-By: PrestaShop Webservice Access-Time: 1324020990 PSWS-Version: 1.4.6.2 Execution-Time: 0.008 Content-Length: 241 Connection: close Content-Type: text/xml;charset=utf-8 XML SENT: xml=<?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <group> <id>25</id> <reduction>5.00</reduction> <price_display_method>0</price_display_method> <name>New_Group</name> </group> </prestashop> RETURN HTTP BODY: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <message><![CDATA[internal error. To see this error please display the PHP errors.]]></message> </error> </errors> </prestashop> Other error This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request. ¿Alguien sabe que es lo que hago mal? ¿Alguna sugerencia? Gracias de antemano. 3-Creategroup.php
-
- 400
- Bad Request
-
(and 2 more)
Tagged with: