jeudi 26 mai 2016

How can we make post requests to Tally over the internet to insert vouchers?

I have created a php script which makes post requests to tally server running on my localhost. But now, I want to make a request from a server to a different machine in a different network, via internet. I tried it from a different computer in the same LAN and I could see the "Tally server is running" message, but my cURL somehow failed and the XML data was not getting inserted in Tally. I am currently using Tally in educational mode. Following is the code I used for the curl calls. $str contains the XML data as string.

$curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "127.0.0.1:9002");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $str);
    //$result = curl_exec($curl);
    curl_close($curl);




Aucun commentaire:

Enregistrer un commentaire