Jump to content

webservice add issue -> String could not be parsed as XML


Guest

Recommended Posts

Hi,

I have an issue with the webservice add function. I'm retrieving a blank schema like this:

$xml_stock_mvt = $webService->get(array('url' => 'http://www.url.com/api/stock_movements?schema=blank'));



After this I'm updating the values and call the add function:

$opt = array('resource' => 'stock_movements'); 
$opt['postXml'] = (string)$xml_stock_mvt->asXML(); 
$xml_stock_mvt = $webService->add($opt);



The XML I'm posting is (from webservice debug info):

XML SENT
xml=<?xml version="1.0" encoding="UTF-8"?>



3
541
0
1
1
6



But I'm getting a lot of XML errors like this one:

<?xml version="1.0" encoding="UTF-8"?>



<![CDATA[3]]>
<![CDATA[[php Warning #2] SimpleXMLElement::__construct(): Entity: line 1: parser error : String not started expecting ' or " (/home/domains/www.url.com/public_html/classes/WebserviceRequest.php, line 1251)]]>



and eventually:

<![CDATA[xml error : String could not be parsed as XML
XML length : 359
Original XML : <?xml version=\"1.0\" encoding=\"UTF-8\"?>



3
541
0
1
1
6


]]>



I have no idea what I'm doing wrong or how to fix this. Does anybody have a clue of what I am doing wrong? I'm running prestashop 1.4.3.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...