I'm trying to send data via xml to navision system, but every time i've tryied to send data i get a diferent error.
This is my php function
public function sendDataToNavision($xml, $config) {
$address = isset($config["address"]) ? $config["address"] : "localhost";
$port = isset($config["port"]) ? (int) $config["port"] : 80;
$fp = fsockopen($address, $port, $errno, $errstr, 5);
echo "Trying to send the data, fsockopen status: " . $fp;
if ($fp > 0) {
fputs($fp, $xml . "\r\n\0");
echo "Attempting to get the data\n";
while (!feof($fp)) {
$response .= fgets($fp);
echo $response;
}
fclose($fp);
echo $response;
}
}
This is the function that seems to work better