Jump to content

Web service error 127 while creating address resouce


Recommended Posts

I have a problem creating new customer's address via web service.

Web service POST request URL = http://mkp.co.in/myprshop2/api/addresses?ws_key=GHSCR4BZ6B6VHX5W1EYZDAOXYI9NYMQH

Following is the content i am sending:

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink"><address>    <id><![CDATA[]]></id>    <id_customer><![CDATA[2]]></id_customer>    <id_manufacturer><![CDATA[0]]></id_manufacturer>    <id_supplier><![CDATA[0]]></id_supplier>    <id_warehouse><![CDATA[0]]></id_warehouse>    <id_country><![CDATA[8]]></id_country>    <id_state><![CDATA[0]]></id_state>    <alias><![CDATA[My address]]></alias>    <company><![CDATA[]]></company>    <lastname><![CDATA[Kacha]]></lastname>    <firstname><![CDATA[Jatin]]></firstname>    <vat_number></vat_number>    <address1><![CDATA[2, Mehul Nagar, Bh. Nilkanth cinema]]></address1>    <address2><![CDATA[]]></address2>    <postcode><![CDATA[360002]]></postcode>    <city><![CDATA[Rjt]]></city>    <other><![CDATA[]]></other>    <phone><![CDATA[992552894]]></phone>    <phone_mobile></phone_mobile>    <dni><![CDATA[]]></dni>    <deleted><![CDATA[0]]></deleted>    <date_add><![CDATA[]]></date_add>    <date_upd><![CDATA[]]></date_upd></address></prestashop>

It returns:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop
xmlns:xlink="http://www.w3.org/1999/xlink">
<errors>
<error>
<code>
<![CDATA[127]]>
</code>
<message>
<![CDATA[xml error : String could not be parsed as XML
XML length : 0
Original XML : ]]>
</message>
</error>
</errors>
</prestashop>

I did try by appending XML content in the URL itself like:

xml=<prestashop xmlns:xlink="http://www.w3.org/1999/xlink"><address>    <id><![CDATA[]]></id>    <id_customer><![CDATA[2]]></id_customer>    <id_manufacturer><![CDATA[0]]></id_manufacturer>    <id_supplier><![CDATA[0]]></id_supplier>    <id_warehouse><![CDATA[0]]></id_warehouse>    <id_country><![CDATA[8]]></id_country>    <id_state><![CDATA[0]]></id_state>    <alias><![CDATA[My address]]></alias>    <company><![CDATA[]]></company>    <lastname><![CDATA[Kacha]]></lastname>    <firstname><![CDATA[Jatin]]></firstname>    <vat_number></vat_number>    <address1><![CDATA[2, Mehul Nagar, Bh. Nilkanth cinema]]></address1>    <address2><![CDATA[]]></address2>    <postcode><![CDATA[360002]]></postcode>    <city><![CDATA[Rjt]]></city>    <other><![CDATA[]]></other>    <phone><![CDATA[992552894]]></phone>    <phone_mobile></phone_mobile>    <dni><![CDATA[]]></dni>    <deleted><![CDATA[0]]></deleted>    <date_add><![CDATA[]]></date_add>    <date_upd><![CDATA[]]></date_upd></address></prestashop>

But same error.

I used RESTClient firefox Addon, programatically through PHP, but same error returned.

Can anyone please help me?

Paid / professional help will also be welcome. Its critical for me, and need to solve it urgent.

Thanks in advance

Link to comment
Share on other sites

Muktadir,

 

Here is the XML i send in POST request body.

 

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink"><address>    <id><![CDATA[]]></id>    <id_customer><![CDATA[2]]></id_customer>    <id_manufacturer><![CDATA[0]]></id_manufacturer>    <id_supplier><![CDATA[0]]></id_supplier>    <id_warehouse><![CDATA[0]]></id_warehouse>    <id_country><![CDATA[8]]></id_country>    <id_state><![CDATA[0]]></id_state>    <alias><![CDATA[My address]]></alias>    <company><![CDATA[]]></company>    <lastname><![CDATA[Kacha]]></lastname>    <firstname><![CDATA[Jatin]]></firstname>    <vat_number></vat_number>    <address1><![CDATA[2, Mehul Nagar, Bh. Nilkanth cinema]]></address1>    <address2><![CDATA[]]></address2>    <postcode><![CDATA[360002]]></postcode>    <city><![CDATA[Rjt]]></city>    <other><![CDATA[]]></other>    <phone><![CDATA[992552894]]></phone>    <phone_mobile></phone_mobile>    <dni><![CDATA[]]></dni>    <deleted><![CDATA[0]]></deleted>    <date_add><![CDATA[]]></date_add>    <date_upd><![CDATA[]]></date_upd></address></prestashop>

 

I also try making a post request like:

 

In some thread, few people has also guided to pass XML data in query string itself.

 

http://mkp.co.in/myprshop2/api/addresses?ws_key=GHSCR4BZ6B6VHX5W1EYZDAOXYI9NYMQH&xml=<prestashop xmlns:xlink="http://www.w3.org/1999/xlink"><address>    <id><![CDATA[]]></id>    <id_customer><![CDATA[2]]></id_customer>    <id_manufacturer><![CDATA[0]]></id_manufacturer>    <id_supplier><![CDATA[0]]></id_supplier>    <id_warehouse><![CDATA[0]]></id_warehouse>    <id_country><![CDATA[8]]></id_country>    <id_state><![CDATA[0]]></id_state>    <alias><![CDATA[My address]]></alias>    <company><![CDATA[]]></company>    <lastname><![CDATA[Kacha]]></lastname>    <firstname><![CDATA[Jatin]]></firstname>    <vat_number></vat_number>    <address1><![CDATA[2, Mehul Nagar, Bh. Nilkanth cinema]]></address1>    <address2><![CDATA[]]></address2>    <postcode><![CDATA[360002]]></postcode>    <city><![CDATA[Rjt]]></city>    <other><![CDATA[]]></other>    <phone><![CDATA[992552894]]></phone>    <phone_mobile></phone_mobile>    <dni><![CDATA[]]></dni>    <deleted><![CDATA[0]]></deleted>    <date_add><![CDATA[]]></date_add>    <date_upd><![CDATA[]]></date_upd></address></prestashop>

Link to comment
Share on other sites

×
×
  • Create New...