amelie13 Posted April 17, 2013 Share Posted April 17, 2013 (edited) Hi, I've configured the webservices. I have fatal errors when i add a new order. So i decided to lanch my XML using ssh console. here is my XML, exemple.xml : <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <order> <id_address_delivery required="true" format="isUnsignedId">1</id_address_delivery> <id_address_invoice required="true" format="isUnsignedId">1</id_address_invoice> <id_cart required="true" format="isUnsignedId">2</id_cart> <id_currency required="true" format="isUnsignedId">2</id_currency> <id_lang required="true" format="isUnsignedId">5</id_lang> <id_customer required="true" format="isUnsignedId">7</id_customer> <id_carrier required="true" format="isUnsignedId">8</id_carrier> <current_state format="isUnsignedId"/> <module>cheque</module> <invoice_number/> <invoice_date/> <delivery_number/> <delivery_date/> <valid/> <date_add format="isDate"/> <date_upd format="isDate"/> <id_shop_group format="isUnsignedId">1</id_shop_group> <id_shop format="isUnsignedId">1</id_shop> <secure_key format="isMd5"/> <payment required="true" format="isGenericName">Chèque</payment> <recyclable format="isBool"/> <gift format="isBool"/> <gift_message format="isMessage"/> <total_discounts format="isPrice"/> <total_discounts_tax_incl format="isPrice">0.00</total_discounts_tax_incl> <total_discounts_tax_excl format="isPrice">0.00</total_discounts_tax_excl> <total_paid required="true" format="isPrice">40.90</total_paid> <total_paid_tax_incl format="isPrice">40.90</total_paid_tax_incl> <total_paid_tax_excl format="isPrice">32.88</total_paid_tax_excl> <total_paid_real required="true" format="isPrice">40.90</total_paid_real> <total_products required="true" format="isPrice">40.90</total_products> <total_products_wt required="true" format="isPrice">40.90</total_products_wt> <total_shipping format="isPrice"/> <total_shipping_tax_incl format="isPrice"/> <total_shipping_tax_excl format="isPrice"/> <carrier_tax_rate format="isFloat"/> <total_wrapping format="isPrice"/> <total_wrapping_tax_incl format="isPrice"/> <total_wrapping_tax_excl format="isPrice"/> <shipping_number format="isTrackingNumber"/> <conversion_rate required="true" format="isFloat">1.000000</conversion_rate> <reference/> <associations> <order_rows> <order_row> <id>1</id> <product_id>11</product_id> <product_quantity>1</product_quantity> <product_name>Coque Smart</product_name> <product_price>35.9</product_price> </order_row> </order_rows> </associations> </order> </prestashop> I launch this command : curl --trace-ascii err.txt -X POST -H "Content-type:text/xml" --data-urlencode @exemple.xml "http://mykey:@myurl.info/api/orders/" So here is my err.txt : == Info: About to connect() to myurl.info port 80 (#0) == Info: Trying 94.23.117.XXX... == Info: connected == Info: Connected to myurl.info (94.23.117.XXX) port 80 (#0) == Info: Server auth using Basic with user 'mykey' => Send header, 340 bytes (0x154) 0000: POST /api/orders/ HTTP/1.1 001c: Authorization: Basic R05XTDM2NzUwSkhKNTBDVkdCWlg5TlhPVENNTldWMzA 005c: 6 005f: User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 Ope 009f: nSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6 00d3: Host: myurl.info 0102: Accept: */* 010f: Content-type:text/xml 0126: Content-Length: 3778 013c: Expect: 100-continue 0152: <= Recv header, 23 bytes (0x17) 0000: HTTP/1.1 100 Continue => Send data, 3778 bytes (0xec2) 0000: %3C%3Fxml%20version%3D%221%2E0%22%20encoding%3D%22UTF%2D8%22%3F% 0040: 3E%0A%3Cprestashop%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww%2Ew3%2E 0080: org%2F1999%2Fxlink%22%3E%0A%3Corder%3E%0A%09%3Cid%5Faddress%5Fde 00c0: livery%20required%3D%22true%22%20format%3D%22isUnsignedId%22%3E1 0100: %3C%2Fid%5Faddress%5Fdelivery%3E%0A%09%3Cid%5Faddress%5Finvoice% 0140: 20required%3D%22true%22%20format%3D%22isUnsignedId%22%3E1%3C%2Fi 0180: d%5Faddress%5Finvoice%3E%0A%09%3Cid%5Fcart%20required%3D%22true% 01c0: 22%20format%3D%22isUnsignedId%22%3E2%3C%2Fid%5Fcart%3E%0A%09%3Ci 0200: d%5Fcurrency%20required%3D%22true%22%20format%3D%22isUnsignedId% 0240: 22%3E2%3C%2Fid%5Fcurrency%3E%0A%09%3Cid%5Flang%20required%3D%22t 0280: rue%22%20format%3D%22isUnsignedId%22%3E5%3C%2Fid%5Flang%3E%0A%09 02c0: %3Cid%5Fcustomer%20required%3D%22true%22%20format%3D%22isUnsigne 0300: dId%22%3E7%3C%2Fid%5Fcustomer%3E%0A%09%3Cid%5Fcarrier%20required 0340: %3D%22true%22%20format%3D%22isUnsignedId%22%3E8%3C%2Fid%5Fcarrie 0380: r%3E%0A%09%3Ccurrent%5Fstate%20format%3D%22isUnsignedId%22%2F%3E 03c0: %0A%09%3Cmodule%3Echeque%3C%2Fmodule%3E%0A%09%3Cinvoice%5Fnumber 0400: %2F%3E%0A%09%3Cinvoice%5Fdate%2F%3E%0A%09%3Cdelivery%5Fnumber%2F 0440: %3E%0A%09%3Cdelivery%5Fdate%2F%3E%0A%09%3Cvalid%2F%3E%0A%09%3Cda 0480: te%5Fadd%20format%3D%22isDate%22%2F%3E%0A%09%3Cdate%5Fupd%20form 04c0: at%3D%22isDate%22%2F%3E%0A%09%3Cid%5Fshop%5Fgroup%20format%3D%22 0500: isUnsignedId%22%3E1%3C%2Fid%5Fshop%5Fgroup%3E%0A%09%3Cid%5Fshop% 0540: 20format%3D%22isUnsignedId%22%3E1%3C%2Fid%5Fshop%3E%0A%09%3Csecu 0580: re%5Fkey%20format%3D%22isMd5%22%2F%3E%0A%09%3Cpayment%20required 05c0: %3D%22true%22%20format%3D%22isGenericName%22%3ECheque%3C%2Fpayme 0600: nt%3E%0A%09%3Crecyclable%20format%3D%22isBool%22%2F%3E%0A%09%3Cg 0640: ift%20format%3D%22isBool%22%2F%3E%0A%09%3Cgift%5Fmessage%20forma 0680: t%3D%22isMessage%22%2F%3E%0A%09%3Ctotal%5Fdiscounts%20format%3D% 06c0: 22isPrice%22%2F%3E%0A%09%3Ctotal%5Fdiscounts%5Ftax%5Fincl%20form 0700: at%3D%22isPrice%22%3E0%2E00%3C%2Ftotal%5Fdiscounts%5Ftax%5Fincl% 0740: 3E%0A%09%3Ctotal%5Fdiscounts%5Ftax%5Fexcl%20format%3D%22isPrice% 0780: 22%3E0%2E00%3C%2Ftotal%5Fdiscounts%5Ftax%5Fexcl%3E%0A%09%3Ctotal 07c0: %5Fpaid%20required%3D%22true%22%20format%3D%22isPrice%22%3E40%2E 0800: 90%3C%2Ftotal%5Fpaid%3E%0A%09%3Ctotal%5Fpaid%5Ftax%5Fincl%20form 0840: at%3D%22isPrice%22%3E40%2E90%3C%2Ftotal%5Fpaid%5Ftax%5Fincl%3E%0 0880: A%09%3Ctotal%5Fpaid%5Ftax%5Fexcl%20format%3D%22isPrice%22%3E32%2 08c0: E88%3C%2Ftotal%5Fpaid%5Ftax%5Fexcl%3E%0A%09%3Ctotal%5Fpaid%5Frea 0900: l%20required%3D%22true%22%20format%3D%22isPrice%22%3E40%2E90%3C% 0940: 2Ftotal%5Fpaid%5Freal%3E%0A%09%3Ctotal%5Fproducts%20required%3D% 0980: 22true%22%20format%3D%22isPrice%22%3E40%2E90%3C%2Ftotal%5Fproduc 09c0: ts%3E%0A%09%3Ctotal%5Fproducts%5Fwt%20required%3D%22true%22%20fo 0a00: rmat%3D%22isPrice%22%3E40%2E90%3C%2Ftotal%5Fproducts%5Fwt%3E%0A% 0a40: 09%3Ctotal%5Fshipping%20format%3D%22isPrice%22%2F%3E%0A%09%3Ctot 0a80: al%5Fshipping%5Ftax%5Fincl%20format%3D%22isPrice%22%2F%3E%0A%09% 0ac0: 3Ctotal%5Fshipping%5Ftax%5Fexcl%20format%3D%22isPrice%22%2F%3E%0 0b00: A%09%3Ccarrier%5Ftax%5Frate%20format%3D%22isFloat%22%2F%3E%0A%09 0b40: %3Ctotal%5Fwrapping%20format%3D%22isPrice%22%2F%3E%0A%09%3Ctotal 0b80: %5Fwrapping%5Ftax%5Fincl%20format%3D%22isPrice%22%2F%3E%0A%09%3C 0bc0: total%5Fwrapping%5Ftax%5Fexcl%20format%3D%22isPrice%22%2F%3E%0A% 0c00: 09%3Cshipping%5Fnumber%20format%3D%22isTrackingNumber%22%2F%3E%0 0c40: A%09%3Cconversion%5Frate%20required%3D%22true%22%20format%3D%22i 0c80: sFloat%22%3E1%2E000000%3C%2Fconversion%5Frate%3E%0A%09%3Creferen 0cc0: ce%2F%3E%0A%09%3Cassociations%3E%0A%09%09%3Corder%5Frows%3E%0A%0 0d00: 9%09%09%3Corder%5Frow%3E%0A%09%09%09%09%3Cid%3E1%3C%2Fid%3E%0A%0 0d40: 9%09%09%09%3Cproduct%5Fid%3E11%3C%2Fproduct%5Fid%3E%0A%09%09%09% 0d80: 09%3Cproduct%5Fquantity%3E1%3C%2Fproduct%5Fquantity%3E%0A%09%09% 0dc0: 09%09%3Cproduct%5Fname%3ECoque%20Smart%3C%2Fproduct%5Fname%3E%0A 0e00: %09%09%09%09%3Cproduct%5Fprice%3E35%2E9%3C%2Fproduct%5Fprice%3E% 0e00: %09%09%09%09%3Cproduct%5Fprice%3E35%2E9%3C%2Fproduct%5Fprice%3E% 0e40: 0A%09%09%09%3C%2Forder%5Frow%3E%0A%09%09%3C%2Forder%5Frows%3E%0A 0e80: %09%3C%2Fassociations%3E%0A%3C%2Forder%3E%0A%3C%2Fprestashop%3E% 0ec0: 0A <= Recv header, 36 bytes (0x24) 0000: HTTP/1.1 500 Internal Server Error <= Recv header, 37 bytes (0x25) 0000: Date: Wed, 17 Apr 2013 09:43:57 GMT <= Recv header, 32 bytes (0x20) 0000: Server: Apache/2.2.16 (Debian) <= Recv header, 25 bytes (0x19) 0000: Access-Time: 1366191837 <= Recv header, 37 bytes (0x25) 0000: X-Powered-By: PrestaShop Webservice <= Recv header, 23 bytes (0x17) 0000: PSWS-Version: 1.5.3.1 <= Recv header, 23 bytes (0x17) 0000: Execution-Time: 0.004 <= Recv header, 256 bytes (0x100) 0000: Set-Cookie: 3f99a2f33f7744ef0eca694ec6b1a644=myYaoeUfgSXHPzQw29T 0040: P%2BH8rGx1Q%2BqicBr1Hgh2%2FnfoIbcKpg0RsOylYsEG64biESHuGS26Y4WRSw 0080: gWiaKz4IA%3D%3D000059; expires=Tue, 07-May-2013 09:43:57 GMT; pa 00c0: th=/; domain=myurl.info; httponly <= Recv header, 26 bytes (0x1a) 0000: Vary: Authorization,Host <= Recv header, 19 bytes (0x13) 0000: Connection: close <= Recv header, 28 bytes (0x1c) 0000: Transfer-Encoding: chunked <= Recv header, 38 bytes (0x26) 0000: Content-Type: text/xml;charset=utf-8 <= Recv header, 2 bytes (0x2) 0000: <= Recv data, 294 bytes (0x126) 0000: 11a 0005: <?xml version="1.0" encoding="UTF-8"?>.<prestashop xmlns:xlink=" 0045: http://www.w3.org/1999/xlink">.<errors>.<error>.<code><![CDATA[1 0085: 27]]></code>.<message><![CDATA[xml error : String could not be p 00c5: arsed as XML.XML length : 0.Original XML : ]]></message>.</error 0105: >.</errors>.</prestashop>. 0121: 0 0124: == Info: Closing connection #0 Any ideas ? Please help :s Edited April 17, 2013 by amelie13 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts