使用php将XML数据导入理货不起作用

时间:2019-07-06 05:44:26

标签: php xml tally

无法使用php将数据导入理货 出现错误无法将&SVCurrentCompany&设置为&APB

$voucher_data='<ENVELOPE><HEADER><TALLYREQUEST>Import Data</TALLYREQUEST></HEADER>

...........

...........


</REQUESTDATA></IMPORTDATA></BODY></ENVELOPE>';

$url = "http://localhost:9000";
$headers =array("Content-type: text/xml", "Content-length:" . strlen($voucher_data), "Connection: close");



$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $voucher_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = curl_exec($ch);

if(curl_errno($ch)) {
    print curl_error($ch);
} else {
    print "<pre>" . htmlentities($data) . "</pre>";
    curl_close($ch);
}

数据未插入我的理货

0 个答案:

没有答案